@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-muted: #f7f9fc;
  --field: #ffffff;
  --ink: #162033;
  --muted: #64748b;
  --line: #dbe3ec;
  --navy: #102a43;
  --navy-strong: #0b1f33;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #e8f0ff;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --coral: #b42318;
  --amber: #b7791f;
  --green: #15803d;
  --hover: #f8fbff;
  --neutral-soft: #e8edf3;
  --warning-soft: #fff4d6;
  --success-soft: #ecfdf3;
  --note-soft: #fff7df;
  --danger-soft: #fee2e2;
  --overlay: rgba(11, 31, 51, 0.48);
  --shadow: 0 16px 50px rgba(16, 42, 67, 0.08);
  --text: var(--ink);
  --text-muted: var(--muted);
  --accent: var(--blue-dark);
  --primary: var(--blue);
  --primary-soft: var(--blue-soft);
  --soft-blue: var(--blue-soft);
  --red: var(--coral);
  --green-dark: var(--green);
  --green-soft: var(--success-soft);
  --amber-dark: var(--amber);
  --radius-sm: 8px;
  --message-thread-height: 340px;
  --sidebar-bg: linear-gradient(180deg, #fbfdff 0%, #eef5fb 100%);
  --sidebar-ink: #14283e;
  --sidebar-muted: #60758b;
  --sidebar-line: #d9e5f0;
  --sidebar-item-hover: #ffffff;
  --sidebar-icon-bg: #ffffff;
  --sidebar-icon-border: #dbe7f2;
  --sidebar-button-bg: #ffffff;
  --sidebar-button-ink: #1d3851;
  --sidebar-button-border: #cddceb;
  font-family: Manrope, "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1624;
  --surface: #151f2f;
  --surface-muted: #101a29;
  --field: #0f1827;
  --ink: #e7edf6;
  --muted: #98a8bd;
  --line: #2a384d;
  --navy: #0f253c;
  --navy-strong: #08111f;
  --blue: #60a5fa;
  --blue-dark: #bfdbfe;
  --blue-soft: #17345a;
  --teal: #14b8a6;
  --teal-dark: #5eead4;
  --coral: #f87171;
  --amber: #fbbf24;
  --green: #22c55e;
  --hover: #18273b;
  --neutral-soft: #243244;
  --warning-soft: #3a2b11;
  --success-soft: #102d1d;
  --note-soft: #332715;
  --danger-soft: #3a171a;
  --overlay: rgba(2, 8, 23, 0.72);
  --shadow: 0 18px 56px rgba(0, 0, 0, 0.26);
  --text: var(--ink);
  --text-muted: var(--muted);
  --accent: var(--blue-dark);
  --primary: var(--blue);
  --primary-soft: var(--blue-soft);
  --soft-blue: var(--blue-soft);
  --red: var(--coral);
  --green-dark: #86efac;
  --green-soft: var(--success-soft);
  --amber-dark: #fcd34d;
  --radius-sm: 8px;
  --message-thread-height: 340px;
  --sidebar-bg: var(--navy-strong);
  --sidebar-ink: #f8fafc;
  --sidebar-muted: rgba(248, 250, 252, 0.68);
  --sidebar-line: rgba(255, 255, 255, 0.14);
  --sidebar-item-hover: rgba(255, 255, 255, 0.1);
  --sidebar-icon-bg: rgba(255, 255, 255, 0.12);
  --sidebar-icon-border: rgba(255, 255, 255, 0.14);
  --sidebar-button-bg: rgba(255, 255, 255, 0.1);
  --sidebar-button-ink: #f8fafc;
  --sidebar-button-border: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Manrope, "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  text-rendering: geometricPrecision;
}

.toast-region {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  position: relative;
  pointer-events: auto;
  display: grid;
  gap: 4px;
  padding: 16px 44px 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.toast strong {
  font-size: 1rem;
}

.toast span {
  color: var(--muted);
  font-size: 0.9rem;
}

.toast.info {
  border-left-color: var(--blue);
}

.toast.success {
  border-left-color: var(--green);
}

.toast.warning {
  border-left-color: var(--amber);
}

.toast.danger {
  border-left-color: var(--coral);
}

.toast-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 900;
  line-height: 1;
}

.toast-close:hover,
.toast-close:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
}

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

button,
.file-button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  overflow: hidden;
}

.app-loading .app-shell,
.account-switching .app-shell {
  visibility: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid var(--sidebar-line);
  overflow: hidden;
  overscroll-behavior: contain;
}

.brand,
.signal,
.job-row-top,
.job-row-bottom,
.detail-actions,
.message-line,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
}

.brand {
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--sidebar-icon-bg);
  border: 1px solid var(--sidebar-icon-border);
  overflow: hidden;
  padding: 3px;
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.08);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

html[data-theme="dark"] .brand-mark img {
  content: url("assets/backline-icon-dark.png");
}

.brand-wordmark {
  display: block;
  width: 132px;
  max-width: 100%;
  height: 44px;
  object-fit: contain;
  object-position: left center;
}

html[data-theme="dark"] .brand-wordmark {
  content: url("assets/backline-wordmark-dark.png");
}

.sidebar .brand-subtitle {
  display: none;
}

.brand-subtitle,
.signal,
.panel-header p,
.stat-note,
.address,
.job-summary,
.empty-state span,
.toggle-row small {
  color: var(--muted);
}

.sidebar .brand-subtitle,
.sidebar .signal {
  color: var(--sidebar-muted);
}

.nav-list,
.job-list,
.automation-list,
.message-thread,
.timeline {
  display: grid;
}

.nav-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  gap: 8px;
}

.nav-list::-webkit-scrollbar {
  display: none;
}

.nav-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 0;
  color: var(--sidebar-muted);
  background: transparent;
  border-radius: 8px;
  padding: 10px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: var(--sidebar-ink);
  background: var(--sidebar-item-hover);
  box-shadow: inset 0 0 0 1px var(--sidebar-line);
}

.nav-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--sidebar-icon-bg);
  border: 1px solid var(--sidebar-icon-border);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  color: var(--blue-dark);
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.activity-nav-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.35;
}

.nav-badge {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0 6px;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-line);
}

.sidebar .ghost-button,
.sidebar .file-button {
  background: var(--sidebar-button-bg);
  color: var(--sidebar-button-ink);
  border: 1px solid var(--sidebar-button-border);
  font-weight: 800;
}

.sidebar .ghost-button:hover,
.sidebar .file-button:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
}

.signal-dot {
  width: 9px;
  height: 9px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.14);
}

.workspace {
  height: 100vh;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 28px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.topbar {
  position: relative;
  z-index: 40;
  isolation: isolate;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 0 0 22px;
  padding: 0;
}

.topbar-title {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1 1 280px;
  position: relative;
  z-index: 1;
}

.topbar-title h1 {
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar-heading-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-help-button,
.contextual-guide-dismiss {
  width: 28px;
  height: 28px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--blue-dark);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
}

.topbar-help-button:hover,
.topbar-help-button:focus-visible,
.contextual-guide-dismiss:hover,
.contextual-guide-dismiss:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  outline: none;
}

.topbar-title > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2.15rem;
  line-height: 1.08;
  font-weight: 800;
}

h2 {
  font-size: 1.08rem;
}

.search-input,
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
}

.search-input {
  min-height: 40px;
  width: min(260px, 34vw);
  padding: 0 12px;
}

.customer-search {
  position: relative;
  z-index: 50;
}

.customer-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  width: min(360px, 82vw);
  padding: 8px;
  border: 1px solid var(--sidebar-button-border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(16, 42, 67, 0.18);
  max-height: min(360px, 62vh);
  overflow-y: auto;
}

.customer-search-result {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.customer-search-result:hover,
.customer-search-result:focus-visible {
  background: var(--soft-blue);
  border-color: var(--blue);
  outline: none;
}

.customer-search-result span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.customer-search-result strong,
.customer-search-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-search-result small,
.customer-search-result em,
.customer-search-empty span {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.customer-search-result em {
  flex: 0 0 auto;
  font-weight: 700;
}

.customer-search-empty {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.action-button,
.file-button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.primary-button {
  background: var(--blue);
  color: #fff;
  padding: 0 16px;
  font-weight: 800;
}

.danger-button {
  background: var(--coral);
  color: #fff;
}

.secondary-button {
  background: var(--blue-soft);
  color: var(--blue-dark);
  padding: 0 14px;
  font-weight: 800;
}

.settings-menu {
  position: relative;
  z-index: 40;
}

.settings-menu:has(.settings-popover:not([hidden])) {
  z-index: 120;
}

.settings-button[aria-expanded="true"] {
  outline: 2px solid color-mix(in srgb, var(--blue) 34%, transparent);
}

.settings-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 140;
  width: min(300px, calc(100vw - 36px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.settings-popover[hidden] {
  display: none;
}

.settings-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--surface-muted);
  border-radius: 8px;
}

.settings-section label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.settings-section .settings-toggle {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  cursor: pointer;
}

.settings-toggle > span {
  min-width: 0;
}

.settings-toggle strong,
.settings-toggle small {
  display: block;
}

.settings-toggle strong {
  font-size: 0.84rem;
}

.settings-toggle small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.35;
}

.settings-toggle input {
  width: 42px;
  height: 24px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  cursor: pointer;
  position: relative;
  transition: background 160ms ease, border-color 160ms ease;
}

.settings-toggle input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.settings-toggle input:checked {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.settings-toggle input:checked::after {
  transform: translateX(18px);
  background: var(--blue);
}

.settings-toggle input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.settings-section select {
  min-height: 38px;
  padding: 0 10px;
  font-weight: 700;
}

.settings-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.utility-section {
  gap: 6px;
}

.print-select {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.print-select select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 10px;
  font-weight: 800;
  text-transform: none;
}

.utility-button {
  width: 100%;
  box-sizing: border-box;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.utility-button:hover {
  background: var(--hover);
}

.settings-section label.utility-button {
  display: grid;
  gap: 0;
  color: var(--ink);
  font-size: 0.86rem;
  text-transform: none;
  cursor: pointer;
}

.settings-note {
  padding: 0 4px 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.billing-settings-section {
  gap: 10px;
}

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

.billing-summary > div {
  min-width: 0;
}

.billing-summary strong,
.billing-summary small {
  display: block;
}

.billing-summary strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.billing-summary small,
.billing-plan-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.4;
}

.billing-status-badge {
  border-radius: 999px;
  background: var(--field);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.billing-status-badge.is-active,
.billing-status-badge.is-trialing {
  background: color-mix(in srgb, var(--green) 16%, var(--surface));
  color: var(--green);
}

.billing-status-badge.is-past-due,
.billing-status-badge.is-unpaid,
.billing-status-badge.is-incomplete {
  background: color-mix(in srgb, var(--orange) 18%, var(--surface));
  color: var(--orange);
}

.billing-plan-card {
  width: min(560px, calc(100vw - 28px));
}

.billing-plan-options {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 16px;
  border: 0;
}

.billing-plan-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  cursor: pointer;
}

.billing-plan-option:has(input:checked) {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue-soft) 55%, var(--surface));
  box-shadow: inset 3px 0 0 var(--blue);
}

.billing-plan-option:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.56;
}

.billing-plan-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.billing-plan-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.billing-plan-copy strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.billing-plan-copy small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.3;
}

.billing-plan-price {
  color: var(--ink);
  font-size: 1.05rem;
  white-space: nowrap;
}

.billing-plan-price span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.billing-plan-note {
  margin: 0;
  padding: 0 16px 16px;
}

.team-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.team-layout.readonly {
  grid-template-columns: minmax(0, 1fr);
}

.team-list,
.team-section,
.team-actions,
.role-card-actions,
.role-guide,
.team-invite-form,
.custom-role-form,
.custom-role-actions,
.permission-grid {
  display: grid;
  gap: 10px;
}

.team-list {
  gap: 18px;
}

.team-access-summary {
  margin-bottom: 14px;
}

.team-section {
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.team-section h3 {
  margin: 0;
  font-size: 0.92rem;
  padding: 0 2px 2px;
}

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

.team-row.readonly {
  grid-template-columns: minmax(0, 1fr) auto;
}

.team-role-badge {
  justify-self: end;
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.team-actions {
  grid-auto-flow: column;
  grid-auto-columns: max-content;
}

.invite-send-button {
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  color: var(--blue-dark);
}

.role-card-actions,
.custom-role-actions {
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: end;
  align-items: center;
}

.team-row strong,
.role-card strong,
.custom-role-form h3 {
  display: block;
}

.team-row small,
.role-card span,
.custom-role-form p {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.team-invite-form input,
.team-invite-form .backline-picker-button,
.custom-role-form input,
.custom-role-form .backline-picker-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 10px;
  font-weight: 750;
}

.member-role-picker {
  min-width: 0;
}

.disabled-picker {
  opacity: 0.78;
}

.disabled-picker .backline-picker-button {
  cursor: not-allowed;
  pointer-events: none;
}

.team-invite-form label {
  display: grid;
  gap: 8px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.custom-role-form {
  margin-top: 6px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.custom-role-form h3,
.custom-role-form p {
  margin: 0;
}

.custom-role-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.role-editor-launcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.role-editor-launcher h3,
.role-editor-launcher p {
  margin: 0;
}

.role-editor-launcher h3 {
  color: var(--ink);
  font-size: 0.95rem;
}

.role-editor-launcher p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.role-editor-modal {
  width: min(820px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: hidden;
}

.role-editor-card.custom-role-form {
  width: 100%;
  max-height: calc(100vh - 28px);
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.role-editor-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.role-editor-body .wide,
.role-editor-body .permission-grid {
  grid-column: 1 / -1;
}

.role-editor-section-heading {
  display: grid;
  gap: 3px;
  padding-top: 2px;
}

.role-editor-section-heading h4,
.role-editor-section-heading p {
  margin: 0;
}

.role-editor-section-heading h4 {
  color: var(--ink);
  font-size: 0.9rem;
}

.role-editor-section-heading p {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.role-editor-preview {
  display: grid;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue-soft) 24%, var(--surface));
  padding: 12px;
}

.role-editor-preview[hidden] {
  display: none;
}

.role-editor-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.role-editor-preview-header div {
  display: grid;
  gap: 2px;
}

.role-editor-preview-header span,
.role-editor-preview-grid h4 {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.role-editor-preview-header strong {
  color: var(--ink);
  font-size: 1rem;
}

.role-editor-preview-header b {
  max-width: 48%;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: right;
}

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

.role-editor-preview-grid section {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.role-editor-preview-grid .wide {
  grid-column: 1 / -1;
}

.role-editor-preview-grid div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-editor-preview-grid span {
  display: inline-grid;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.role-editor-preview-grid em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.role-editor-preview-grid ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.role-editor-card .custom-role-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
}

.role-editor-card .modal-header {
  flex: 0 0 auto;
}

.role-access-card,
.role-preview-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.role-access-card.powerful {
  border-color: color-mix(in srgb, var(--amber) 52%, var(--line));
  background: color-mix(in srgb, var(--warning-soft) 40%, var(--surface));
}

.role-access-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.role-access-header span,
.role-preview-panel label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.role-access-header strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 1rem;
}

.role-access-header small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.role-power-badge {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--amber) 58%, var(--line));
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.role-preview-panel {
  margin-top: 12px;
  background: var(--surface);
}

.role-preview-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.role-preview-toolbar h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.role-preview-toolbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.role-preview-toolbar label {
  display: grid;
  gap: 7px;
  min-width: 190px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.role-preview-panel select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 10px;
  font-weight: 800;
  text-transform: none;
}

.role-preview {
  display: grid;
  gap: 10px;
}

.role-operational-preview {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-muted) 74%, var(--surface));
  padding: 12px;
}

.role-operational-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.role-operational-header span,
.role-operational-preview h4,
.role-preview-score small,
.role-preview-metrics span,
.role-preview-metrics small,
.role-workflow-card span,
.role-workflow-card small,
.role-restriction-list span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.role-operational-header strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 1.12rem;
}

.role-operational-header small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.role-preview-score {
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px 10px;
  text-align: right;
}

.role-preview-score b {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.role-preview-score small {
  display: block;
  margin-top: 3px;
  text-transform: none;
}

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

.role-preview-metrics div {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.role-preview-metrics strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--ink);
  font-size: 1.05rem;
}

.role-preview-metrics .warning {
  border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
  background: var(--warning-soft);
}

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

.role-preview-columns section {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.role-operational-preview h4 {
  margin: 0;
}

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

.role-workflow-card {
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px;
}

.role-workflow-card strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--ink);
  font-size: 0.86rem;
}

.role-workflow-card.ready {
  border-color: color-mix(in srgb, var(--green) 44%, var(--line));
  background: var(--success-soft);
}

.role-workflow-card.ready span {
  color: var(--green);
}

.role-workflow-card.partial {
  border-color: color-mix(in srgb, var(--amber) 42%, var(--line));
  background: var(--warning-soft);
}

.role-workflow-card.partial span {
  color: var(--amber);
}

.role-restriction-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.role-restriction-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
}

.role-restriction-list strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.25;
}

.role-restriction-list .allowed {
  border-color: color-mix(in srgb, var(--amber) 42%, var(--line));
}

.role-restriction-list .allowed span {
  color: var(--amber);
}

.role-restriction-list .blocked span {
  color: var(--muted);
}

.role-test-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-test-chips span,
.role-test-chips em {
  display: inline-grid;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 800;
}

.role-test-chips em {
  background: var(--surface);
  color: var(--muted);
}

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

.permission-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.permission-summary-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.permission-summary-row strong {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.permission-summary-row div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.permission-summary-row span,
.permission-summary-row em {
  display: inline-grid;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
}

.permission-summary-row em {
  background: var(--surface-muted);
  color: var(--muted);
}

.permission-summary-row.included span {
  background: color-mix(in srgb, var(--green) 14%, var(--surface));
  color: var(--green);
}

.permission-summary.compact {
  gap: 7px;
  padding: 10px;
}

.permission-summary.compact .permission-summary-row {
  grid-template-columns: 78px minmax(0, 1fr);
}

.permission-summary-alert {
  border: 1px solid color-mix(in srgb, var(--amber) 48%, var(--line));
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--amber);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.4;
  padding: 9px 10px;
}

.permission-group {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.permission-group-header {
  display: grid;
  gap: 2px;
}

.permission-group-header strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.permission-group-header span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

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

.permission-toggle {
  min-height: 34px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.permission-toggle input {
  min-height: auto;
}

.permission-toggle span {
  min-width: 0;
  font-size: 0.76rem;
  line-height: 1.25;
}

.permission-toggle.auto-included {
  border-style: dashed;
  background: color-mix(in srgb, var(--blue-soft) 42%, var(--surface));
}

.team-invite-form button {
  margin: 0 16px;
}

.team-invite-form + .settings-note {
  margin: 0 16px;
}

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

.database-section {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.database-section h3 {
  margin: 0 0 2px;
  font-size: 0.96rem;
  padding-inline: 4px;
}

.database-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) max-content max-content minmax(130px, 0.7fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 16px 18px;
  text-align: left;
  min-height: 74px;
}

.database-row.deleted {
  background: var(--surface-muted);
}

.database-row strong,
.database-row small {
  display: block;
}

.database-row strong {
  margin-bottom: 4px;
}

.database-row small {
  color: var(--muted);
  font-size: 0.82rem;
}

.database-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.activity-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px 16px 0;
}

.activity-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 190px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.permission-audit-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 16px 0;
  border: 1px solid color-mix(in srgb, var(--blue) 32%, var(--line));
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue-soft) 38%, var(--surface));
  padding: 12px 14px;
}

.permission-audit-panel[hidden] {
  display: none;
}

.permission-audit-panel div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.permission-audit-panel span {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.permission-audit-panel strong {
  color: var(--ink);
  font-size: 1rem;
}

.permission-audit-panel small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

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

.activity-day-group {
  display: grid;
  gap: 10px;
}

.activity-day-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, var(--blue-soft));
  padding: 10px 12px;
}

.activity-day-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
}

.activity-day-header span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  cursor: pointer;
}

.activity-row:hover,
.activity-row:focus-visible {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--surface) 88%, var(--blue-soft));
  outline: none;
}

.activity-row strong,
.activity-row small,
.activity-row time,
.activity-meta b,
.activity-meta span {
  display: block;
}

.activity-row strong {
  margin-top: 8px;
}

.activity-row small,
.activity-row time,
.activity-meta span {
  color: var(--muted);
  font-size: 0.82rem;
}

.activity-changes {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.activity-changes span {
  display: block;
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 7px 8px;
}

.activity-changes b {
  color: var(--ink);
}

.activity-meta {
  display: grid;
  gap: 5px;
  justify-items: end;
  text-align: right;
}

.activity-detail-drawer {
  width: min(560px, calc(100vw - 18px));
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0 0 0 auto;
}

#activityDetailModal.activity-detail-drawer {
  width: min(760px, calc(100vw - 28px));
  height: auto;
  max-height: calc(100vh - 28px);
  margin: auto;
}

#inventoryUsageModal.activity-detail-drawer {
  width: min(1120px, calc(100vw - 28px));
  height: auto;
  max-height: calc(100vh - 28px);
  margin: auto;
}

#inventoryUsageModal.fallback-open {
  position: fixed;
  inset: 14px;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 0;
}

.activity-detail-card {
  width: 100%;
  min-height: 100vh;
  border-radius: 0;
  display: grid;
  grid-template-rows: 1fr auto;
}

#activityDetailModal .activity-detail-card {
  min-height: 0;
  max-height: calc(100vh - 28px);
  border-radius: 8px;
}

.activity-detail-content {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 18px;
  overflow-y: auto;
}

.activity-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.activity-detail-header-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}

.activity-detail-header h2 {
  margin: 2px 0 4px;
  font-size: 1.25rem;
}

.activity-detail-header p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
}

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

.activity-detail-stat {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.activity-detail-stat span,
.activity-detail-change span,
.activity-detail-change small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.activity-detail-stat strong,
.activity-detail-change strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.activity-detail-section {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.activity-detail-changes {
  display: grid;
  gap: 10px;
}

.activity-detail-change {
  display: grid;
  grid-template-columns: minmax(100px, 0.6fr) repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.activity-detail-change div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.activity-detail-empty {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.activity-detail-empty strong {
  color: var(--ink);
}

.delete-modal-card {
  width: min(520px, calc(100vw - 28px));
}

.delete-warning {
  margin: 16px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--coral) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--coral) 9%, var(--surface));
  display: grid;
  gap: 4px;
}

.delete-warning strong {
  color: var(--coral);
}

.delete-warning span {
  color: var(--muted);
}

.ghost-button,
.file-button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.utility-button.file-button {
  background: var(--field);
  color: var(--ink);
}

.icon-button {
  width: 40px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 900;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.stat,
.panel,
.metric-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat,
.metric-block {
  padding: 16px;
  display: grid;
  gap: 4px;
}

button.metric-block {
  text-align: left;
  cursor: pointer;
}

.jobs-filter-card.active {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue), var(--shadow);
  background: var(--blue-soft);
}

.stat-label,
.metric-block span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.stat strong,
.metric-block strong {
  font-size: 1.65rem;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(390px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.work-grid > * {
  min-width: 0;
}

#view-inbox.active .work-grid {
  height: calc(100vh - 132px);
  min-height: 560px;
  align-items: stretch;
}

#view-inbox.active .inbox-panel,
#view-inbox.active .detail-panel {
  min-height: 0;
  max-height: 100%;
}

#view-inbox.active .inbox-panel {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 24px;
}

#view-inbox.active .job-list {
  min-height: 0;
  overflow-y: auto;
}

#view-inbox.active .detail-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.work-grid.inbox-collapsed {
  grid-template-columns: 42px minmax(520px, 1fr);
}

.work-grid.inbox-collapsed .inbox-panel {
  align-self: start;
  width: 42px;
}

.collapse-inbox-button {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

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

.inbox-panel .panel-header > div:first-child {
  grid-column: 1;
  grid-row: 1;
}

.inbox-panel .segmented {
  grid-column: 1 / -1;
  grid-row: 2;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}

.inbox-panel .collapse-inbox-button {
  grid-column: 2;
  grid-row: 1;
  min-width: 140px;
  justify-self: end;
}

.work-grid.inbox-collapsed .inbox-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-height: 128px;
  height: 128px;
  border-bottom: 0;
}

.work-grid.inbox-collapsed .inbox-panel .panel-header > div,
.work-grid.inbox-collapsed .inbox-panel .segmented,
.work-grid.inbox-collapsed .job-list {
  display: none;
}

.work-grid.inbox-collapsed .collapse-inbox-button {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  height: 100%;
  justify-self: center;
  align-self: center;
  min-height: 0;
  padding: 8px 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 12px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0;
}

.work-grid.inbox-collapsed .collapse-inbox-button:hover {
  background: var(--hover);
  color: var(--ink);
}

.attention-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  margin-bottom: 16px;
}

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

.beta-readiness-panel {
  margin-bottom: 16px;
}

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

.contextual-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: -8px 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface-muted);
}

.contextual-guide-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.contextual-guide-copy > span,
.form-guide-header > span {
  color: var(--blue-dark);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.contextual-guide-copy strong {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.3;
}

.contextual-guide-copy p,
.form-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.contextual-guide-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.contextual-guide-actions .text-button {
  white-space: nowrap;
}

.form-guide {
  display: grid;
  gap: 4px;
  margin: 16px 16px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: var(--surface-muted);
}

.form-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-guide .contextual-guide-dismiss {
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
}

.onboarding-panel-header {
  align-items: center;
}

.onboarding-panel-header > div {
  flex: 1 1 auto;
  min-width: 0;
}

.onboarding-tour-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  padding-inline: 12px;
  white-space: nowrap;
}

.onboarding-progress {
  height: 6px;
  margin: 16px 16px 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.onboarding-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.onboarding-current {
  padding: 16px;
}

.onboarding-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.onboarding-step-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.onboarding-step-copy > span {
  color: var(--blue-dark);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.onboarding-step-copy strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.onboarding-step-copy p {
  max-width: 68ch;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.onboarding-step.complete .onboarding-step-copy > span {
  color: var(--green);
}

.onboarding-panel-footer {
  display: flex;
  justify-content: flex-start;
  padding: 0 16px 16px;
}

.text-button {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--blue);
  outline: none;
}

.onboarding-guide-card {
  width: min(620px, calc(100vw - 28px));
}

.onboarding-tour-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.onboarding-tour-list li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.onboarding-tour-list li > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 950;
}

.onboarding-tour-list li > div {
  min-width: 0;
}

.onboarding-tour-list strong {
  display: block;
  color: var(--ink);
}

.onboarding-tour-list p {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.beta-readiness-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 16px;
}

.beta-readiness-item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.beta-readiness-item > span {
  min-width: 48px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.68rem;
  font-weight: 950;
  padding: 4px 7px;
  text-align: center;
  text-transform: uppercase;
}

.beta-readiness-item.ready > span {
  background: var(--success-soft);
  color: var(--green);
}

.beta-readiness-item.check > span {
  background: var(--warning-soft);
  color: var(--amber);
}

.beta-readiness-item.setup > span {
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  color: var(--coral);
}

.beta-readiness-item strong,
.beta-readiness-item small {
  display: block;
}

.beta-readiness-item strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.beta-readiness-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

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

.panel-header > div:first-child,
.section-heading > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.panel-header > .utility-button,
.section-heading > .utility-button {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

.panel-header p {
  font-size: 0.88rem;
  margin-top: 3px;
}

.segmented {
  display: flex;
  background: var(--surface-muted);
  border-radius: 8px;
  padding: 3px;
}

.segment {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 10px;
  border-radius: 7px;
  font-weight: 800;
  font-size: 0.84rem;
}

.segment.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.job-row {
  width: 100%;
  border: 0;
  background: var(--surface);
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.job-row:hover,
.job-row.active,
.compact-row:hover,
.attention-item:hover {
  background: var(--hover);
}

.job-row-top {
  justify-content: space-between;
}

.job-row-bottom {
  flex-wrap: wrap;
  justify-content: space-between;
}

.customer-name {
  font-weight: 850;
}

.job-summary {
  font-size: 0.91rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  min-height: 24px;
  padding: 0 9px;
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

.pill.urgent,
.pill.invoiced,
.pill.profit.urgent,
.pill.profit.invoiced {
  color: #fff;
  background: var(--coral);
}

.pill.open,
.pill.profit.open {
  color: var(--amber);
  background: var(--warning-soft);
}

.pill.booked,
.pill.in_progress,
.pill.paid,
.pill.profit.paid {
  color: #fff;
  background: var(--green);
}

.pill.completed {
  color: var(--teal-dark);
  background: color-mix(in srgb, var(--teal) 16%, var(--surface));
}

.pill.estimated,
.pill.trade,
.pill.profit.estimated {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.pill.profit {
  width: max-content;
  max-width: 100%;
}

.pill.closed {
  color: var(--muted);
  background: var(--neutral-soft);
}

.detail {
  padding: 0 18px 18px;
  display: grid;
  gap: 18px;
}

.job-sticky-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  gap: 14px;
  margin: 0 -18px;
  padding: 18px 18px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 20px color-mix(in srgb, var(--shadow) 8%, transparent);
}

.detail-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.detail-title h2 {
  font-size: 1.45rem;
}

.detail-actions {
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
}

.detail-actions .action-button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 0.83rem;
  line-height: 1;
  white-space: nowrap;
}

.desktop-job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  position: relative;
}

.mobile-job-actions {
  display: none;
}

.job-action-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
}

.job-action-menu-trigger::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.job-action-menu-trigger[aria-expanded="true"]::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.job-action-menu-trigger[aria-expanded="true"] {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.job-action-menu-panel {
  flex: 1 0 100%;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  align-items: start;
  gap: 0;
  margin-top: 6px;
  padding: 5px;
  background: color-mix(in srgb, var(--surface-muted) 72%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 20px color-mix(in srgb, var(--shadow) 5%, transparent);
}

.job-action-menu-group {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px 12px;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
}

.job-action-menu-group:first-child {
  border-left: 0;
}

.job-action-menu-group span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--blue-dark);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.job-action-menu-group div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
}

.job-action-menu-group .action-button {
  min-height: 34px;
  padding: 6px 9px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  width: 100%;
  justify-content: center;
  text-align: center;
}

.job-action-menu-group .action-button:hover,
.job-action-menu-group .action-button:focus-visible {
  border-color: var(--line);
  background: var(--field);
  color: var(--blue-dark);
}

.job-action-menu-group .action-button.accent {
  background: var(--teal);
  color: #fff;
}

.job-action-menu-group .action-button.danger {
  color: var(--coral);
}

.job-action-menu-group .action-button.danger:hover,
.job-action-menu-group .action-button.danger:focus-visible {
  border-color: color-mix(in srgb, var(--coral) 35%, var(--line));
  background: var(--danger-soft);
  color: var(--coral);
}

.job-action-notice {
  align-items: center;
  background: var(--blue-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.job-action-notice a {
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

.portal-access-panel,
.customer-updates-panel {
  overflow: hidden;
}

.portal-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.portal-access-card {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.portal-access-card.needs-attention {
  border-color: color-mix(in srgb, var(--coral) 38%, var(--line));
  background: color-mix(in srgb, var(--coral) 8%, var(--surface));
}

.portal-access-card span,
.customer-update-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-access-card strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.portal-access-card small,
.customer-update-row small {
  color: var(--muted);
  font-size: 0.82rem;
}

.portal-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

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

.customer-update-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface-muted);
}

.customer-update-row.inbound {
  border-left-color: var(--green);
}

.customer-update-row strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.job-summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-muted));
  box-shadow: none;
}

.job-summary-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.job-summary-card span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.job-summary-card strong,
.summary-value-button {
  min-width: 0;
  max-width: 100%;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.summary-value-button {
  min-height: 0;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.summary-value-button:hover,
.summary-value-button:focus-visible {
  color: var(--blue-dark);
  text-decoration: underline;
  outline: none;
}

.job-summary-card small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.2;
}

.job-summary-card.due {
  border-color: var(--amber);
  background: var(--note-soft);
}

.job-summary-card.paid {
  border-color: var(--green);
  background: var(--success-soft);
}

.job-summary-action {
  min-width: 0;
  background: color-mix(in srgb, var(--blue-soft) 48%, var(--surface));
}

.job-summary-button {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  justify-content: center;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.15;
}

.job-summary-action small {
  overflow-wrap: anywhere;
}

.job-summary-none {
  color: var(--muted);
  font-weight: 800;
}

.dispatch-brief {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 14px;
}

.dispatch-brief.ready {
  border-color: color-mix(in srgb, var(--green) 32%, var(--line));
}

.dispatch-brief.needs-parts,
.dispatch-brief.needs-schedule {
  border-color: color-mix(in srgb, var(--coral) 38%, var(--line));
  background: color-mix(in srgb, var(--coral) 5%, var(--surface-muted));
}

.dispatch-brief.needs-approval {
  border-color: color-mix(in srgb, var(--amber) 42%, var(--line));
  background: color-mix(in srgb, var(--amber) 7%, var(--surface-muted));
}

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

.dispatch-brief-header h3 {
  margin: 2px 0 0;
  font-size: 1.05rem;
}

.dispatch-brief-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.dispatch-brief-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 8px;
}

.dispatch-brief-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.dispatch-brief-card span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dispatch-brief-card strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dispatch-brief-card small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dispatch-brief-card.ready {
  border-color: color-mix(in srgb, var(--green) 26%, var(--line));
}

.dispatch-brief-card.needs-parts,
.dispatch-brief-card.needs-schedule {
  border-color: color-mix(in srgb, var(--coral) 28%, var(--line));
}

.dispatch-brief-card.needs-approval,
.dispatch-brief-card.needs-pick {
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
}

.closeout-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 14px;
}

.closeout-panel.ready {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background: color-mix(in srgb, var(--green) 5%, var(--surface-muted));
}

.closeout-panel.blocked {
  border-color: color-mix(in srgb, var(--coral) 40%, var(--line));
  background: color-mix(in srgb, var(--coral) 5%, var(--surface-muted));
}

.closeout-panel.warning {
  border-color: color-mix(in srgb, var(--amber) 38%, var(--line));
  background: color-mix(in srgb, var(--amber) 6%, var(--surface-muted));
}

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

.closeout-header h3 {
  margin: 2px 0 0;
  font-size: 1.05rem;
}

.closeout-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.closeout-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  padding: 10px 12px;
}

.closeout-item.done {
  border-left-color: var(--green);
}

.closeout-item.warning {
  border-left-color: var(--amber);
}

.closeout-item.blocked {
  border-left-color: var(--coral);
}

.closeout-state {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.closeout-item strong,
.closeout-item small {
  display: block;
}

.closeout-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

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

.action-button {
  border: 1px solid var(--line);
  background: var(--field);
  padding: 0 12px;
  font-weight: 800;
}

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

.action-button.danger {
  color: var(--coral);
}

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

.tech-meta-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.meta {
  background: var(--surface-muted);
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.meta span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.meta strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta strong.truncate-value {
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.invoice-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.invoice-summary-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.invoice-summary-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.invoice-summary-card strong {
  color: var(--ink);
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-summary-card small,
.invoice-note {
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.invoice-summary-card.due {
  border-color: var(--amber);
  background: var(--note-soft);
}

.invoice-summary-card.paid {
  border-color: var(--green);
  background: var(--success-soft);
}

.invoice-summary-card.ready {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

.costing-panel {
  background: color-mix(in srgb, var(--surface) 88%, var(--success-soft));
}

.costing-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.costing-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.costing-card span,
.costing-breakdown span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.costing-card strong,
.costing-breakdown strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.costing-card small,
.costing-breakdown small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.costing-card.healthy {
  border-color: color-mix(in srgb, var(--green) 48%, var(--line));
  background: var(--success-soft);
}

.costing-card.warning {
  border-color: var(--amber);
  background: var(--note-soft);
}

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

.costing-breakdown div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.costing-warning {
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  background: var(--note-soft);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.4;
  padding: 10px 12px;
}

.billing-review-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.billing-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.billing-review-header span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.billing-review-header strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.billing-review-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.billing-review-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--field);
  padding: 10px 12px;
}

.billing-review-item.warning,
.billing-review-item.neutral {
  border-left-color: var(--amber);
}

.billing-review-item.danger {
  border-left-color: var(--coral);
}

.billing-review-item.success {
  border-left-color: var(--green);
}

.billing-review-item strong,
.billing-review-item small {
  display: block;
}

.billing-review-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.billing-review-item em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.payment-review-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

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

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

.receivables-summary-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 11px 12px;
}

.receivables-summary-card.current {
  border-left: 4px solid var(--green);
  background: color-mix(in srgb, var(--success-soft) 48%, var(--surface));
}

.receivables-summary-card.oneToSeven {
  border-left: 4px solid var(--blue);
  background: color-mix(in srgb, var(--blue-soft) 52%, var(--surface));
}

.receivables-summary-card.eightToThirty {
  border-left: 4px solid var(--amber);
  background: color-mix(in srgb, var(--warning-soft) 54%, var(--surface));
}

.receivables-summary-card.overThirty {
  border-left: 4px solid var(--coral);
  background: color-mix(in srgb, var(--note-soft) 48%, var(--surface));
}

.receivables-summary-card span,
.receivable-main span,
.receivable-amounts span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.receivables-summary-card strong {
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.2;
}

.receivables-summary-card small {
  color: var(--muted);
}

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

.receivable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1.4fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--field);
  padding: 12px;
}

.receivable-row.current {
  border-left-color: var(--green);
}

.receivable-row.oneToSeven {
  border-left-color: var(--blue);
}

.receivable-row.eightToThirty {
  border-left-color: var(--amber);
}

.receivable-row.overThirty {
  border-left-color: var(--coral);
}

.receivable-main,
.receivable-amounts div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.receivable-main strong,
.receivable-amounts strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receivable-main small,
.receivable-amounts small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

.receivable-amounts div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px 10px;
}

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

.payment-review-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: var(--field);
  padding: 12px;
}

.payment-review-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.payment-review-main span,
.payment-review-facts span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payment-review-main strong {
  color: var(--ink);
  font-size: 1rem;
}

.payment-review-main small,
.payment-review-main p {
  color: var(--muted);
  line-height: 1.35;
}

.payment-review-main p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

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

.payment-review-facts div {
  min-width: 0;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px 10px;
}

.payment-review-facts strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.profit-watch {
  display: grid;
  margin-bottom: 14px;
}

.profit-watch-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, var(--blue-soft));
}

.profit-watch-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.profit-watch-summary div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profit-watch-summary span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.profit-watch-summary strong {
  color: var(--ink);
  font-size: 1rem;
}

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

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

.profit-watch-row.urgent,
.profit-watch-row.invoiced {
  border-left-color: var(--coral);
}

.profit-watch-row.open {
  border-left-color: var(--amber);
}

.profit-watch-row.estimated {
  border-left-color: var(--blue);
}

.profit-watch-row.paid {
  border-left-color: var(--green);
}

.profit-watch-row strong,
.profit-watch-row small {
  display: block;
}

.profit-watch-row strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 0.93rem;
}

.profit-watch-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.profit-watch-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.invoice-note {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-muted);
  line-height: 1.45;
}

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

.invoice-line-items {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.invoice-line-header,
.invoice-line-row,
.pricebook-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 70px 90px 90px 84px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.payment-ledger-list .invoice-line-header,
.payment-ledger-list .invoice-line-row {
  grid-template-columns: minmax(150px, 1.35fr) minmax(78px, 0.65fr) minmax(92px, 0.75fr) minmax(90px, 0.75fr) minmax(120px, 0.95fr) minmax(112px, 0.8fr);
}

.payment-ledger-list .invoice-line-row > span {
  min-width: 0;
}

.payment-ledger-list .invoice-line-row > span:nth-child(5) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-line-header {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  background: var(--surface-muted);
}

.invoice-remove-button {
  min-width: 72px;
  min-height: 40px;
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--coral);
  font-size: 0.84rem;
  font-weight: 850;
  padding: 0 10px;
}

.invoice-remove-button:hover {
  background: color-mix(in srgb, var(--coral) 9%, var(--field));
}

.receipt-action-button {
  min-width: 104px;
  min-height: 36px;
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 850;
  padding: 0 10px;
}

.receipt-action-button:hover {
  background: color-mix(in srgb, var(--primary) 9%, var(--field));
}

.billing-timeline {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.billing-timeline-header,
.billing-timeline-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) minmax(150px, auto);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.billing-timeline-header {
  grid-template-columns: minmax(0, 1fr) auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  background: var(--surface-muted);
}

.billing-timeline-header small {
  text-transform: none;
  font-size: 0.78rem;
  font-weight: 750;
}

.billing-timeline-row:last-child {
  border-bottom: 0;
}

.billing-timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
}

.billing-timeline-row.payment .billing-timeline-dot,
.billing-timeline-row.receipt .billing-timeline-dot,
.billing-timeline-row.approved .billing-timeline-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 14%, transparent);
}

.billing-timeline-row.declined .billing-timeline-dot {
  background: var(--coral);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 12%, transparent);
}

.billing-timeline-row strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.billing-timeline-row small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-timeline-row time {
  justify-self: end;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.template-pricebook-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue-soft) 30%, var(--surface));
  padding: 12px;
}

.template-pricebook-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.template-pricebook-header span,
.template-pricebook-header small {
  display: block;
}

.template-pricebook-header span {
  color: var(--ink);
  font-weight: 900;
}

.template-pricebook-header small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

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

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

.template-pricebook-row strong,
.template-pricebook-row small {
  display: block;
  min-width: 0;
}

.template-pricebook-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.invoice-locked-line {
  justify-self: end;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.invoice-line-row:last-child,
.pricebook-row:last-child {
  border-bottom: 0;
}

.invoice-line-row strong,
.pricebook-row strong {
  display: block;
}

.invoice-line-row small,
.pricebook-row small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.invoice-line-form,
.pricebook-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
}

.invoice-line-form select,
.invoice-line-form input,
.pricebook-form input {
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-weight: 650;
}

.invoice-line-status {
  grid-column: 1 / -1;
  min-height: 36px;
  display: grid;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--coral) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--coral) 9%, var(--surface));
  color: var(--coral);
  font-size: 0.84rem;
  font-weight: 800;
  padding: 8px 10px;
}

.invoice-lock-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  padding: 10px 12px;
}

.checkbox-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

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

.pricebook-row {
  grid-template-columns: minmax(0, 1.8fr) 90px 90px 100px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pricebook-row.inactive {
  opacity: 0.62;
}

.pricebook-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.inventory-row-actions {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.pricebook-edit-card {
  max-width: 780px;
}

.inventory-usage-card {
  width: 100%;
  max-height: calc(100vh - 28px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.inventory-usage-content {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 18px;
  overflow-y: auto;
}

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

.inventory-usage-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(135px, 0.8fr) minmax(140px, 0.8fr) minmax(120px, 0.7fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.inventory-usage-row.billed {
  border-left-color: var(--green);
}

.inventory-usage-row.unbilled {
  border-left-color: var(--amber);
}

.inventory-usage-row strong,
.inventory-usage-row small {
  display: block;
}

.inventory-usage-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

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

.stock-movement-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(110px, 0.7fr) minmax(150px, 0.85fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.stock-movement-row.received {
  border-left-color: var(--green);
}

.stock-movement-row.used {
  border-left-color: var(--coral);
}

.stock-movement-row.ordered {
  border-left-color: var(--blue);
}

.stock-movement-row.adjustment {
  border-left-color: var(--amber);
}

.stock-movement-row strong,
.stock-movement-row small {
  display: block;
}

.stock-movement-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.inventory-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.inventory-summary div {
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  padding: 12px;
}

.inventory-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.inventory-summary strong {
  color: var(--ink);
  font-size: 1.08rem;
}

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

.inventory-orders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.inventory-orders-header strong,
.inventory-orders-header small {
  display: block;
}

.inventory-orders-header small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.inventory-order-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.inventory-order-card-row,
.inventory-order-detail-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.25fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.inventory-order-card-row.open,
.inventory-order-detail-row.pending {
  border-left-color: var(--blue);
}

.inventory-order-card-row.partial {
  border-left-color: var(--amber);
}

.inventory-order-card-row.late {
  border-left-color: var(--coral);
}

.inventory-order-card-row.received,
.inventory-order-detail-row.received {
  border-left-color: var(--green);
}

.inventory-order-card-row strong,
.inventory-order-card-row small,
.inventory-order-detail-row strong,
.inventory-order-detail-row small {
  display: block;
}

.inventory-order-card-row small,
.inventory-order-detail-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.inventory-order-detail-list {
  display: grid;
  gap: 8px;
}

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

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

.inventory-supplier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inventory-supplier-header h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.inventory-supplier-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.inventory-supplier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.inventory-supplier-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--field);
  padding: 12px;
}

.inventory-supplier-card.needs-order {
  border-left-color: var(--amber);
}

.inventory-supplier-card.pending {
  border-left-color: var(--blue);
}

.inventory-supplier-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.inventory-supplier-card strong,
.inventory-supplier-card small {
  display: block;
}

.inventory-supplier-card small,
.inventory-supplier-card p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.inventory-supplier-card p {
  margin: 0;
}

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

.supplier-contact-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 8px;
}

.supplier-contact-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.supplier-contact-grid strong {
  margin-top: 2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.supplier-notes {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue-soft) 32%, var(--surface));
  padding: 8px;
}

.supplier-order-history {
  display: grid;
  gap: 7px;
}

.supplier-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, auto) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
}

.supplier-order-row.received {
  border-left-color: var(--green);
}

.supplier-order-row strong,
.supplier-order-row small {
  display: block;
}

.supplier-order-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

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

.inventory-supplier-stats div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 8px;
}

.inventory-supplier-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.inventory-supplier-stats strong {
  margin-top: 2px;
  display: block;
  font-size: 0.96rem;
}

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

.inventory-reorder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--note-soft) 58%, var(--surface));
  padding: 12px;
}

.inventory-reorder-header.orders {
  background: color-mix(in srgb, var(--blue-soft) 58%, var(--surface));
}

.inventory-reorder-header h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.inventory-reorder-header p,
.inventory-reorder-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.inventory-reorder-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(190px, 1fr) minmax(110px, 0.7fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.inventory-reorder-row.out {
  border-left-color: var(--coral);
}

.inventory-reorder-row.ordered {
  border-left-color: var(--blue);
}

.inventory-reorder-row strong,
.inventory-reorder-row small {
  display: block;
}

.inventory-reorder-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.inventory-order-card {
  max-width: 720px;
}

.inventory-order-lines {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.inventory-order-line-header,
.inventory-order-line {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(88px, 0.35fr) minmax(110px, 0.45fr);
  gap: 8px;
  align-items: center;
}

.inventory-order-line-header {
  grid-template-columns: minmax(180px, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  padding: 9px 10px;
}

.inventory-order-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  padding: 8px;
}

.inventory-order-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.inventory-order-line strong,
.inventory-order-line small {
  display: block;
}

.inventory-order-line small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.inventory-order-line input[type="number"] {
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
}

.supplier-card {
  max-width: 760px;
}

.form-status {
  min-height: 18px;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.reorder-copy-card {
  max-width: 680px;
}

.reorder-copy-card textarea {
  width: 100%;
  min-height: 210px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  padding: 12px;
}

.inventory-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.inventory-list-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--field);
  padding: 12px;
}

.inventory-list-title strong,
.inventory-list-title small {
  display: block;
}

.inventory-list-title small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.inventory-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.9fr) minmax(84px, 0.6fr) minmax(84px, 0.6fr) minmax(110px, 0.8fr) minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 12px;
}

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

.inventory-header {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.inventory-row.warning {
  background: color-mix(in srgb, var(--note-soft) 62%, var(--surface));
}

.inventory-row strong,
.inventory-row small {
  display: block;
}

.inventory-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.inventory-row em {
  display: inline-grid;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 850;
  margin: 2px 4px 2px 0;
  padding: 0 8px;
  text-transform: uppercase;
}

.backline-picker {
  position: relative;
  min-width: 0;
  width: 100%;
}

.backline-picker-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.backline-picker-button {
  width: 100%;
  min-height: 42px;
  display: grid;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  text-align: left;
  padding: 8px 32px 8px 10px;
  overflow: hidden;
}

.backline-picker-button span {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backline-picker-button::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 21px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.backline-picker-label + input + .backline-picker-button::after {
  top: 47px;
}

.backline-picker-menu {
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 4px);
  left: 0;
  width: max-content;
  min-width: 100%;
  max-width: min(260px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.backline-picker.opens-down .backline-picker-menu {
  top: calc(100% + 4px);
  bottom: auto;
}

.backline-picker-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: left;
  padding: 8px 10px;
  white-space: nowrap;
}

.backline-picker-menu button:last-child {
  border-bottom: 0;
}

.backline-picker-menu button:hover {
  background: var(--hover);
}

.editable-meta {
  padding: 10px;
  min-width: 0;
}

.technician-picker {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.technician-picker-button {
  width: 100%;
  min-height: 42px;
  display: grid;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  text-align: left;
  padding: 7px 30px 7px 10px;
  overflow: hidden;
}

.technician-picker-button span {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.technician-picker-button::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 21px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.technician-picker-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  width: max-content;
  min-width: 100%;
  max-width: min(280px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.technician-picker-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 750;
  text-align: left;
  padding: 7px 9px;
  white-space: nowrap;
}

.technician-picker-menu button:last-child {
  border-bottom: 0;
}

.technician-picker-menu button:hover {
  background: var(--hover);
}

.message-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px auto;
  gap: 8px;
}

.message-compose input,
.message-compose select {
  min-height: 40px;
  padding: 0 10px;
}

.message-thread-panel {
  min-height: 220px;
  height: var(--message-thread-height, 340px);
  max-height: 72vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.message-thread-resize {
  min-height: 24px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  cursor: row-resize;
  touch-action: none;
}

.message-thread-resize span {
  width: 46px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

.message-thread-resize:hover span,
.message-thread-resize:focus-visible span {
  background: var(--blue);
}

.message-thread-resize:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.resizing-message-thread {
  cursor: row-resize;
  user-select: none;
}

.message-thread {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  scrollbar-gutter: stable;
}

.message-thread {
  gap: 10px;
  align-content: start;
  max-width: 100%;
  min-width: 0;
}

.attention-list,
.action-list {
  display: grid;
}

.action-list {
  gap: 14px;
  padding: 16px;
}

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

.followup-summary div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.followup-summary span,
.followup-group-header span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.followup-summary strong {
  color: var(--ink);
  font-size: 1.18rem;
}

.followup-group {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.followup-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.followup-group-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.followup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--line);
}

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

.followup-row.urgent {
  border-left-color: var(--coral);
}

.followup-row.money {
  border-left-color: var(--green);
}

.followup-row.scheduling {
  border-left-color: var(--amber);
}

.followup-row.customer,
.followup-row.field {
  border-left-color: var(--blue);
}

.followup-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.followup-main strong,
.followup-main small {
  display: block;
}

.followup-main small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.followup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.attention-item,
.compact-row {
  width: 100%;
  border: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
}

.attention-item {
  border-left: 4px solid var(--line);
}

.attention-item.urgent,
.attention-item.invoiced,
.attention-item.profit {
  border-left-color: var(--coral);
}

.attention-item.open {
  border-left-color: var(--amber);
}

.attention-item.estimated {
  border-left-color: var(--blue);
}

.attention-item.booked,
.attention-item.in_progress,
.attention-item.completed,
.attention-item.paid {
  border-left-color: var(--green);
}

.job-profit-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.attention-item strong,
.compact-row strong {
  display: block;
  margin-bottom: 3px;
}

.attention-item small,
.compact-row small,
.pipeline-row small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.attention-item em,
.compact-row em {
  font-style: normal;
  color: var(--blue-dark);
  font-weight: 850;
  white-space: nowrap;
}

.automation-list.compact .toggle-row {
  min-height: 62px;
}

.message-line {
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
}

.avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 900;
  font-size: 0.76rem;
}

.message-bubble {
  min-width: 0;
  max-width: min(100%, 680px);
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--ink);
  line-height: 1.45;
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-bubble small {
  color: var(--muted);
  font-size: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.message-bubble small b,
.message-bubble small em {
  font-style: normal;
  font-weight: 800;
}

.message-bubble small em {
  font-weight: 650;
}

.message-note-remove {
  width: 22px;
  height: 22px;
  margin-left: 2px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}

.message-note-remove:hover,
.message-note-remove:focus-visible {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
  outline: none;
}

.internal-note-history {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  overflow: hidden;
}

.internal-note-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.internal-note-history-header div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.internal-note-history-header span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.internal-note-history-header strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.internal-note-history-list {
  display: grid;
  gap: 8px;
  max-height: min(42svh, 360px);
  padding: 10px;
  overflow-y: auto;
}

.internal-note-history-item {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: var(--surface);
}

.internal-note-history-item p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.internal-note-history-item small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.internal-note-history-item small b,
.internal-note-history-item small em {
  font-style: normal;
  font-weight: 800;
}

.internal-note-history-item small em {
  font-weight: 650;
}

.internal-note-empty {
  padding: 8px 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.message-line.outbound {
  justify-content: flex-end;
}

.message-line.outbound .message-bubble {
  background: var(--blue-soft);
}

.message-line.note .message-bubble {
  background: var(--note-soft);
}

.communication-list,
.communication-quick-actions {
  display: grid;
  gap: 10px;
}

.communication-quick-actions {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

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

.communication-status-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.communication-status-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.communication-status-card strong,
.communication-status-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.communication-status-card strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.communication-status-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.communication-status-card.urgent,
.communication-status-card.failed {
  border-color: var(--coral);
  background: var(--warning-soft);
}

.communication-status-card.sent {
  border-color: var(--green);
  background: var(--success-soft);
}

.communication-status-card.queued {
  border-color: var(--blue);
  background: var(--blue-soft);
}

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

.communication-main {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: grid;
  gap: 4px;
  text-align: left;
}

.communication-main strong,
.communication-main small,
.communication-main p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.communication-main small {
  color: var(--muted);
  font-weight: 700;
}

.communication-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.field-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.collapsible-field-panel {
  padding: 0;
  overflow: visible;
}

.collapsible-field-panel:not([open]) {
  gap: 0;
}

.collapsible-field-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.collapsible-field-summary::-webkit-details-marker {
  display: none;
}

.collapsible-field-summary > span:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.collapsible-field-summary strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.collapsible-field-summary small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.collapsible-summary-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.collapsible-summary-right em {
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
}

.collapsible-field-panel[open] .collapsible-summary-right em {
  color: var(--muted);
}

.collapsible-field-panel[open] .collapsible-summary-right em::before {
  content: "Close";
}

.collapsible-field-panel[open] .collapsible-summary-right em {
  font-size: 0;
}

.collapsible-field-panel[open] .collapsible-summary-right em::before {
  font-size: 0.78rem;
}

.collapsible-field-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.collapsible-inline-actions {
  display: flex;
  justify-content: flex-start;
}

.equipment-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.equipment-form input {
  min-height: 40px;
  padding: 9px 10px;
}

.equipment-form .wide {
  grid-column: span 2;
}

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

.equipment-card {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  text-align: left;
}

.equipment-card.due {
  border-color: color-mix(in srgb, var(--amber) 55%, var(--line));
}

.equipment-card.upcoming {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
}

.equipment-card-header,
.equipment-card-actions,
.equipment-badges {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.equipment-card-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.equipment-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.equipment-badge.due {
  background: color-mix(in srgb, var(--amber) 16%, var(--surface));
  color: var(--amber);
}

.equipment-badge.upcoming {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.equipment-badge.ok {
  background: color-mix(in srgb, var(--green) 14%, var(--surface));
  color: var(--green);
}

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

.equipment-card small,
.equipment-card p {
  color: var(--muted);
  font-size: 0.82rem;
}

.equipment-card p {
  margin: 0;
}

.equipment-editor {
  display: grid;
  gap: 10px;
}

.equipment-editor summary {
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 850;
}

.danger-text {
  color: var(--coral);
}

.equipment-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.equipment-card dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.equipment-card dd {
  margin: 2px 0 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.customer-equipment-card:hover,
.customer-equipment-card:focus-visible {
  border-color: var(--blue);
  background: var(--hover);
  outline: none;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-heading h3 {
  margin: 0;
  font-size: 0.98rem;
}

.section-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
}

.section-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.template-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "copy copy"
    "recommendations status";
  gap: 12px 16px;
  align-items: start;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue-soft) 28%, var(--surface));
  padding: 14px 16px;
}

.template-summary-card span,
.template-summary-card strong,
.template-summary-card small,
.template-summary-card em {
  display: block;
  min-width: 0;
}

.template-summary-copy {
  grid-area: copy;
  min-width: 0;
}

.template-summary-copy span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.template-summary-card strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.template-summary-card small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.template-summary-card em {
  grid-area: status;
  width: max-content;
  max-width: 100%;
  justify-self: end;
  align-self: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  padding: 5px 8px;
}

.template-recommendations {
  grid-area: recommendations;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.template-recommendations span {
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
  padding: 4px 7px;
}

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

.check-item {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: left;
  padding: 12px;
}

.check-item span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.check-item.done {
  border-color: color-mix(in srgb, var(--green) 52%, var(--line));
  background: var(--success-soft);
}

.task-panel {
  background: color-mix(in srgb, var(--surface-muted) 88%, var(--blue-soft));
}

.task-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.5fr) minmax(120px, 0.5fr) auto;
  gap: 8px;
}

.task-form input,
.task-form select {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
}

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

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

.task-row.done {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  background: var(--success-soft);
}

.task-row.done strong {
  text-decoration: line-through;
  color: var(--muted);
}

.task-row small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.task-check {
  min-width: 58px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
  font-size: 0.78rem;
}

.task-row.done .task-check {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.parts-list,
.history-list,
.customer-history-list,
.file-list {
  display: grid;
  gap: 8px;
}

.parts-request-note {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
}

.parts-request-note strong {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.pick-list-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.pick-list-panel.has-shortage {
  border-color: color-mix(in srgb, var(--coral) 48%, var(--line));
  background: color-mix(in srgb, var(--coral) 6%, var(--surface));
}

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

.pick-list-header strong,
.pick-list-header small,
.reservation-recommendations strong,
.reservation-recommendations small,
.reservation-row strong,
.reservation-row small {
  display: block;
}

.pick-list-header small,
.reservation-recommendations small,
.reservation-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.reservation-recommendations {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-soft);
  padding: 10px;
}

.reservation-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 88px minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.reservation-form input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 8px 10px;
}

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

.reservation-row {
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.55fr) auto;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--field);
  padding: 10px 12px;
}

.reservation-row.picked {
  border-left-color: var(--green);
}

.reservation-row.shortage {
  border-left-color: var(--coral);
}

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

.daily-loadout-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.daily-loadout-panel.has-shortage {
  border-color: color-mix(in srgb, var(--coral) 42%, var(--line));
  background: color-mix(in srgb, var(--coral) 6%, var(--surface));
}

.daily-loadout-panel.compact {
  background: var(--surface-muted);
}

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

.daily-loadout-header strong,
.daily-loadout-header small,
.daily-loadout-row strong,
.daily-loadout-row small {
  display: block;
}

.daily-loadout-header small,
.daily-loadout-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

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

.daily-loadout-row {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--field);
  padding: 10px 12px;
}

.daily-loadout-row.picked {
  border-left-color: var(--green);
}

.daily-loadout-row.shortage {
  border-left-color: var(--coral);
}

.daily-loadout-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.file-upload-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.file-upload-form input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 8px 10px;
}

.document-center {
  display: grid;
  gap: 12px;
}

.document-toolbar {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.document-search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.document-search input {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
}

.document-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.document-filter {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 850;
  padding: 0 10px;
}

.document-filter span {
  color: var(--muted);
  margin-left: 4px;
}

.document-filter.active,
.document-filter:hover,
.document-filter:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
  outline: none;
}

.document-file-list {
  gap: 12px;
}

.file-group {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.file-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.file-group-header h4 {
  margin: 0;
  font-size: 0.92rem;
}

.file-group-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.file-group-header span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

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

.document-file-row {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.document-file-row:last-child {
  border-bottom: 0;
}

.file-visibility {
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.file-visibility.visible {
  border-color: color-mix(in srgb, var(--green) 36%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
}

.file-visibility.private {
  background: var(--surface-muted);
}

.file-icon {
  min-width: 48px;
  color: var(--muted);
  font-weight: 900;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.file-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

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

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

.part-row:has(.part-remove-button) {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto auto auto;
}

.part-row span small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.part-inline-button {
  min-height: 36px;
  padding: 0 10px;
  white-space: nowrap;
}

.part-state-pill {
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  padding: 0 10px;
  text-transform: uppercase;
}

.part-remove-button {
  min-width: 76px;
}

.part-editor {
  justify-self: end;
}

.part-editor summary {
  min-width: 72px;
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--blue-dark);
  font-size: 0.84rem;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}

.part-editor summary::-webkit-details-marker {
  display: none;
}

.part-editor[open] {
  grid-column: 1 / -1;
  justify-self: stretch;
}

.part-editor[open] summary {
  display: none;
}

.part-edit-heading {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.part-edit-heading strong {
  font-size: 0.88rem;
}

.part-edit-heading small {
  color: var(--muted);
  font-size: 0.78rem;
}

.part-edit-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px minmax(140px, 0.6fr) 110px auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.part-edit-form input,
.part-edit-form select {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
}

.history-row {
  width: 100%;
  text-align: left;
}

.customer-history-row {
  width: 100%;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.customer-history-row:hover {
  background: var(--hover);
}

.history-date {
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.history-main strong,
.history-main small,
.history-meta em {
  display: block;
}

.history-main small,
.history-meta em {
  color: var(--muted);
  font-size: 0.8rem;
}

.history-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.part-row em,
.history-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.history-row small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.approval-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  padding: 28px;
}

.auth-gate {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  display: grid;
  grid-template-rows: auto 1fr;
}

.subscription-gate {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  display: grid;
  grid-template-rows: auto 1fr;
}

.auth-gate[hidden],
.subscription-gate[hidden] {
  display: none;
}

.auth-mode .app-shell,
.subscription-mode .app-shell,
.approval-mode .app-shell {
  display: none;
}

.auth-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  padding: 24px;
}

.auth-logo {
  width: min(315px, 100%);
  height: auto;
  justify-self: start;
  display: block;
  margin: -10px 0 -18px;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.22));
}

html[data-theme="dark"] .auth-logo {
  content: url("assets/backline-banner-dark.png");
}

.auth-card h1 {
  font-size: 1.75rem;
}

.auth-card p {
  color: var(--muted);
  margin-top: 6px;
}

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

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.auth-form input {
  min-height: 42px;
  padding: 0 12px;
}

.subscription-gate-header {
  min-height: 72px;
  padding: 0 clamp(22px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--navy);
  color: #f8fbff;
}

.subscription-gate-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.08rem;
  font-weight: 800;
}

.subscription-gate-brand-mark {
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: #fff;
}

.subscription-gate-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.subscription-gate-tagline {
  color: rgba(248, 251, 255, 0.72);
  font-size: 0.84rem;
}

.subscription-gate-layout {
  width: min(1180px, calc(100% - 48px));
  margin: auto;
  padding: clamp(28px, 7vh, 80px) 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(520px, 1.2fr);
  gap: clamp(32px, 6vw, 92px);
  align-items: center;
}

.subscription-gate-welcome {
  padding: 12px 0;
}

.subscription-gate-welcome h1 {
  max-width: 490px;
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.55rem);
  line-height: 1.1;
}

.subscription-gate-welcome > p:not(.eyebrow) {
  max-width: 460px;
  margin: 18px 0 28px;
  color: var(--muted);
  font-size: 1.03rem;
}

.subscription-gate-outcomes {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.subscription-gate-outcomes li {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 10px;
  color: var(--ink);
  font-size: 0.92rem;
}

.subscription-gate-outcomes li > span:first-child {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
}

.subscription-gate-trust {
  margin-top: 30px !important;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem !important;
}

.subscription-gate-surface {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.subscription-gate-surface-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px 20px;
  border-bottom: 1px solid var(--line);
}

.subscription-gate-surface-top h2 {
  margin: 0;
  font-size: 1.4rem;
}

.subscription-gate-surface-top p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.subscription-gate-trial-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.subscription-gate-plans {
  display: grid;
  gap: 10px;
  padding: 20px 28px;
}

.subscription-gate-plan-option {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.subscription-gate-plan-option:hover {
  border-color: color-mix(in srgb, var(--blue) 50%, var(--line));
  background: var(--hover);
}

.subscription-gate-plan-option:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.subscription-gate-plan-option.is-unavailable {
  cursor: not-allowed;
  opacity: 0.48;
}

.subscription-gate-plan-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.subscription-gate-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: var(--surface);
}

.subscription-gate-plan-option:has(input:checked) .subscription-gate-radio {
  border: 6px solid var(--blue);
}

.subscription-gate-plan-option strong,
.subscription-gate-plan-option small {
  display: block;
}

.subscription-gate-plan-option strong {
  font-size: 0.96rem;
}

.subscription-gate-plan-option small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.78rem;
}

.subscription-gate-plan-option > b {
  font-size: 1.06rem;
  text-align: right;
  white-space: nowrap;
}

.subscription-gate-plan-option > b small {
  display: inline;
  font-size: 0.72rem;
}

.subscription-gate-recommendation {
  margin: 0;
  padding: 0 28px 20px;
  color: var(--muted);
  font-size: 0.8rem;
}

.subscription-gate-recommendation strong {
  color: var(--blue-dark);
}

.subscription-gate-status {
  margin: 0 28px 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.88rem;
}

.subscription-gate-checkout {
  display: grid;
  gap: 13px;
  padding: 20px 28px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
}

.subscription-gate-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 0.85rem;
}

.subscription-gate-summary span,
.subscription-gate-checkout > p {
  color: var(--muted);
}

.subscription-gate-primary {
  min-height: 50px;
}

.subscription-gate-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.subscription-gate-secondary-actions .text-button {
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
}

.subscription-gate-checkout > p {
  margin: 0;
  font-size: 0.74rem;
  text-align: center;
}

@media (max-width: 840px) {
  .subscription-gate-layout {
    width: min(620px, calc(100% - 32px));
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 38px 0;
  }

  .subscription-gate-welcome {
    padding: 0;
  }

  .subscription-gate-welcome > p:not(.eyebrow) {
    margin-bottom: 22px;
  }

  .subscription-gate-trust {
    display: none;
  }
}

@media (max-width: 520px) {
  .subscription-gate-header {
    min-height: 60px;
    padding: 0 16px;
  }

  .subscription-gate-tagline {
    display: none;
  }

  .subscription-gate-layout {
    width: min(100% - 24px, 620px);
    padding: 24px 0;
  }

  .subscription-gate-welcome h1 {
    font-size: 2rem;
  }

  .subscription-gate-surface-top,
  .subscription-gate-plans,
  .subscription-gate-checkout {
    padding-left: 18px;
    padding-right: 18px;
  }

  .subscription-gate-recommendation {
    padding-left: 18px;
    padding-right: 18px;
  }

  .subscription-gate-status {
    margin-left: 18px;
    margin-right: 18px;
  }

  .subscription-gate-surface-top {
    display: grid;
  }

  .subscription-gate-trial-badge {
    justify-self: start;
  }

  .subscription-gate-plan-option {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .subscription-gate-plan-option > b {
    grid-column: 2;
    text-align: left;
  }
}

.offline-unlock-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue-soft) 34%, var(--surface));
  padding: 16px;
}

.offline-unlock-panel[hidden] {
  display: none;
}

.offline-unlock-panel h2,
.offline-unlock-panel p {
  margin: 0;
}

.offline-unlock-panel form,
.offline-unlock-panel label {
  display: grid;
  gap: 7px;
}

.offline-unlock-panel label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.offline-unlock-panel input {
  min-height: 42px;
  padding: 0 12px;
}

.auth-gate.offline-unlock-mode .auth-form,
.auth-gate.offline-unlock-mode .auth-divider,
.auth-gate.offline-unlock-mode .oauth-actions {
  display: none;
}

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

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

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

.oauth-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font-weight: 900;
}

.oauth-button:hover {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  background: color-mix(in srgb, var(--blue-soft) 42%, var(--field));
}

@media (max-width: 520px) {
  .oauth-actions {
    grid-template-columns: 1fr;
  }
}

.auth-back-button {
  background: transparent;
  color: var(--muted);
  min-height: 40px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}

.auth-back-button:hover {
  color: var(--blue-dark);
  background: color-mix(in srgb, var(--blue-soft) 55%, transparent);
  border-color: var(--line);
}

.auth-back-button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 2px;
}

.auth-gate-header {
  min-height: 72px;
  padding: 0 clamp(22px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--navy);
  color: #f8fbff;
}

.auth-gate-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.08rem;
  font-weight: 800;
}

.auth-gate-brand-mark {
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: #fff;
}

.auth-gate-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.auth-gate-tagline {
  color: rgba(248, 251, 255, 0.72);
  font-size: 0.84rem;
}

.auth-gate-layout {
  width: min(1120px, calc(100% - 48px));
  margin: auto;
  padding: clamp(28px, 7vh, 80px) 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(420px, 1fr);
  gap: clamp(32px, 7vw, 112px);
  align-items: center;
}

.auth-gate-welcome {
  padding: 12px 0;
}

.auth-gate-welcome h1 {
  max-width: 470px;
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.45rem);
  line-height: 1.1;
}

.auth-gate-welcome > p:not(.eyebrow) {
  max-width: 440px;
  margin: 18px 0 28px;
  color: var(--muted);
  font-size: 1.03rem;
}

.auth-gate-outcomes {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-gate-outcomes li {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 10px;
  color: var(--ink);
  font-size: 0.92rem;
}

.auth-gate-outcomes li > span:first-child {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
}

.auth-gate-access-note {
  margin-top: 30px !important;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem !important;
}

.auth-surface {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-surface-top {
  padding: 26px 28px 20px;
  border-bottom: 1px solid var(--line);
}

.auth-surface-top h2 {
  margin: 0;
  font-size: 1.42rem;
}

.auth-surface-top p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-surface .auth-form {
  gap: 15px;
  padding: 22px 28px 20px;
}

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

.auth-username-note {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.auth-username-note strong {
  color: var(--ink);
}

.auth-surface .auth-form label {
  color: #42546a;
  font-size: 0.82rem;
}

.auth-surface .auth-form input {
  min-height: 46px;
  border-radius: 8px;
  background: var(--field);
  font-size: 0.92rem;
}

.auth-surface .auth-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 13%, transparent);
}

.auth-submit-button {
  min-height: 48px;
  margin-top: 2px;
}

.auth-surface .auth-divider {
  padding: 0 28px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: none;
}

.auth-surface .oauth-actions {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 20px 28px;
}

.auth-surface .oauth-button {
  min-height: 45px;
  background: var(--field);
  font-size: 0.87rem;
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.78rem;
}

.auth-switch-button,
.auth-surface .auth-back-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
}

.auth-surface .auth-back-button::before {
  display: none;
}

.auth-gate-status {
  min-height: 20px;
  margin: 0;
  padding: 0 28px 20px;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.auth-surface .offline-unlock-panel {
  margin: 20px 28px;
}

.auth-gate.offline-unlock-mode .auth-footer {
  display: none;
}

.auth-gate.auth-create-mode .auth-gate-welcome h1 {
  max-width: 500px;
}

@media (max-width: 840px) {
  .auth-gate-layout {
    width: min(580px, calc(100% - 32px));
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 38px 0;
  }

  .auth-gate-welcome {
    padding: 0;
  }

  .auth-gate-access-note {
    display: none;
  }
}

@media (max-width: 520px) {
  .auth-gate-header {
    min-height: 60px;
    padding: 0 16px;
  }

  .auth-gate-tagline {
    display: none;
  }

  .auth-gate-layout {
    width: min(100% - 24px, 580px);
    padding: 24px 0;
  }

  .auth-gate-welcome h1 {
    font-size: 2rem;
  }

  .auth-surface-top,
  .auth-surface .auth-form,
  .auth-surface .oauth-actions,
  .auth-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .auth-surface .auth-divider,
  .auth-gate-status {
    padding-left: 18px;
    padding-right: 18px;
  }

  .auth-surface .offline-unlock-panel {
    margin-left: 18px;
    margin-right: 18px;
  }

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

.account-section > span:last-of-type {
  color: var(--ink);
  font-weight: 800;
}

.approval-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.approval-hero,
.approval-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.approval-hero {
  padding: 24px;
  display: grid;
  gap: 10px;
}

.approval-logo {
  width: min(340px, 100%);
  height: auto;
  display: block;
  margin-bottom: 2px;
}

html[data-theme="dark"] .approval-logo-banner {
  content: url("assets/backline-banner-dark.png");
}

html[data-theme="dark"] .approval-logo-full {
  content: url("assets/backline-full-logo-dark.png");
}

.approval-logo.compact {
  width: min(190px, 60%);
}

.customer-facing-brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-muted) 72%, var(--surface));
}

.customer-facing-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue-dark), var(--teal));
  color: white;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.16);
}

.customer-facing-brand strong,
.customer-facing-brand span,
.customer-facing-brand small {
  display: block;
}

.customer-facing-brand strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.customer-facing-brand span,
.customer-facing-brand small {
  color: var(--muted);
}

.customer-facing-brand span {
  margin-top: 1px;
  font-weight: 800;
}

.customer-facing-brand small {
  margin-top: 2px;
  font-size: 0.8rem;
}

.customer-facing-brand em {
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  padding: 5px 8px;
  text-transform: uppercase;
}

.customer-facing-support {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.customer-facing-support strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.customer-facing-support p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.customer-facing-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.customer-facing-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--blue-dark);
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.approval-hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.approval-hero p {
  color: var(--muted);
}

.approval-card {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.approval-card h2 {
  font-size: 1.05rem;
}

.approval-line-items {
  display: grid;
  gap: 8px;
}

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

.approval-line-items span,
.approval-total span,
.approval-meta-grid span {
  color: var(--muted);
}

.approval-total {
  border-bottom: 0;
  font-size: 1.15rem;
}

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

.approval-meta-grid div {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-muted);
  display: grid;
  gap: 4px;
}

.approval-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.approval-banner {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--ink);
  font-weight: 800;
}

.approval-banner.info {
  background: color-mix(in srgb, var(--blue) 9%, var(--surface));
  color: var(--blue);
}

.approval-banner.success {
  border-color: color-mix(in srgb, var(--green) 38%, var(--line));
  background: var(--success-soft);
  color: var(--green);
}

.approval-banner.danger {
  border-color: color-mix(in srgb, var(--coral) 38%, var(--line));
  background: color-mix(in srgb, var(--coral) 14%, var(--surface));
  color: var(--coral);
}

.approval-form input[type="text"],
.approval-form input:not([type]),
.approval-form textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 12px;
}

.approval-form textarea {
  min-height: 104px;
  padding: 10px 12px;
  resize: vertical;
}

.approval-form small {
  color: var(--muted);
  font-weight: 700;
}

.signature-pad-panel {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.signature-pad-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.signature-pad-panel canvas {
  width: 100%;
  height: 160px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(to bottom, transparent 72%, color-mix(in srgb, var(--line) 70%, transparent) 72%, color-mix(in srgb, var(--line) 70%, transparent) 73%, transparent 73%),
    var(--field);
  touch-action: none;
  cursor: crosshair;
}

.denial-reason {
  display: grid;
  gap: 8px;
}

.approval-confirmation p {
  color: var(--muted);
  line-height: 1.6;
}

.approval-decision-status {
  justify-self: start;
  display: inline-grid;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.approval-decision-status.approved {
  background: var(--success-soft);
  color: var(--green);
}

.approval-decision-status.declined {
  background: color-mix(in srgb, var(--amber) 18%, var(--surface));
  color: var(--amber);
}

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

.approval-document-summary div,
.approval-contact-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.approval-document-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.approval-document-summary strong,
.approval-contact-card strong {
  color: var(--ink);
}

.approval-contact-card p {
  margin: 0;
  font-size: 0.88rem;
}

.approval-download-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.approval-download-choice strong {
  display: block;
  color: var(--ink);
  margin-bottom: 2px;
}

.approval-download-choice p {
  margin: 0;
  font-size: 0.84rem;
}

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

.approval-checkbox input {
  width: 18px;
  height: 18px;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.approval-return {
  justify-self: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  min-height: 38px;
}

.portal-shell {
  max-width: 980px;
}

.portal-hero {
  gap: 8px;
}

.portal-card {
  overflow: hidden;
}

.portal-billing-status {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 16px;
}

.portal-billing-status span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-billing-status strong {
  color: var(--ink);
  font-size: 1.15rem;
}

.portal-billing-status p {
  margin: 0;
  color: var(--muted);
}

.portal-billing-status.paid,
.portal-billing-status.approved {
  border-left-color: var(--green);
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
}

.portal-billing-status.partial,
.portal-billing-status.due,
.portal-billing-status.sent {
  border-left-color: var(--amber);
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
}

.portal-billing-status.declined {
  border-left-color: var(--coral);
  background: color-mix(in srgb, var(--coral) 7%, var(--surface));
}

.portal-payment-card {
  display: grid;
  gap: 14px;
}

.portal-payment-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--green) 34%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 12%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface) 92%, var(--green));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--green) 9%, transparent);
}

.portal-payment-link-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.portal-payment-link-main span {
  color: color-mix(in srgb, var(--green) 72%, var(--ink));
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portal-payment-link-main strong {
  color: var(--ink);
  font-size: 1.16rem;
  line-height: 1.2;
}

.portal-payment-link-main small {
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.portal-payment-link-button {
  align-self: stretch;
  min-width: 132px;
  display: inline-grid;
  place-items: center;
  text-align: center;
  text-decoration: none;
}

.portal-next-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-left: 5px solid var(--blue);
}

.portal-next-step span:first-child,
.portal-file-note strong {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-next-step strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.portal-next-step p {
  margin: 3px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.portal-payment-grid div {
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.portal-payment-grid span,
.portal-payment-form label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.portal-payment-grid strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.portal-payment-grid small {
  color: var(--muted);
  font-size: 0.8rem;
}

.portal-payment-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.portal-payment-form label {
  display: grid;
  gap: 7px;
}

.portal-payment-form .wide,
.portal-payment-form button {
  grid-column: 1 / -1;
}

.portal-payment-form input,
.portal-payment-form select,
.portal-payment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 10px 12px;
}

.portal-payment-form textarea {
  resize: vertical;
}

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

.portal-section-header > .pill {
  justify-self: end;
}

.portal-section-header p {
  color: var(--muted);
}

.portal-timeline {
  display: grid;
  gap: 0;
  padding: 4px 0;
}

.portal-timeline-event {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  position: relative;
  padding: 0 0 18px;
}

.portal-timeline-event::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.portal-timeline-event:last-child {
  padding-bottom: 0;
}

.portal-timeline-event:last-child::before {
  display: none;
}

.portal-timeline-event > span {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--line);
}

.portal-timeline-event.booked > span,
.portal-timeline-event.open > span {
  background: var(--blue);
}

.portal-timeline-event.estimated > span,
.portal-timeline-event.invoiced > span {
  background: var(--amber);
}

.portal-timeline-event.paid > span {
  background: var(--green);
}

.portal-timeline-event div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.portal-timeline-event strong {
  color: var(--ink);
}

.portal-timeline-event p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.portal-timeline-event small {
  color: var(--muted);
  font-size: 0.78rem;
}

.portal-file-list,
.portal-message-list {
  display: grid;
  gap: 8px;
}

.portal-file-note {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
  color: var(--muted);
  padding: 12px;
  margin-bottom: 10px;
}

.portal-file-note span {
  line-height: 1.45;
}

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

.portal-file-row span,
.portal-file-row strong,
.portal-file-row small {
  display: block;
}

.portal-file-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-file-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.portal-message {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.portal-message.in {
  border-left-color: var(--green);
}

.portal-message p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-message small {
  color: var(--muted);
  font-size: 0.78rem;
}

.portal-reply-form {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.portal-reply-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.portal-reply-form textarea {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 10px 12px;
  resize: vertical;
}

.portal-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 750;
  padding: 12px;
}

.calendar-board,
.automation-layout {
  max-width: 960px;
}

.timeline {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.workload-board {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

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

.workload-header h3 {
  margin: 0;
  font-size: 1rem;
}

.workload-header p,
.workload-header span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.workload-header span {
  justify-self: end;
}

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

.workload-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.workload-card.busy {
  border-left-color: var(--amber);
}

.workload-card.overloaded,
.workload-card.unassigned {
  border-left-color: var(--coral);
}

.workload-card strong,
.workload-card span,
.workload-card b,
.workload-card small,
.workload-card em {
  display: block;
  min-width: 0;
}

.workload-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workload-card span,
.workload-card small {
  color: var(--muted);
  font-size: 0.8rem;
}

.workload-card b {
  font-size: 0.95rem;
}

.workload-card em {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--amber);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  padding: 4px 7px;
}

.tech-work-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--blue-soft) 36%, var(--surface));
}

.tech-work-header,
.tech-work-main,
.tech-work-card {
  display: grid;
  gap: 10px;
}

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

.tech-work-header h3 {
  margin: 0;
  font-size: 1rem;
}

.tech-work-header p {
  color: var(--muted);
  font-size: 0.85rem;
}

.tech-work-summary,
.tech-work-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tech-work-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  padding: 5px 8px;
}

.tech-work-chip.urgent {
  border-color: color-mix(in srgb, var(--coral) 36%, var(--line));
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  color: var(--coral);
}

.tech-work-chip.active {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: color-mix(in srgb, var(--blue-soft) 58%, var(--surface));
  color: var(--blue);
}

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

.tech-work-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.tech-work-card.new-assignment {
  border-left-color: var(--coral);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--coral) 28%, var(--line));
}

.tech-work-main {
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.tech-work-main strong,
.tech-work-main small,
.tech-work-meta b,
.tech-work-meta small {
  display: block;
}

.tech-work-main small,
.tech-work-meta small {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 3px;
}

.tech-work-meta {
  text-align: right;
}

.tech-work-meta b {
  font-size: 0.86rem;
}

.tech-work-actions {
  display: flex;
  justify-content: flex-end;
}

.assignment-badge.due {
  border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
  background: var(--warning-soft);
  color: var(--amber);
}

.assignment-badge.tasks {
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  background: color-mix(in srgb, var(--blue-soft) 60%, var(--surface));
  color: var(--blue);
}

.dispatch-board {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 2.25fr);
  gap: 12px;
  align-items: start;
}

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

.schedule-toolbar strong,
.schedule-toolbar span {
  display: block;
}

.schedule-toolbar strong {
  color: var(--ink);
}

.schedule-toolbar span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  margin-top: 2px;
}

.schedule-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.schedule-filter-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  padding: 0 12px;
}

.schedule-filter-button.active {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
  background: color-mix(in srgb, var(--primary) 10%, var(--field));
  color: var(--primary);
}

.schedule-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}

.schedule-health-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.schedule-health-grid div.attention {
  border-color: color-mix(in srgb, var(--coral) 28%, var(--line));
  background: color-mix(in srgb, var(--coral) 7%, var(--surface));
}

.schedule-health-grid span,
.schedule-health-grid strong,
.schedule-health-grid small {
  display: block;
}

.schedule-health-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.schedule-health-grid strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.15rem;
}

.schedule-health-grid small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.dispatch-board.schedule-only,
.dispatch-board.unscheduled-only {
  grid-template-columns: 1fr;
}

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

.schedule-grid.today-grid {
  grid-template-columns: minmax(260px, 1fr);
}

.day-column,
.unscheduled-column {
  min-width: 0;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.unscheduled-column {
  min-width: 0;
}

.day-column.drag-over,
.unscheduled-column.drag-over {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--blue) 36%, transparent);
}

.day-header {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.day-header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.day-jobs {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.time-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

.time-row > span {
  color: var(--muted);
  font-weight: 800;
  padding-top: 16px;
}

.appointment {
  min-height: 54px;
  border-radius: 8px;
  text-align: left;
  font-weight: 850;
  background: var(--surface);
  border: 0;
  border-left: 5px solid var(--line);
  overflow: hidden;
}

.appointment.dragging {
  opacity: 0.58;
}

.appointment.new-assignment {
  border-left-color: var(--coral);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--coral) 32%, var(--line));
  background: color-mix(in srgb, var(--coral) 8%, var(--surface));
}

.appointment.schedule-conflict {
  border-left-color: var(--amber);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--amber) 36%, var(--line));
}

.appointment-main {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: grid;
  gap: 7px;
  padding: 13px 12px 10px;
  text-align: left;
  font-weight: 850;
}

.appointment-open {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.appointment strong,
.appointment small,
.appointment em,
.appointment-time {
  display: block;
}

.appointment small,
.appointment em {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

.appointment em {
  font-style: normal;
  font-weight: 800;
}

.appointment-time {
  width: max-content;
  max-width: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.appointment-time-button {
  cursor: pointer;
}

.appointment-time-button:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.appointment-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.appointment-meta-strip span {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.1;
  padding: 4px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.schedule-status-chip {
  display: inline-grid;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1.1;
  padding: 4px 8px;
  text-transform: uppercase;
}

.schedule-status-chip.booked,
.schedule-status-chip.completed,
.schedule-status-chip.ready {
  border-color: color-mix(in srgb, var(--green) 36%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green);
}

.schedule-status-chip.in-progress {
  border-color: color-mix(in srgb, var(--teal) 36%, var(--line));
  background: color-mix(in srgb, var(--teal) 10%, var(--surface));
  color: var(--teal);
}

.schedule-status-chip.estimated {
  border-color: color-mix(in srgb, var(--blue) 36%, var(--line));
  background: color-mix(in srgb, var(--blue) 10%, var(--surface));
  color: var(--blue);
}

.schedule-status-chip.unread {
  border-color: color-mix(in srgb, var(--coral) 36%, var(--line));
  background: color-mix(in srgb, var(--coral) 10%, var(--surface));
  color: var(--coral);
}

.schedule-status-chip.needs-pick {
  border-color: color-mix(in srgb, var(--teal) 36%, var(--line));
  background: color-mix(in srgb, var(--teal) 10%, var(--surface));
  color: var(--teal);
}

.schedule-status-chip.pick-list {
  border-color: color-mix(in srgb, var(--blue) 36%, var(--line));
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.schedule-status-chip.invoiced,
.schedule-status-chip.conflict,
.schedule-status-chip.needs-approval {
  border-color: color-mix(in srgb, var(--amber) 42%, var(--line));
  background: var(--warning-soft);
  color: var(--amber);
}

.schedule-status-chip.unscheduled,
.schedule-status-chip.unassigned,
.schedule-status-chip.shortage,
.schedule-status-chip.needs-schedule,
.schedule-status-chip.needs-parts {
  border-color: color-mix(in srgb, var(--coral) 34%, var(--line));
  background: color-mix(in srgb, var(--coral) 9%, var(--surface));
  color: var(--coral);
}

.schedule-card-note {
  margin-top: 0;
  line-height: 1.35;
}

.schedule-card-note.conflict {
  color: var(--amber);
}

.schedule-card-note.unscheduled {
  color: var(--coral);
}

.schedule-card-note.needs-schedule,
.schedule-card-note.needs-parts {
  color: var(--coral);
}

.schedule-card-note.needs-approval {
  color: var(--amber);
}

.schedule-card-note.ready,
.schedule-card-note.needs-pick {
  color: var(--muted);
}

.quick-schedule-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.quick-schedule-actions button {
  min-width: 0;
  min-height: 34px;
  padding-inline: 8px;
  font-size: 0.76rem;
}

.assignment-badge {
  display: inline-grid;
  width: max-content;
  margin-bottom: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--coral) 14%, var(--surface));
  color: var(--coral);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.conflict-badge {
  display: inline-grid;
  width: max-content;
  margin-bottom: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.schedule-conflict-note {
  color: var(--amber);
}

.schedule-warning {
  border: 1px solid color-mix(in srgb, var(--amber) 42%, var(--line));
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
  padding: 9px 10px;
}

.schedule-ok,
.schedule-context {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
  padding: 10px;
}

.schedule-context {
  display: grid;
  gap: 3px;
}

.schedule-context strong {
  color: var(--ink);
}

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

.detail-warning span {
  color: var(--ink);
  font-weight: 650;
}

.dispatch-editor {
  border-top: 1px solid var(--line);
}

.dispatch-editor summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 9px 10px;
  color: var(--blue-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

.dispatch-editor summary::-webkit-details-marker {
  display: none;
}

.dispatch-editor summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-editor summary em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.74rem;
}

.dispatch-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 10px 10px;
}

.dispatch-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.dispatch-controls .wide,
.dispatch-controls button {
  grid-column: 1 / -1;
}

.dispatch-controls input,
.dispatch-controls select {
  min-width: 0;
  min-height: 36px;
  border-radius: 7px;
  padding: 7px 8px;
  font-size: 0.82rem;
}

.open-slot {
  min-height: 82px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.86rem;
}

.later-section {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.later-section h3 {
  margin: 0;
  font-size: 0.95rem;
}

.appointment.booked {
  border-color: var(--green);
}

.appointment.in_progress,
.appointment.completed {
  border-color: var(--teal);
}

.appointment.estimated {
  border-color: var(--blue);
}

.appointment.invoiced {
  border-color: var(--coral);
}

.appointment.paid {
  border-color: var(--green);
  background: var(--success-soft);
}

.toggle-row {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.toggle-row small {
  display: block;
  margin-top: 4px;
}

.toggle-row input {
  width: 48px;
  height: 26px;
  accent-color: var(--blue);
}

.metric-block {
  min-height: 150px;
  align-content: space-between;
}

.table-panel {
  margin-top: 16px;
  overflow: visible;
}

.pipeline-table {
  display: grid;
}

.pipeline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 140px;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.pipeline-row span {
  text-transform: capitalize;
}

.pipeline-row em {
  font-style: normal;
  color: var(--muted);
  text-align: right;
}

.money-row strong,
.money-row em {
  display: grid;
  gap: 2px;
}

.customer-directory {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  height: min(760px, calc(100vh - 180px));
  min-height: 560px;
  overflow: hidden;
}

.customer-list {
  display: grid;
  align-content: start;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.customer-card {
  width: 100%;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  column-gap: 18px;
  row-gap: 6px;
  align-items: center;
  padding: 14px 16px;
  text-align: left;
}

.customer-card:hover,
.customer-card.active {
  background: var(--hover);
}

.customer-card.active {
  border-color: var(--blue);
  box-shadow: inset 4px 0 0 var(--blue);
}

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

.customer-card strong {
  font-size: 0.98rem;
  line-height: 1.22;
}

.customer-card small {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-card em {
  color: var(--blue-dark);
  font-style: normal;
  font-weight: 900;
  font-size: 0.8rem;
}

.customer-profile {
  min-width: 0;
  padding: 18px;
  display: grid;
  gap: 16px;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.customer-profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

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

.customer-flag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.customer-flag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 4px 8px;
}

.customer-profile-header h3 {
  margin: 0;
  font-size: 1.35rem;
}

.customer-profile-header p {
  color: var(--muted);
  margin-top: 3px;
}

.customer-demographics,
.customer-stats {
  display: grid;
  gap: 10px;
}

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

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

.customer-demographics div,
.customer-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
  min-width: 0;
}

.customer-demographics span,
.customer-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.customer-demographics strong,
.customer-stats strong {
  display: block;
  overflow-wrap: anywhere;
}

.customer-profile-section {
  display: grid;
  gap: 10px;
}

.customer-profile-section h4 {
  margin: 0;
  font-size: 0.94rem;
}

.customer-account-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.customer-account-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.customer-account-form .wide {
  grid-column: span 2;
}

.customer-account-form input,
.customer-account-form select,
.customer-account-form textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 9px 10px;
}

.customer-account-form textarea {
  resize: vertical;
}

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

.customer-reminder-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--field);
  padding: 12px;
}

.customer-reminder-card.due {
  border-left-color: var(--amber);
  background: color-mix(in srgb, var(--warning-soft) 36%, var(--field));
}

.customer-reminder-card.upcoming {
  border-left-color: var(--blue);
  background: color-mix(in srgb, var(--blue-soft) 32%, var(--field));
}

.customer-reminder-card.ok {
  border-left-color: var(--green);
}

.customer-reminder-card span,
.customer-reminder-card strong,
.customer-reminder-card small {
  display: block;
}

.customer-reminder-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.customer-reminder-card small {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.customer-timeline {
  display: grid;
  gap: 12px;
}

.customer-timeline-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 10px 12px;
}

.customer-timeline-summary span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.customer-timeline-controls {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  padding: 3px;
  white-space: nowrap;
}

.customer-timeline-controls button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  padding: 5px 8px;
}

.customer-timeline-controls button:hover,
.customer-timeline-controls button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.customer-timeline-day {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.customer-timeline-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-muted);
  cursor: pointer;
  list-style: none;
}

.customer-timeline-day[open] .customer-timeline-day-header {
  border-bottom: 1px solid var(--line);
}

.customer-timeline-day-header::-webkit-details-marker {
  display: none;
}

.customer-timeline-day-header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
}

.customer-timeline-day-header span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.customer-timeline-day-header b {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1;
}

.customer-timeline-day[open] .customer-timeline-day-header b {
  transform: none;
}

.customer-timeline-day[open] .customer-timeline-day-header b::before {
  content: "-";
}

.customer-timeline-day[open] .customer-timeline-day-header b {
  font-size: 0;
}

.customer-timeline-day[open] .customer-timeline-day-header b::before {
  font-size: 0.95rem;
}

.customer-timeline-events {
  display: grid;
}

.customer-timeline-event {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.customer-timeline-event:last-child {
  border-bottom: 0;
}

.customer-timeline-event:hover,
.customer-timeline-event:focus-visible {
  background: var(--hover);
  outline: none;
}

.customer-timeline-event strong,
.customer-timeline-event small {
  display: block;
}

.customer-timeline-event small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-timeline-event .timeline-job-label {
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
  opacity: 0.82;
}

.customer-timeline-event em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.customer-profile-notice {
  grid-column: 1 / -1;
  margin: 0;
  align-self: center;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 12%, transparent);
}

.timeline-dot.paid {
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 14%, transparent);
}

.timeline-dot.estimated {
  background: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 13%, transparent);
}

.timeline-dot.booked {
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
}

.timeline-dot.open {
  background: var(--amber);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 16%, transparent);
}

.empty-state {
  min-height: 220px;
  padding: 22px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.compact-empty {
  min-height: 150px;
}

.detail-empty {
  min-height: 520px;
}

.empty-note {
  color: var(--muted);
  background: var(--surface-muted);
  border-radius: 8px;
  padding: 14px;
}

.modal {
  border: 0;
  padding: 0;
  max-width: calc(100vw - 28px);
  max-height: calc(100svh - 28px);
  background: transparent;
}

.modal::backdrop {
  background: var(--overlay);
}

.modal-card {
  width: min(720px, calc(100vw - 28px));
  max-width: 100%;
  max-height: calc(100svh - 28px);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.activity-detail-drawer .activity-detail-card {
  width: 100%;
  max-height: calc(100svh - 28px);
  overflow-x: hidden;
  overflow-y: auto;
}

.modal-header,
.modal-actions {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.modal-header-with-close {
  position: relative;
  padding-right: 66px;
}

.modal-header p:not(.eyebrow) {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.88rem;
}

.modal-close-button {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.modal-close-button:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue-dark);
}

.modal-close-button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.modal-inline-close {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.modal-inline-close:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue-dark);
}

.modal-inline-close:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.modal-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.action-modal-card {
  width: min(660px, calc(100vw - 28px));
}

.company-settings-card {
  width: min(780px, calc(100vw - 28px));
}

.setup-progress-panel {
  display: grid;
  gap: 12px;
  margin: 16px 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.setup-progress-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.setup-progress-header h3 {
  margin: 0;
  font-size: 1rem;
}

.setup-progress-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

.setup-progress-header > span {
  color: var(--blue-dark);
  font-weight: 900;
}

.setup-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.setup-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

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

.setup-progress-list span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.setup-progress-list b {
  min-width: 42px;
  color: var(--amber);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.setup-progress-list .complete {
  color: var(--ink);
}

.setup-progress-list .complete b {
  color: var(--green);
}

.form-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 40px;
  padding: 9px 10px;
  color: var(--ink);
  font-weight: 500;
}

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

.template-settings-section {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

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

.template-settings-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  overflow: visible;
}

.template-settings-card.custom-template {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
}

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

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

.template-toggle input {
  width: 18px;
  height: 18px;
}

.template-toggle strong,
.template-toggle small,
.template-settings-header > span {
  display: block;
}

.template-toggle small,
.template-settings-header > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.template-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.template-card-actions span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.template-settings-body label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.template-settings-body .wide {
  grid-column: span 2;
}

.template-settings-body input {
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
}

.template-task-editor {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.template-task-editor-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

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

.template-task-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(118px, 0.45fr) minmax(118px, 0.45fr) auto;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.template-task-row:focus-within {
  z-index: 20;
}

.template-task-row input {
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
}

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

.print-schedule {
  display: none;
}

@media (min-width: 981px) and (max-height: 820px) {
  .sidebar {
    padding-block: 18px;
    gap: 18px;
  }

  .nav-list {
    gap: 6px;
  }

  .nav-item {
    padding: 8px 10px;
  }
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }

  .topbar-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
    z-index: 4;
  }

  .topbar-actions .customer-search {
    flex: 1 1 320px;
    min-width: 240px;
  }

  .topbar-actions > button,
  .topbar-actions .settings-button {
    flex: 0 0 auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    min-height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    overflow-x: hidden;
    overflow-y: visible;
    max-width: 100vw;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-line);
  }

  .workspace {
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    padding-top: 18px;
  }

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

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

  .nav-list {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    min-width: 0;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .stats-strip,
  .beta-readiness-list,
  .work-grid,
  .team-layout,
  .metrics-grid,
  .job-summary-bar,
  .portal-access-grid,
  .portal-payment-grid,
  .portal-payment-form,
  .communication-status-grid,
  .equipment-form,
  .inventory-summary {
    grid-template-columns: 1fr 1fr;
  }

  .template-settings-body,
  .template-task-row {
    grid-template-columns: 1fr 1fr;
  }

  .template-task-row > input {
    grid-column: 1 / -1;
  }

  .role-workflow-grid,
  .role-restriction-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-preview-metrics,
  .role-preview-columns {
    grid-template-columns: 1fr;
  }

  #view-inbox.active .work-grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    align-items: start;
    overflow-x: clip;
  }

  #view-inbox.active .inbox-panel {
    position: static;
  }

  #view-inbox.active .inbox-panel,
  #view-inbox.active .detail-panel {
    max-height: none;
  }

  #view-inbox.active .job-list,
  #view-inbox.active .detail-panel {
    overflow-y: visible;
  }

  #view-inbox.active .job-list {
    max-height: 360px;
    overflow-y: auto;
  }

  #view-inbox.active .detail-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  #view-inbox.active .detail {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  #view-inbox.active .job-summary-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    font-size: 14px;
  }

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

  .template-summary-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "copy"
      "recommendations"
      "status";
    gap: 10px;
    padding: 14px;
  }

  .template-summary-card em {
    justify-self: start;
  }

  .app-shell {
    width: 100%;
    max-width: 100vw;
    height: auto;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .workspace {
    padding: 10px;
    width: 100%;
    max-width: 100vw;
    height: auto;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: visible;
    overscroll-behavior: auto;
  }

  h1 {
    font-size: 1.42rem;
    line-height: 1.08;
  }

  h2 {
    font-size: 1.05rem;
  }

  .creator-grid,
  .creator-grid.compact {
    grid-template-columns: 1fr;
  }

  .creator-readiness-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .creator-readiness-row em {
    min-width: 0;
  }

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

  .creator-production-row,
  .creator-setup-row {
    grid-template-columns: 1fr;
  }

  .creator-go-panel {
    grid-template-columns: 1fr;
  }

  .creator-go-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .creator-pilot-crm-controls {
    grid-template-columns: 1fr;
  }

  .creator-pilot-crm-controls em {
    justify-self: start;
  }

  .creator-pilot-decision {
    grid-template-columns: 1fr;
  }

  .creator-pilot-decision .secondary-button {
    width: 100%;
  }

  .creator-pilot-followups,
  .creator-pilot-followup-card {
    grid-template-columns: 1fr;
  }

  .creator-pilot-followup-card .secondary-button {
    width: 100%;
  }

  .creator-pilot-form,
  .creator-pilot-list,
  .creator-pilot-fields {
    grid-template-columns: 1fr;
  }

  .creator-pilot-form textarea {
    grid-column: auto;
  }

  .creator-pilot-card-main,
  .creator-pilot-card-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .creator-beta-progress > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .creator-production-progress > div:first-child,
  .creator-setup-progress > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .creator-beta-controls {
    width: 100%;
    min-width: 0;
  }

  .creator-production-controls,
  .creator-setup-controls {
    width: 100%;
    min-width: 0;
  }

  .topbar,
  .panel-header,
  .role-preview-toolbar,
  .role-operational-header,
  .detail-title,
  .section-heading,
  .modal-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .onboarding-panel-header > div {
    min-width: 0;
  }

  .onboarding-panel-header h2,
  .onboarding-panel-header p {
    overflow-wrap: anywhere;
  }

  .onboarding-tour-button {
    width: auto;
    min-width: 0;
    padding-inline: 12px;
    white-space: nowrap;
  }

  .onboarding-step {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 14px;
  }

  .contextual-guide {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
    margin: -4px 0 14px;
  }

  .contextual-guide-actions {
    width: 100%;
    justify-content: space-between;
  }

  .onboarding-step .primary-button {
    width: 100%;
  }

  .role-preview-toolbar label,
  .role-preview-score {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .role-workflow-grid,
  .role-restriction-list {
    grid-template-columns: 1fr;
  }

  .inbox-panel .panel-header {
    grid-template-columns: 1fr;
  }

  .inbox-panel .collapse-inbox-button {
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
  }

  .inbox-panel .segmented {
    grid-column: 1;
    grid-row: 3;
  }

  .topbar-actions,
  .customer-facing-brand,
  .beta-readiness-list,
  .attention-layout,
  .customer-directory,
  .customer-demographics,
  .customer-stats,
  .dashboard-grid,
  .message-compose,
  .file-upload-form,
  .task-form,
  .task-row,
  .communication-row,
  .communication-status-grid,
  .activity-row,
  .equipment-form,
  .equipment-card dl,
  .dispatch-brief-header,
  .closeout-header,
  .closeout-item,
  .schedule-toolbar,
  .dispatch-board,
  .team-layout,
  .team-row,
  .database-row,
  .stats-strip,
  .work-grid,
  .metrics-grid,
  .profit-watch-summary,
  .profit-watch-row,
  .billing-review-item,
  .receivables-summary,
  .receivable-row,
  .receivable-amounts,
  .payment-review-card,
  .job-summary-bar,
  .portal-access-grid,
  .portal-payment-grid,
  .portal-payment-link,
  .portal-payment-form,
  .customer-update-row,
  .template-summary-card,
  .followup-summary,
  .followup-row,
  .meta-grid,
  .approval-meta-grid,
  .approval-document-summary,
  .approval-download-choice,
  .checklist-grid,
  .form-grid,
  .role-editor-body,
  .role-editor-preview-grid,
  .template-settings-body,
  .template-settings-header,
  .template-task-row,
  .portal-section-header,
  .file-row,
  .portal-file-row,
  .pipeline-row,
  .billing-timeline-header,
  .billing-timeline-row,
  .inventory-reorder-row,
  .inventory-row,
  .inventory-usage-row,
  .stock-movement-row,
  .inventory-orders-header,
  .inventory-order-card-row,
  .inventory-order-detail-row,
  .daily-loadout-header,
  .daily-loadout-row,
  .reservation-form,
  .reservation-row,
  .reservation-recommendations,
  .template-pricebook-row,
  .costing-breakdown,
  .customer-account-form,
  .customer-reminder-card,
  .part-row:has(.part-remove-button),
  .part-edit-form,
  .activity-detail-grid,
  .activity-detail-change,
  .customer-timeline-event {
    grid-template-columns: 1fr;
  }

  .portal-payment-link-button {
    width: 100%;
    min-width: 0;
  }

  .portal-section-header > .pill {
    justify-self: start;
  }

  .role-editor-launcher {
    align-items: stretch;
    flex-direction: column;
  }

  .role-editor-preview-header {
    align-items: stretch;
    flex-direction: column;
  }

  .role-editor-preview-header b {
    max-width: none;
    text-align: left;
  }

  .view,
  .panel,
  .detail-panel,
  .inbox-panel,
  .table-panel,
  .schedule-panel,
  .team-section,
  .team-row,
  .role-card,
  .modal-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .panel {
    border-radius: 8px;
  }

  .detail-panel,
  .detail-panel.panel,
  #view-inbox.active .detail-panel {
    overflow-x: clip;
    overflow-y: visible;
  }

  .topbar {
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    margin: -6px -6px 12px;
    padding: 8px 6px 12px;
    background: var(--bg);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  }

  .topbar-title {
    min-width: 0;
    flex: 0 0 auto;
    gap: 5px;
  }

  .topbar-actions {
    flex: 0 0 auto;
  }

  .topbar-title h1,
  .topbar-title p {
    overflow-wrap: anywhere;
  }

  .topbar-title .eyebrow {
    margin-bottom: 0;
    font-size: 0.7rem;
  }

  .topbar-title > p:not(.eyebrow) {
    font-size: 0.88rem;
  }

  .panel-header {
    gap: 8px;
  }

  .panel-header p,
  .section-heading p {
    line-height: 1.35;
  }

  .segmented,
  .schedule-filters {
    gap: 4px;
    padding: 3px;
  }

  .segment,
  .schedule-filter-button {
    padding: 7px 9px;
    font-size: 0.78rem;
  }

  .job-row {
    padding: 12px;
  }

  .job-row-top,
  .job-row-bottom {
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
  }

  .job-row-top {
    flex-direction: column;
  }

  .job-row-top .pill {
    align-self: flex-start;
  }

  .job-summary {
    line-height: 1.35;
  }

  .detail {
    width: min(100%, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    padding: 0 12px 12px;
    gap: 14px;
    overflow-x: clip;
  }

  .job-sticky-header,
  .detail-title,
  .detail-actions,
  .job-summary-bar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  #view-inbox.active .job-summary-bar {
    grid-template-columns: 1fr;
  }

  .field-panel,
  .portal-access-panel,
  .customer-updates-panel,
  .dispatch-brief,
  .closeout-panel,
  .invoice-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  .collapsible-field-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 16px;
    padding: 18px 22px;
  }

  .collapsible-field-summary > span:first-child {
    gap: 7px;
  }

  .collapsible-field-summary strong,
  .collapsible-field-summary small {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .collapsible-summary-right {
    justify-self: end;
    min-width: 0;
  }

  .collapsible-field-body {
    padding: 0 22px 18px;
  }

  .dispatch-brief {
    padding: 12px;
  }

  .dispatch-brief-grid {
    grid-template-columns: 1fr;
  }

  .dispatch-brief-card strong,
  .dispatch-brief-card small {
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }

  .job-sticky-header {
    position: static;
    z-index: auto;
    margin: 0;
    padding: 0;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
  }

  .billing-timeline-row {
    gap: 4px;
  }

  .billing-timeline-dot {
    display: none;
  }

  .billing-timeline-row time {
    justify-self: start;
  }

  .file-visibility {
    justify-self: start;
  }

  .equipment-form .wide,
  .customer-account-form .wide {
    grid-column: auto;
  }

  .customer-profile-notice {
    white-space: normal;
  }

  .customer-facing-brand em {
    justify-self: start;
  }

  .template-settings-body .wide,
  .template-task-row > input {
    grid-column: auto;
  }

  .template-task-editor-header {
    align-items: flex-start;
    flex-direction: column;
  }

  #view-inbox.active .work-grid {
    height: auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-items: start;
    overflow-x: hidden;
    overflow-y: visible;
  }

  #view-inbox.active .inbox-panel {
    position: static;
  }

  #view-inbox.active .inbox-panel,
  #view-inbox.active .detail-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: none;
    overflow-y: visible;
  }

  #view-inbox.active .job-list,
  #view-inbox.active .detail-panel {
    overflow-y: visible;
  }

  .message-thread-panel {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
  }

  .message-thread-resize {
    display: none;
  }

  .message-thread {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 10px;
  }

  .work-grid.inbox-collapsed {
    grid-template-columns: 1fr;
  }

  .work-grid.inbox-collapsed .inbox-panel {
    width: 100%;
    align-self: stretch;
  }

  .work-grid.inbox-collapsed .inbox-panel .panel-header > div,
  .work-grid.inbox-collapsed .inbox-panel .segmented,
  .work-grid.inbox-collapsed .job-list {
    display: none;
  }

  .work-grid.inbox-collapsed .inbox-panel .panel-header {
    min-height: auto;
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px;
    border-bottom: 1px solid var(--line);
  }

  .work-grid.inbox-collapsed .collapse-inbox-button {
    display: block;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: auto;
    min-height: 44px;
    justify-self: stretch;
    align-self: stretch;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field);
    color: var(--ink);
    font-size: 0.9rem;
    writing-mode: horizontal-tb;
    transform: none;
  }

  .tech-work-header,
  .workload-header,
  .tech-work-card,
  .tech-work-main {
    grid-template-columns: 1fr;
  }

  .workload-header span {
    justify-self: start;
  }

  .tech-work-meta {
    text-align: left;
  }

  .activity-meta {
    justify-items: start;
    text-align: left;
  }

  .customer-quick-actions {
    justify-content: flex-start;
  }

  .section-heading-actions,
  .template-recommendations {
    justify-content: flex-start;
  }

  .template-summary-card em {
    justify-self: start;
  }

  .followup-actions {
    justify-content: flex-start;
  }

  .topbar-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .topbar-actions > button,
  .topbar-actions .settings-button,
  .customer-search,
  .settings-menu {
    width: 100%;
    min-width: 0;
  }

  .topbar-actions .customer-search {
    grid-column: 1 / -1;
  }

  .topbar-actions > button,
  .topbar-actions .settings-button {
    min-height: 38px;
  }

  .settings-popover {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 74px;
    width: auto;
    max-height: calc(100svh - 92px);
    overflow-y: auto;
  }

  .billing-summary {
    align-items: start;
  }

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

  .schedule-health-grid,
  .quick-schedule-actions {
    grid-template-columns: 1fr;
  }

  .search-input {
    width: 100%;
  }

  .customer-directory {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .customer-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 280px;
  }

  .customer-profile {
    overflow: visible;
  }

  .customer-profile-header {
    flex-direction: column;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 10px 12px;
    gap: 10px;
    max-width: 100vw;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-line);
    box-shadow: 0 10px 26px rgba(16, 42, 67, 0.08);
  }

  .brand-subtitle,
  .nav-item > span:not(.nav-icon):not(.nav-badge) {
    display: none;
  }

  .brand {
    flex: 0 0 auto;
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-wordmark {
    width: 102px;
    height: 34px;
  }

  .nav-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    min-width: 0;
    padding: 2px 0;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 0;
  }

  .nav-icon {
    width: 30px;
    height: 30px;
  }

  .nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 0.64rem;
  }

  .detail-actions,
  .modal-actions,
  .customer-quick-actions,
  .section-heading-actions,
  .followup-actions,
  .approval-actions,
  .role-card-actions,
  .custom-role-actions,
  .invoice-actions,
  .inventory-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    justify-content: stretch;
  }

  .detail-actions {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .desktop-job-actions {
    display: none;
  }

  .mobile-job-actions {
    display: grid;
    width: 100%;
    max-width: min(100%, calc(100vw - 44px));
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-muted) 72%, var(--surface));
    box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 45%, transparent);
  }

  .mobile-primary-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    width: 100%;
    min-width: 0;
  }

  .detail-actions > *,
  .modal-actions > *,
  .customer-quick-actions > *,
  .section-heading-actions > *,
  .followup-actions > *,
  .approval-actions > *,
  .role-card-actions > *,
  .custom-role-actions > *,
  .invoice-actions > *,
  .inventory-detail-actions > *,
  .action-button,
  .utility-button,
  .secondary-button,
  .primary-button {
    min-width: 0;
  }

  .detail-actions .action-button,
  .modal-actions button,
  .customer-quick-actions button,
  .section-heading-actions button,
  .followup-actions button,
  .approval-actions button,
  .role-card-actions button,
  .custom-role-actions button,
  .invoice-actions button,
  .inventory-detail-actions button {
    width: 100%;
  }

  .detail-actions .action-button {
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 0.84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--surface);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--shadow) 5%, transparent);
  }

  .detail-actions .action-button.accent {
    width: 100%;
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
  }

  .job-action-menu-trigger {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-more-actions-trigger {
    margin-top: 0;
    background: var(--field);
    border-color: color-mix(in srgb, var(--line) 80%, var(--blue-soft));
    color: var(--ink);
  }

  .job-action-menu-panel {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 5px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-muted) 72%, var(--surface));
  }

  .job-action-menu-group {
    padding: 10px;
    gap: 6px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .job-action-menu-group:first-child {
    border-top: 0;
  }

  .job-action-menu-group div {
    gap: 3px;
  }

  .portal-file-actions {
    justify-content: stretch;
    width: 100%;
  }

  .portal-file-actions .utility-button {
    flex: 1 1 128px;
  }

  .job-summary-bar {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  #view-inbox.active .job-summary-bar {
    grid-template-columns: 1fr;
  }

  .job-summary-card,
  .summary-value-button,
  .task-row > span,
  .task-row strong,
  .task-row small {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .task-form {
    gap: 7px;
  }

  .task-form input,
  .task-form select,
  .task-form button,
  .task-check {
    width: 100%;
    min-width: 0;
  }

  .task-row {
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .task-check {
    justify-self: stretch;
    min-height: 36px;
  }

  .invoice-line-header {
    display: none;
  }

  .invoice-line-row,
  .pricebook-row,
  .payment-ledger-list .invoice-line-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 7px;
    padding: 12px;
  }

  .invoice-line-row > *,
  .pricebook-row > *,
  .payment-ledger-list .invoice-line-row > * {
    min-width: 0;
    justify-self: stretch;
  }

  .invoice-remove-button {
    width: 100%;
    justify-self: stretch;
  }

  .segmented,
  .schedule-filters,
  .pipeline-table,
  .pricebook-list,
  .inventory-list,
  .inventory-orders-list,
  .inventory-supplier-list,
  .inventory-reorder-list,
  .activity-list,
  .receivables-list,
  .payment-review-list,
  .message-thread {
    max-width: 100%;
    overflow-x: hidden;
  }

  .segment,
  .schedule-filter-button {
    white-space: nowrap;
  }

  .modal {
    padding: 0;
  }

  .modal-card {
    width: calc(100vw - 20px);
    max-height: calc(100svh - 20px);
    overflow-y: auto;
  }

  .modal-header,
  .modal-actions {
    padding: 14px;
  }

  .billing-plan-options {
    padding: 14px;
  }

  .billing-plan-option {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .billing-plan-price {
    grid-column: 2;
  }

  .billing-plan-note {
    padding: 0 14px 14px;
  }

  .form-grid,
  .company-settings-grid {
    padding-inline: 14px;
  }

  .setup-progress-list {
    grid-template-columns: 1fr;
  }

  .customer-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    width: 100%;
    max-height: min(360px, calc(100svh - 190px));
    overflow-y: auto;
  }
}

@media (max-width: 430px) {
  .workspace {
    padding: 8px;
  }

  .sidebar {
    padding: 8px 10px;
  }

  .brand-wordmark {
    width: 88px;
  }

  .nav-item {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .nav-icon {
    width: 28px;
    height: 28px;
  }

  .detail-actions,
  .modal-actions,
  .customer-quick-actions,
  .section-heading-actions,
  .followup-actions,
  .approval-actions,
  .role-card-actions,
  .custom-role-actions,
  .invoice-actions,
  .inventory-detail-actions {
    grid-template-columns: 1fr;
  }

  .detail-actions {
    display: block;
  }

  .collapsible-field-summary {
    grid-template-columns: 1fr;
    align-items: flex-start;
    padding: 16px 18px;
  }

  .collapsible-summary-right {
    justify-self: start;
  }

  .collapsible-field-body {
    padding: 0 18px 16px;
  }

  .detail-actions .action-button,
  .job-action-menu-trigger {
    width: 100%;
  }

  .topbar {
    margin: -4px -4px 10px;
    padding: 6px 4px 10px;
  }

  .topbar-actions {
    gap: 7px;
  }

  .topbar-actions > button,
  .topbar-actions .settings-button,
  .search-input {
    min-height: 36px;
  }

  .topbar-title > p:not(.eyebrow) {
    font-size: 0.84rem;
  }

  .customer-search-results {
    top: calc(100% + 8px);
  }
}

.creator-nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.creator-console-panel {
  overflow: hidden;
}

.creator-console-panel .panel-header,
.creator-console-panel .creator-console-note {
  margin-left: 10px;
  margin-right: 10px;
}

.creator-diagnostics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-width: 0;
  padding: 0 10px 12px;
}

.creator-console-note {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
}

.creator-health-section {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.creator-health-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.creator-health-heading h3 {
  margin: 0;
  font-size: 0.98rem;
}

.creator-health-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.creator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  min-width: 0;
}

.creator-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.creator-card {
  min-width: 0;
  min-height: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.creator-card.warning {
  border-left-color: var(--amber);
}

.creator-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.creator-card strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creator-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.creator-readiness-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.creator-readiness-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.creator-readiness-row.warning {
  border-left-color: var(--amber);
}

.creator-readiness-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.creator-readiness-row strong {
  overflow-wrap: anywhere;
}

.creator-readiness-row span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creator-readiness-row em {
  flex: 0 0 auto;
  min-width: 82px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.creator-readiness-row.warning em {
  background: var(--warning-soft);
  color: var(--amber);
}

.creator-release-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  min-width: 0;
}

.creator-beta-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.creator-beta-progress {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-beta-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.creator-beta-progress strong {
  color: var(--ink);
}

.creator-beta-progress span {
  color: var(--muted);
  font-size: 0.86rem;
}

.creator-beta-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--neutral-soft);
}

.creator-beta-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.creator-beta-summary button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.creator-beta-summary button.active {
  background: var(--blue-soft);
  color: var(--blue-dark);
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
}

.creator-beta-summary strong {
  color: var(--ink);
}

.creator-beta-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.creator-beta-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 0.8fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.creator-beta-row.passed {
  border-left-color: var(--green);
}

.creator-beta-row.needs_work {
  border-left-color: var(--amber);
}

.creator-beta-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.creator-beta-main div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.creator-beta-main strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.creator-beta-main span,
.creator-beta-main em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creator-beta-controls {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 250px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-beta-controls button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.creator-beta-controls button.active {
  background: var(--surface);
  color: var(--blue-dark);
  box-shadow: inset 0 0 0 1px var(--line);
}

.creator-beta-row textarea {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  resize: vertical;
  font-size: 0.86rem;
}

.creator-production-summary,
.creator-setup-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.creator-production-progress,
.creator-setup-progress {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-production-progress > div:first-child,
.creator-setup-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.creator-production-progress strong,
.creator-setup-progress strong {
  color: var(--ink);
}

.creator-production-progress span,
.creator-setup-progress span {
  color: var(--muted);
  font-size: 0.86rem;
}

.creator-production-progress-bar,
.creator-setup-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--neutral-soft);
}

.creator-production-progress-bar span,
.creator-setup-progress-bar span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.creator-setup-progress-bar span {
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.creator-production-summary button,
.creator-setup-summary button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.creator-production-summary button.active,
.creator-setup-summary button.active {
  background: var(--blue-soft);
  color: var(--blue-dark);
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
}

.creator-production-summary button.primary-button,
.creator-setup-summary button.primary-button {
  margin-left: auto;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
}

.creator-production-list,
.creator-setup-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.creator-production-row,
.creator-setup-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 0.8fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.creator-production-row.ready,
.creator-setup-row.ready {
  border-left-color: var(--teal);
}

.creator-production-row.needs_work,
.creator-setup-row.needs_work {
  border-left-color: var(--amber);
}

.creator-production-main,
.creator-setup-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.creator-production-main div,
.creator-setup-main div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.creator-production-main strong,
.creator-setup-main strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.creator-production-main span,
.creator-production-main em,
.creator-setup-main span,
.creator-setup-main em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creator-production-controls,
.creator-setup-controls {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 250px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-production-controls button,
.creator-setup-controls button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.creator-production-controls button.active,
.creator-setup-controls button.active {
  background: var(--surface);
  color: var(--blue-dark);
  box-shadow: inset 0 0 0 1px var(--line);
}

.creator-production-row textarea,
.creator-setup-row textarea {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  resize: vertical;
  font-size: 0.86rem;
}

.creator-live-health-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-live-health-summary div {
  display: grid;
  gap: 3px;
  min-width: 220px;
}

.creator-live-health-summary strong {
  color: var(--ink);
}

.creator-live-health-summary span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.creator-live-health-summary .primary-button {
  width: auto;
  min-height: 38px;
  padding: 0 16px;
}

.creator-live-health-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  min-width: 0;
  margin-top: 10px;
}

.creator-go-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(220px, 0.8fr) minmax(220px, 1fr) auto;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-go-panel.go {
  border-left-color: var(--green);
}

.creator-go-panel.blocked {
  border-left-color: var(--red);
}

.creator-go-main,
.creator-go-list {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.creator-go-main span {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.creator-go-panel.go .creator-go-main span {
  background: var(--success-soft);
  color: var(--green);
}

.creator-go-panel.blocked .creator-go-main span {
  background: var(--danger-soft);
  color: var(--red);
}

.creator-go-main strong {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creator-go-main p,
.creator-go-list span {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.creator-go-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.creator-go-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.creator-go-metrics strong {
  color: var(--ink);
  font-size: 1rem;
}

.creator-go-list {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.creator-go-list strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.creator-go-panel .primary-button {
  align-self: center;
  width: auto;
  min-height: 38px;
  padding: 0 16px;
}

.creator-pilot-pack,
.creator-feedback-kit,
.creator-pilot-scorecard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  min-width: 0;
}

.creator-pilot-pack article,
.creator-feedback-kit article,
.creator-pilot-scorecard article {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.creator-pilot-pack article.go {
  border-left-color: var(--green);
}

.creator-pilot-pack article.hold {
  border-left-color: var(--amber);
}

.creator-pilot-pack article.blocked {
  border-left-color: var(--red);
}

.creator-pilot-pack span,
.creator-feedback-kit span,
.creator-pilot-scorecard span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.creator-pilot-pack strong,
.creator-feedback-kit strong,
.creator-pilot-scorecard strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creator-pilot-pack p,
.creator-feedback-kit p,
.creator-pilot-scorecard p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.creator-pilot-pack .secondary-button,
.creator-feedback-kit .secondary-button,
.creator-pilot-scorecard .secondary-button {
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
}

.creator-pilot-crm {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.creator-pilot-crm-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  min-width: 0;
}

.creator-pilot-crm-summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.82rem;
}

.creator-pilot-crm-summary strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.creator-pilot-crm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.creator-pilot-crm-actions .secondary-button {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
}

.creator-pilot-crm-controls {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(260px, 1fr) auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-pilot-crm-controls label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.creator-pilot-crm-controls label span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.creator-pilot-crm-controls input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  font-size: 0.84rem;
}

.creator-pilot-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.creator-pilot-filters button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: capitalize;
}

.creator-pilot-filters button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.creator-pilot-crm-controls em {
  justify-self: end;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.creator-pilot-decision {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 0.8fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
}

.creator-pilot-decision.package {
  border-left-color: var(--green);
}

.creator-pilot-decision.diagnose {
  border-left-color: var(--amber);
}

.creator-pilot-decision.build {
  border-left-color: var(--blue);
}

.creator-pilot-decision > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.creator-pilot-decision > div:first-child span {
  color: var(--blue-dark);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.creator-pilot-decision.package > div:first-child span {
  color: var(--green-dark);
}

.creator-pilot-decision.diagnose > div:first-child span {
  color: var(--amber-dark);
}

.creator-pilot-decision > div:first-child strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creator-pilot-decision > div:first-child p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.creator-pilot-decision-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.creator-pilot-decision-metrics span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.creator-pilot-decision-metrics strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.creator-pilot-decision .secondary-button {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
}

.creator-pilot-followups {
  display: grid;
  grid-template-columns: minmax(190px, 0.32fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
}

.creator-pilot-followups > div:first-child {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.creator-pilot-followups > div:first-child span {
  color: var(--green-dark);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.creator-pilot-followups > div:first-child strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creator-pilot-followups > div:first-child p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.creator-pilot-followup-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.creator-pilot-followup-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-pilot-followup-card div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.creator-pilot-followup-card strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creator-pilot-followup-card span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.creator-pilot-followup-card .secondary-button {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
}

.creator-pilot-followup-card.empty {
  grid-template-columns: 1fr;
}

.creator-pilot-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-pilot-form input,
.creator-pilot-form textarea {
  min-width: 0;
  font-size: 0.86rem;
}

.creator-pilot-form textarea {
  grid-column: span 3;
  min-height: 42px;
  resize: vertical;
}

.creator-pilot-form .primary-button {
  min-height: 42px;
}

.creator-pilot-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 10px;
  min-width: 0;
}

.creator-pilot-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.creator-pilot-card.testing,
.creator-pilot-card.graduated {
  border-left-color: var(--green);
}

.creator-pilot-card.follow_up,
.creator-pilot-card.onboarding {
  border-left-color: var(--amber);
}

.creator-pilot-card.not_fit {
  border-left-color: var(--muted);
}

.creator-pilot-card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.creator-pilot-card-main div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.creator-pilot-card-main span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.creator-pilot-card-main strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creator-pilot-card-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.creator-pilot-card-main em {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
}

.creator-pilot-statuses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-pilot-statuses button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.creator-pilot-statuses button.active {
  background: var(--surface);
  color: var(--blue-dark);
  box-shadow: inset 0 0 0 1px var(--line);
}

.creator-pilot-outcomes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-pilot-outcomes span {
  flex: 0 0 auto;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.creator-pilot-outcomes button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.creator-pilot-outcomes button.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}

.creator-pilot-fields {
  display: grid;
  grid-template-columns: minmax(90px, 0.45fr) minmax(150px, 1fr);
  gap: 8px;
  min-width: 0;
}

.creator-pilot-fields label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.creator-pilot-fields span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.creator-pilot-fields input,
.creator-pilot-card textarea {
  min-width: 0;
  font-size: 0.84rem;
}

.creator-pilot-card textarea {
  min-height: 58px;
  resize: vertical;
}

.creator-pilot-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.creator-pilot-card-actions span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.creator-pilot-card-actions .secondary-button {
  flex: 0 0 auto;
  width: auto;
  min-height: 34px;
  padding: 0 12px;
}

.creator-test-script-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  min-width: 0;
}

.creator-test-script-progress {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-test-script-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.creator-test-script-progress strong {
  color: var(--ink);
}

.creator-test-script-progress span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.3;
}

.creator-test-script-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--neutral-soft);
}

.creator-test-script-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.creator-test-script-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.creator-test-script-card.passed {
  border-left-color: var(--green);
}

.creator-test-script-card.needs_work {
  border-left-color: var(--amber);
}

.creator-test-script-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.creator-test-script-main span,
.creator-test-script-meta span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.creator-test-script-main strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creator-test-script-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.creator-test-script-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.3;
}

.creator-test-script-card li {
  overflow-wrap: anywhere;
}

.creator-test-script-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-test-script-controls button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.creator-test-script-controls button.active {
  background: var(--surface);
  color: var(--blue-dark);
  box-shadow: inset 0 0 0 1px var(--line);
}

.creator-test-script-card textarea {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  resize: vertical;
  font-size: 0.84rem;
}

.creator-test-script-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-top: 2px;
}

.creator-test-script-meta .secondary-button {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
}

.creator-snapshot-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-snapshot-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.creator-snapshot-actions .primary-button {
  width: auto;
  min-height: 38px;
  padding: 0 16px;
}

.creator-snapshot-actions span {
  min-width: 220px;
  flex: 1 1 320px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.creator-snapshot-output {
  display: grid;
  gap: 6px;
}

.creator-snapshot-output span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.creator-snapshot-output textarea {
  width: 100%;
  min-width: 0;
  min-height: 210px;
  resize: vertical;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre;
}

.creator-run-history {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  min-width: 0;
}

.creator-run-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
}

.creator-run-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.creator-run-main div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.creator-run-main strong,
.creator-run-blockers strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.creator-run-main span,
.creator-run-card p,
.creator-run-blockers span {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.creator-run-main em {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.creator-run-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.creator-run-stats span {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creator-run-stats strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
}

.creator-run-blockers {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-top: 2px;
}

.creator-run-card .secondary-button {
  width: 100%;
  min-height: 34px;
}

.creator-issue-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  min-width: 0;
}

.creator-issue-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: var(--surface);
}

.creator-issue-card.open {
  border-left-color: var(--blue);
}

.creator-issue-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.creator-issue-main div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.creator-issue-main strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.creator-issue-main span,
.creator-issue-card p,
.creator-issue-card small {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.creator-issue-main em {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--amber);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.creator-issue-card.open .creator-issue-main em {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.creator-issue-card .secondary-button {
  width: 100%;
  min-height: 34px;
}

.creator-release-generator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.creator-release-generator div {
  display: grid;
  gap: 3px;
  min-width: 220px;
}

.creator-release-generator strong {
  color: var(--ink);
}

.creator-release-generator span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.creator-release-generator .primary-button {
  width: auto;
  min-height: 38px;
  padding: 0 16px;
}

.creator-release-note {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.creator-release-note.highlight {
  border-left-color: var(--blue);
}

.creator-release-note.warning {
  border-left-color: var(--amber);
}

.creator-release-note.next {
  border-left-color: var(--teal);
}

.creator-release-note strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.creator-release-note span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

@media print {
  @page {
    margin: 0.45in;
  }

  body {
    background: #fff;
    color: #111827;
    font-size: 10.5pt;
  }

  .app-shell,
  .modal,
  .settings-popover {
    display: none !important;
  }

  .print-schedule {
    display: block;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
    border-bottom: 2px solid #111827;
    padding-bottom: 14px;
    margin-bottom: 18px;
  }

  .print-logo {
    width: 170px;
    height: auto;
    display: block;
    margin-bottom: 6px;
  }

  .print-header p,
  .print-header span {
    margin: 0;
    color: #4b5563;
    font-size: 9pt;
  }

  .print-header h1 {
    margin: 2px 0 0;
    color: #111827;
    font-size: 24pt;
    line-height: 1;
  }

  .print-header strong {
    display: block;
    text-align: right;
  }

  .print-schedule table {
    width: 100%;
    border-collapse: collapse;
  }

  .print-schedule th {
    color: #4b5563;
    text-align: left;
    text-transform: uppercase;
    font-size: 8pt;
    border-bottom: 1px solid #9ca3af;
    padding: 8px 7px;
  }

  .print-schedule td {
    vertical-align: top;
    border-bottom: 1px solid #d1d5db;
    padding: 10px 7px;
  }

  .print-schedule td strong,
  .print-schedule td span {
    display: block;
  }

  .print-schedule td span {
    color: #4b5563;
    margin-top: 3px;
    font-size: 9pt;
  }

  .print-schedule tr {
    break-inside: avoid;
  }
}
