:root {
  color-scheme: light;
  --navy-950: #062a4d;
  --navy-900: #07345f;
  --navy-800: #0a4478;
  --navy-100: #eaf1f7;
  --ink: #151a20;
  --muted: #66717f;
  --line: #d9e0e7;
  --line-strong: #bfcbd6;
  --surface: #ffffff;
  --surface-soft: #f5f7f9;
  --surface-blue: #f1f6fa;
  --teal: #0a8585;
  --teal-soft: #e2f4f2;
  --coral: #e85245;
  --coral-soft: #fff0ee;
  --amber: #d98b00;
  --amber-soft: #fff5db;
  --green: #23834a;
  --shadow: 0 12px 34px rgba(10, 31, 51, 0.12);
  --radius: 6px;
  --sidebar-width: 124px;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --navy-950: #dce9f4;
  --navy-900: #1b5e91;
  --navy-800: #5da7dc;
  --navy-100: #203344;
  --ink: #e9eef3;
  --muted: #a2afbb;
  --line: #2d3a45;
  --line-strong: #43515e;
  --surface: #151d24;
  --surface-soft: #0e151b;
  --surface-blue: #182a38;
  --teal: #55b9b5;
  --teal-soft: #173b3b;
  --coral: #ff766a;
  --coral-soft: #3b2424;
  --amber: #f0b448;
  --amber-soft: #3a301d;
  --green: #65c88a;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  background: var(--surface-soft);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--surface-soft);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  height: 90px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  background: var(--navy-900);
  color: #fff;
}

.brand svg {
  width: 30px;
  height: 30px;
}

.brand span {
  font-size: 11px;
  font-weight: 750;
}

.nav-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  padding: 14px 8px 12px;
}

.nav-button,
.mobile-nav-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-button {
  position: relative;
  display: flex;
  min-height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius);
  color: #263544;
  font-size: 12px;
  font-weight: 600;
}

.nav-button::before {
  position: absolute;
  inset: 8px auto 8px -8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: transparent;
  content: "";
}

.nav-button:hover,
.nav-button.active {
  background: var(--navy-100);
  color: var(--navy-900);
}

.nav-button.active::before {
  background: var(--navy-800);
}

.nav-button svg,
.mobile-nav-button svg {
  width: 22px;
  height: 22px;
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  padding: 16px 10px 20px;
  border-top: 1px solid var(--line);
}

.connection-status {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 100%;
  padding: 4px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

.connection-status:hover,
.connection-status:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.connection-status > span:last-child {
  display: grid;
  gap: 1px;
}

.connection-status strong,
.connection-status small {
  display: block;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connection-status strong {
  color: #344352;
  font-size: 10px;
}

.connection-status small {
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}

.connection-dot {
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.connection-status.local .connection-dot {
  background: #c38a21;
}

.connection-status.error .connection-dot {
  background: #c94949;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--navy-800);
  color: var(--navy-800);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.sidebar-footer .icon-button {
  margin: 0 auto;
}

.main-area {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 24px 28px 40px;
}

.topbar {
  display: flex;
  min-height: 62px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.title-block h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.2;
}

.mobile-brand,
.mobile-heading {
  display: none;
}

.title-block p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-add,
.mobile-search {
  display: none;
}

.search {
  position: relative;
  width: min(320px, 26vw);
}

.search svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 19px;
  height: 19px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.search input:focus {
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(10, 68, 120, 0.1);
}

.notification-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -7px;
  right: -5px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--surface-soft);
  border-radius: 10px;
  background: var(--navy-900);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
}

.primary-button,
.secondary-button,
.danger-primary-button,
.ghost-button,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.primary-button {
  padding: 0 17px;
  border: 1px solid var(--navy-900);
  background: var(--navy-900);
  color: #fff;
}

.primary-button:hover {
  background: var(--navy-800);
}

.primary-button:disabled,
.secondary-button:disabled {
  border-color: var(--line);
  background: var(--surface-soft);
  color: #95a0aa;
  cursor: not-allowed;
}

.primary-button svg,
.secondary-button svg,
.danger-primary-button svg,
.ghost-button svg,
.action-button svg {
  width: 17px;
  height: 17px;
}

.secondary-button,
.action-button {
  padding: 0 13px;
  border: 1px solid var(--navy-800);
  background: var(--surface);
  color: var(--navy-900);
}

.secondary-button:hover,
.action-button:hover {
  background: var(--navy-100);
}

.danger-button {
  border-color: #c84b43;
  color: #a52f2a;
}

.danger-button:hover {
  background: var(--coral-soft);
}

.danger-primary-button {
  background: #a52f2a;
  border: 1px solid #a52f2a;
  color: #fff;
  padding: 0 16px;
}

.danger-primary-button:hover {
  background: #86231f;
}

.ghost-button {
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--navy-800);
}

.ghost-button:hover {
  background: var(--surface-blue);
}

.view-content {
  animation: appear 180ms ease-out;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(660px, 1fr) minmax(300px, 390px);
  gap: 16px;
}

.dashboard-grid.single-column {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-stack-hidden {
  display: none;
}

.routine-command {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.website-lead-alert {
  display: grid;
  width: 100%;
  min-height: 64px;
  grid-template-columns: 40px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 11px 16px;
  border: 1px solid #b8cfe2;
  border-radius: var(--radius);
  background: var(--surface-blue);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.website-lead-alert:hover {
  border-color: var(--navy-800);
}

.birthday-dashboard-alert {
  border-color: #b8dfda;
  background: var(--teal-soft);
}

.birthday-dashboard-alert .website-lead-alert-icon {
  background: var(--teal);
}

.website-lead-alert-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-900);
  color: #fff;
}

.website-lead-alert-icon svg,
.website-lead-alert > svg {
  width: 19px;
  height: 19px;
}

.website-lead-alert > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.website-lead-alert strong {
  font-size: 13px;
}

.website-lead-alert small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routine-command-copy,
.routine-command-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.routine-command-action-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.routine-command-action-group .icon-button {
  flex: 0 0 auto;
}

.routine-command-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber);
}

.routine-command-icon svg {
  width: 21px;
  height: 21px;
}

.routine-command h2 {
  margin: 0;
  font-size: 17px;
}

.routine-command p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.completed-action {
  border-color: #9bc9ad;
  background: #f0faf4;
  color: var(--green);
}

.routine-dashboard-summary {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.routine-dashboard-summary > svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  color: var(--teal);
}

.routine-dashboard-summary > div {
  display: grid;
  gap: 2px;
}

.routine-dashboard-summary strong {
  font-size: 11px;
}

.routine-dashboard-summary span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.left-stack,
.right-stack {
  display: grid;
  align-content: start;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

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

.section-header h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.section-header .count-label {
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  display: grid;
  min-width: 300px;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.segmented button {
  height: 36px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: var(--surface);
  color: #53606d;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: var(--navy-900);
  color: #fff;
}

.task-list {
  margin: 0;
  padding: 0 10px;
  list-style: none;
}

.task-filters.full {
  min-width: min(560px, 58vw);
  grid-template-columns: repeat(6, minmax(72px, 1fr));
}

.task-groups {
  display: grid;
}

.task-group + .task-group {
  border-top: 8px solid var(--surface-soft);
}

.task-group-heading {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.task-group-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.task-group-heading span {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

.task-group-overdue .task-group-heading h3 {
  color: var(--coral);
}

.task-row {
  display: grid;
  min-height: 73px;
  grid-template-columns: 34px 38px minmax(250px, 1fr) 114px 120px;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
}

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

.task-row.completed {
  opacity: 0.55;
}

.task-row.completed .task-title {
  text-decoration: line-through;
}

.task-check {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  padding: 0;
  border: 1.5px solid #536576;
  border-radius: 4px;
  background: #fff;
  color: #fff;
  cursor: pointer;
}

.task-check:hover {
  border-color: var(--teal);
}

.task-check.checked {
  border-color: var(--teal);
  background: var(--teal);
}

.task-check svg {
  width: 17px;
  height: 17px;
}

.task-kind {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy-800);
  background: var(--navy-100);
}

.task-kind.urgent {
  color: var(--coral);
  background: var(--coral-soft);
}

.task-kind.success {
  color: var(--teal);
  background: var(--teal-soft);
}

.task-kind.decision {
  color: var(--amber);
  background: var(--amber-soft);
}

.task-kind svg {
  width: 20px;
  height: 20px;
}

.task-copy {
  min-width: 0;
}

.task-title {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-context {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.due {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #556473;
  font-size: 12px;
  font-weight: 700;
}

.due svg {
  width: 16px;
  height: 16px;
}

.due.urgent {
  color: var(--coral);
}

.due.today {
  color: var(--teal);
}

.task-row .action-button {
  min-width: 110px;
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

.empty-list {
  display: grid;
  min-height: 190px;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.empty-list strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.followup-panel {
  padding: 14px 18px 12px;
}

.followup-panel h2 {
  margin: 0 0 13px;
  font-size: 16px;
}

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

.followup-heading h2 {
  margin: 0;
}

.followup-heading .ghost-button {
  min-height: 30px;
  font-size: 12px;
}

.followup-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: start;
}

.followup-track::before {
  position: absolute;
  top: 27px;
  right: 10%;
  left: 10%;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.followup-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 5px;
}

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

.followup-dot {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--navy-800);
  box-shadow: 0 0 0 1px var(--navy-800);
}

.followup-count {
  color: var(--navy-950);
  font-size: 19px;
  font-weight: 750;
}

.dashboard-reminders {
  display: grid;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.dashboard-reminders button {
  display: grid;
  min-height: 44px;
  grid-template-columns: 28px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.dashboard-reminders button:last-child {
  border-bottom: 0;
}

.dashboard-reminders button > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy-800);
  background: var(--surface-blue);
}

.dashboard-reminders button > span svg,
.dashboard-reminders button > svg {
  width: 14px;
  height: 14px;
}

.dashboard-reminders button > div {
  display: grid;
  gap: 2px;
}

.dashboard-reminders strong {
  font-size: 11px;
}

.dashboard-reminders small {
  color: var(--muted);
  font-size: 9px;
}

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

.project-table th,
.project-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}

.project-table th {
  background: var(--surface-soft);
  color: #4b5866;
  font-size: 11px;
  font-weight: 750;
}

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

.project-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
}

.project-name svg {
  width: 17px;
  height: 17px;
  color: var(--navy-800);
}

.project-link {
  display: grid;
  gap: 3px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.project-link small {
  color: var(--muted);
  font-size: 10px;
}

.project-progress {
  display: grid;
  min-width: 112px;
  grid-template-columns: minmax(64px, 1fr) 32px;
  align-items: center;
  gap: 8px;
}

.project-progress > span {
  overflow: hidden;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}

.project-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.project-progress strong {
  font-size: 10px;
  text-align: right;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.status-dot.green {
  background: var(--green);
}

.status-dot.blue {
  background: #2374b7;
}

.status-dot.coral {
  background: var(--coral);
}

.metrics-panel {
  overflow: hidden;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.metric {
  position: relative;
  width: 100%;
  min-height: 94px;
  padding: 18px;
  border-top: 0;
  border-left: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.metric:hover {
  background: var(--surface-blue);
}

.metric:focus-visible {
  z-index: 1;
  outline: 2px solid var(--navy-800);
  outline-offset: -2px;
}

.metric:nth-child(2n) {
  border-right: 0;
}

.metric:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.metric-value {
  color: var(--navy-800);
  font-size: 26px;
  font-weight: 760;
}

.metric.teal .metric-value,
.metric.teal svg {
  color: var(--teal);
}

.metric.amber .metric-value,
.metric.amber svg {
  color: var(--amber);
}

.metric-label {
  margin-top: 3px;
  color: #4e5b68;
  font-size: 13px;
}

.metric > svg {
  position: absolute;
  top: 20px;
  right: 16px;
  width: 23px;
  height: 23px;
  color: #637281;
}

.metric-open {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: grid;
  color: var(--muted);
  opacity: 0;
  transition: opacity 140ms ease;
}

.metric:hover .metric-open,
.metric:focus-visible .metric-open {
  opacity: 1;
}

.metric-open svg {
  width: 16px;
  height: 16px;
}

.approval-list,
.shortcut-list {
  margin: 0;
  padding: 0 12px;
  list-style: none;
}

.approval-row {
  display: grid;
  min-height: 72px;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.approval-row:last-child,
.shortcut-row:last-child {
  border-bottom: 0;
}

.approval-row > svg {
  width: 23px;
  height: 23px;
  color: #5d6c79;
}

.approval-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.approval-row .secondary-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.shortcut-row {
  min-height: 50px;
  border-bottom: 1px solid var(--line);
}

.shortcut-row button {
  display: grid;
  width: 100%;
  height: 50px;
  grid-template-columns: 28px 1fr 18px;
  align-items: center;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--navy-800);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}

.shortcut-row button:hover {
  color: var(--navy-950);
}

.shortcut-row svg {
  width: 19px;
  height: 19px;
}

.page-panel {
  min-height: 610px;
}

.page-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-select {
  height: 38px;
  padding: 0 32px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}

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

.table-list th,
.table-list td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
}

.table-list th {
  background: var(--surface-soft);
  color: #4b5866;
  font-size: 11px;
}

.table-sort-button {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.table-sort-button span {
  min-width: 0;
}

.table-sort-button svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--muted);
}

.table-sort-button:hover,
.table-sort-button.active {
  color: var(--navy-800);
}

.table-sort-button.active svg {
  color: var(--teal-700);
}

.mobile-table-sort {
  display: none;
}

.contact-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #e8f3ee;
  color: #2c7454;
}

.avatar svg {
  width: 18px;
  height: 18px;
}

.avatar.company {
  border-color: #d4e0eb;
  background: #e8eff6;
  color: #315f87;
}

.avatar.couple {
  border-color: #eeddbb;
  background: #fff4df;
  color: #946313;
}

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

.routines-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 16px;
}

.routines-panel {
  grid-column: 1;
}

.followups-table-panel,
.activity-panel {
  grid-column: 1 / -1;
}

.routines-panel .section-header > div,
.followups-table-panel .section-header > div,
.activity-panel .section-header > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.routine-list,
.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.routine-row {
  display: grid;
  min-height: 104px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

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

.routine-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-800);
}

.routine-symbol.done {
  background: var(--teal-soft);
  color: var(--teal);
}

.routine-symbol svg {
  width: 21px;
  height: 21px;
}

.routine-copy {
  min-width: 0;
}

.routine-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.routine-title-line h3 {
  margin: 0;
  font-size: 15px;
}

.routine-state {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.routine-state.active {
  color: var(--green);
}

.routine-copy > p {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.routine-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: #586674;
  font-size: 11px;
}

.routine-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.routine-meta svg {
  width: 13px;
  height: 13px;
}

.routine-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-control {
  position: relative;
  width: 38px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #e7ebef;
  cursor: pointer;
}

.toggle-control span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(10, 31, 51, 0.22);
  transition: transform 160ms ease-out;
}

.toggle-control.on {
  border-color: var(--teal);
  background: var(--teal);
}

.toggle-control.on span {
  transform: translateX(16px);
}

.assist-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}

.assist-label svg {
  width: 15px;
  height: 15px;
}

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

.followup-table .compact-button {
  min-height: 34px;
  white-space: nowrap;
}

.inline-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.inline-state svg {
  width: 15px;
  height: 15px;
}

.activity-row {
  display: grid;
  min-height: 58px;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
}

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

.activity-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-blue);
  color: var(--navy-800);
}

.activity-icon svg {
  width: 15px;
  height: 15px;
}

.activity-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.activity-row strong {
  font-size: 12px;
}

.activity-row div span,
.activity-row time {
  color: var(--muted);
  font-size: 11px;
}

.activity-row time {
  white-space: nowrap;
}

.template-item {
  min-height: 170px;
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.template-item:nth-child(2n) {
  border-right: 0;
}

.template-item h3 {
  margin: 0;
  font-size: 16px;
}

.template-item p {
  display: -webkit-box;
  overflow: hidden;
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.template-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-editor-body {
  min-height: 260px !important;
}

.template-variable-note {
  display: flex;
  min-height: 42px;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  line-height: 1.4;
}

.template-variable-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--teal);
}

.mobile-nav {
  display: none;
}

.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(12, 28, 42, 0.38);
  animation: fade 140ms ease-out;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 70;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.modal-header,
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2,
.drawer-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-header p,
.drawer-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.close-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.close-button:hover {
  background: var(--surface-soft);
}

.close-button svg {
  width: 20px;
  height: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 20px;
}

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #344352;
  font-size: 12px;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.field input,
.field select {
  height: 42px;
  padding: 0 11px;
}

.field textarea {
  min-height: 92px;
  padding: 11px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(10, 68, 120, 0.1);
}

.task-contact-picker {
  position: relative;
  min-width: 0;
}

.task-contact-search-field {
  position: relative;
}

.task-contact-search-field > svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.task-contact-search-field > input {
  width: 100%;
  height: 42px;
  padding-right: 48px;
  padding-left: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.task-contact-search-field > input:focus {
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(10, 68, 120, 0.1);
}

.task-contact-picker.compact .task-contact-search-field > input {
  height: 38px;
}

.task-contact-search-field > input::-webkit-search-cancel-button {
  display: none;
  appearance: none;
}

.task-contact-search-field > .icon-button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
}

.task-contact-search-field > .icon-button[hidden] {
  display: none;
}

.task-contact-results {
  position: absolute;
  z-index: 40;
  top: 48px;
  right: 0;
  left: 0;
  overflow-y: auto;
  max-height: 330px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(14, 35, 56, 0.18);
}

.task-contact-results > button {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.task-contact-results > button:last-child {
  border-bottom: 0;
}

.task-contact-results > button:hover,
.task-contact-results > button.active {
  background: var(--surface-blue);
}

.task-contact-results > button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.task-contact-results strong,
.task-contact-results small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-contact-results strong {
  font-size: 13px;
}

.task-contact-results small {
  color: var(--muted);
  font-size: 10px;
}

.task-contact-results > button > svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.task-contact-empty {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 9px;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

.task-contact-empty svg {
  width: 17px;
  height: 17px;
}

.task-contact-selection {
  display: grid;
  min-height: 48px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
}

.task-contact-selection.selected {
  border-color: #a9dcd6;
  background: var(--teal-soft);
  color: var(--teal);
}

.task-contact-selection > svg {
  width: 18px;
  height: 18px;
}

.task-contact-selection > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.task-contact-selection strong,
.task-contact-selection small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-contact-selection strong {
  color: var(--ink);
  font-size: 12px;
}

.task-contact-selection small {
  color: var(--muted);
  font-size: 10px;
}

.task-contact-picker.compact .task-contact-selection:not(.selected) {
  display: none;
}

.task-contact-picker.compact .task-contact-selection.selected {
  min-height: 38px;
  margin-top: 5px;
  padding: 5px 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.modal-actions.split-actions {
  justify-content: space-between;
}

.modal-actions.split-actions > div {
  display: flex;
  gap: 10px;
}

.contact-check {
  display: flex;
  min-height: 44px;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  cursor: pointer;
}

.contact-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
}

.contact-check span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.delete-warning {
  align-items: start;
  background: var(--coral-soft);
  border: 1px solid #efc0bb;
  border-radius: var(--radius);
  display: grid;
  gap: 13px;
  grid-template-columns: 30px minmax(0, 1fr);
  margin: 20px;
  padding: 15px;
}

.delete-warning > svg {
  color: #a52f2a;
  height: 23px;
  width: 23px;
}

.delete-warning > div {
  display: grid;
  gap: 5px;
}

.delete-warning strong {
  font-size: 13px;
}

.delete-warning span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.confirm-delete-modal form > .field {
  padding: 0 20px 20px;
}

.account-modal {
  width: min(620px, calc(100vw - 32px));
}

.settings-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.settings-shortcuts button {
  display: grid;
  min-height: 68px;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.settings-shortcuts button:hover {
  border-color: var(--navy-800);
}

.settings-shortcuts button > svg:first-child {
  width: 21px;
  color: var(--teal);
}

.settings-shortcuts button > svg:last-child {
  width: 17px;
  color: var(--muted);
}

.settings-shortcuts .team-avatar {
  width: 34px;
  height: 34px;
}

.settings-shortcuts button span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.settings-shortcuts strong {
  font-size: 13px;
}

.settings-shortcuts small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appearance-settings-modal {
  width: min(660px, calc(100vw - 32px));
}

.account-management-modal {
  width: min(760px, calc(100vw - 32px));
}

.managed-account-form {
  border-bottom: 1px solid var(--line);
}

.managed-account-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 20px 18px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-blue);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.managed-account-note svg {
  width: 18px;
  flex: 0 0 auto;
  color: var(--teal);
}

.managed-account-list-section {
  padding: 18px 20px 22px;
}

.managed-account-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.managed-account-list-heading h3 {
  margin: 0;
  font-size: 14px;
}

.managed-account-list-heading span {
  color: var(--muted);
  font-size: 11px;
}

.managed-account-list {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  list-style: none;
}

.managed-account-list li {
  display: grid;
  min-height: 70px;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.managed-account-list li:last-child {
  border-bottom: 0;
}

.managed-account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-blue);
  color: var(--navy-800);
}

.managed-account-avatar svg {
  width: 18px;
}

.managed-account-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.managed-account-copy strong {
  font-size: 12px;
}

.managed-account-copy small,
.managed-account-copy em {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.managed-account-status {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.managed-account-status.active {
  background: var(--teal-soft);
  color: var(--teal);
}

.managed-account-empty {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
}

.managed-account-empty.error {
  border-color: #ecc6c6;
  color: var(--coral);
}

.managed-account-empty svg {
  width: 18px;
}

.appearance-theme-fieldset,
.dashboard-section-fieldset {
  margin: 0;
  padding: 20px;
  border: 0;
}

.appearance-theme-fieldset {
  border-bottom: 1px solid var(--line);
}

.appearance-theme-fieldset legend,
.dashboard-section-fieldset legend {
  padding: 0;
  font-size: 14px;
  font-weight: 800;
}

.dashboard-section-fieldset > p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.appearance-theme-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.appearance-theme-options label {
  position: relative;
  cursor: pointer;
}

.appearance-theme-options input,
.dashboard-section-options input {
  position: absolute;
  opacity: 0;
}

.appearance-theme-options label > span {
  display: grid;
  min-height: 86px;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 2px 9px;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.appearance-theme-options label.selected > span,
.appearance-theme-options input:checked + span {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.appearance-theme-options svg {
  width: 24px;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--teal);
}

.appearance-theme-options strong {
  font-size: 14px;
}

.appearance-theme-options small {
  color: var(--muted);
  font-size: 11px;
}

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

.dashboard-section-options label {
  position: relative;
  display: grid;
  min-height: 62px;
  grid-template-columns: 32px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.dashboard-section-options label > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.dashboard-section-options strong {
  font-size: 12px;
}

.dashboard-section-options small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.dashboard-section-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-blue);
  color: var(--navy-800);
}

.dashboard-section-icon svg {
  width: 17px;
}

.dashboard-section-options i {
  position: relative;
  display: block;
  width: 36px;
  height: 20px;
  background: #cbd3da;
  border-radius: 10px;
}

.dashboard-section-options i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 150ms ease;
}

.dashboard-section-options input:checked + i {
  background: var(--teal);
}

.dashboard-section-options input:checked + i::after {
  transform: translateX(16px);
}

.account-overview {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.account-symbol,
.auth-symbol {
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #e4f3f1;
  color: #197b77;
}

.account-symbol {
  width: 46px;
  height: 46px;
}

.account-symbol svg,
.auth-symbol svg {
  width: 24px;
  height: 24px;
}

.account-overview > div {
  display: grid;
  gap: 3px;
}

.account-overview strong {
  font-size: 15px;
}

.account-overview > div span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  padding: 6px 9px;
  border: 1px solid #b9dcd8;
  border-radius: 999px;
  background: #edf8f6;
  color: #126a66;
  font-size: 11px;
  font-weight: 750;
}

.status-pill.local {
  border-color: #e6d2a7;
  background: #fbf6eb;
  color: #8a6118;
}

.status-pill.error {
  border-color: #ecc6c6;
  background: #fff2f2;
  color: #a63838;
}

.account-details {
  margin: 0;
  padding: 4px 20px;
}

.account-details > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.account-details > div:last-child {
  border-bottom: 0;
}

.account-details dt {
  color: var(--muted);
  font-size: 12px;
}

.account-details dd {
  margin: 0;
  color: #263544;
  font-size: 13px;
  font-weight: 650;
}

.security-note,
.login-notice,
.login-success {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #cbdde8;
  border-radius: var(--radius);
  background: #f3f8fb;
  color: #28495f;
}

.security-note {
  margin: 8px 20px 20px;
  padding: 12px;
}

.security-note.error,
.login-notice.error {
  border-color: #ecc6c6;
  background: #fff3f3;
  color: #963535;
}

.security-note svg,
.login-notice svg,
.login-success svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.security-note span {
  display: grid;
  gap: 3px;
}

.security-note strong {
  font-size: 12px;
}

.security-note small {
  font-size: 11px;
  line-height: 1.45;
}

.auth-shell {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 28px clamp(18px, 4vw, 56px) 20px;
  background:
    linear-gradient(#eaf0f4 1px, transparent 1px),
    linear-gradient(90deg, #eaf0f4 1px, transparent 1px),
    #f7f9fa;
  background-size: 36px 36px;
  color: var(--ink);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy-900);
  font-size: 18px;
  font-weight: 800;
}

.auth-brand svg {
  width: 30px;
  height: 30px;
}

.auth-brand-stacked > span {
  display: grid;
  gap: 2px;
}

.auth-brand-stacked strong {
  font-size: 20px;
  line-height: 1.1;
}

.auth-brand-stacked small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
}

.auth-panel {
  width: min(460px, 100%);
  align-self: center;
  justify-self: center;
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(23, 48, 68, 0.1);
}

.auth-symbol {
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
}

.auth-symbol.warning {
  background: #fff3df;
  color: #a56b14;
}

.auth-copy .eyebrow {
  margin: 0 0 6px;
  color: #197b77;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-copy h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.auth-copy > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.auth-wide-button {
  width: 100%;
  justify-content: center;
  margin-top: 18px;
}

.login-form .auth-wide-button {
  margin-top: 0;
}

.login-code-input {
  min-height: 54px;
  text-align: center;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0;
}

.login-notice,
.login-success {
  margin-top: 18px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
}

.login-success {
  border-color: #b9dcd8;
  background: #edf8f6;
  color: #126a66;
}

.auth-trust {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.auth-trust span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.auth-trust svg {
  width: 15px;
  height: 15px;
  color: #197b77;
}

.auth-footer {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.auth-loading {
  place-items: center;
}

.auth-loading .auth-brand {
  align-self: end;
}

.loading-indicator {
  display: flex;
  align-self: start;
  gap: 6px;
  margin-top: 24px;
}

.loading-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #197b77;
  animation: loading-pulse 900ms ease-in-out infinite alternate;
}

.loading-indicator span:nth-child(2) {
  animation-delay: 180ms;
}

.loading-indicator span:nth-child(3) {
  animation-delay: 360ms;
}

@keyframes loading-pulse {
  to {
    opacity: 0.25;
    transform: translateY(4px);
  }
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 70;
  display: flex;
  width: min(520px, 100vw);
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: slide-in 180ms ease-out;
}

@keyframes slide-in {
  from {
    transform: translateX(24px);
  }
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.routine-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.routine-summary div {
  display: grid;
  gap: 3px;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.routine-summary div:last-child {
  border-right: 0;
}

.routine-summary strong {
  color: var(--navy-800);
  font-size: 22px;
}

.routine-summary span {
  color: var(--muted);
  font-size: 10px;
}

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

.routine-checklist {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.routine-checklist li {
  display: grid;
  min-height: 54px;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 650;
}

.routine-checklist li.done {
  color: var(--muted);
  text-decoration: line-through;
}

.routine-step-check {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: #fff;
  cursor: pointer;
}

.routine-checklist li.done .routine-step-check {
  border-color: var(--teal);
  background: var(--teal);
}

.routine-step-check svg {
  width: 16px;
  height: 16px;
}

.routine-note {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  margin-top: 18px;
  padding: 13px;
  border: 1px solid #b8dfda;
  border-radius: var(--radius);
  background: #f2faf9;
  color: #256d6c;
}

.routine-note > svg {
  width: 20px;
  height: 20px;
}

.routine-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.draft-meta {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.draft-meta-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.draft-meta-row strong {
  color: var(--ink);
}

.draft-content {
  min-height: 280px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.birthday-approval-note {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #b8dfda;
  border-radius: var(--radius);
  background: var(--teal-soft);
}

.birthday-approval-note > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
}

.birthday-approval-note svg {
  width: 19px;
  height: 19px;
}

.birthday-approval-note div {
  display: grid;
  gap: 3px;
}

.birthday-approval-note strong {
  font-size: 13px;
}

.birthday-approval-note small {
  color: var(--muted);
  font-size: 11px;
}

.approval-draft-form {
  display: grid;
  gap: 8px;
}

.approval-draft-form label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.approval-draft-form input,
.approval-draft-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.approval-draft-form input {
  min-height: 44px;
  padding: 10px 12px;
}

.approval-draft-form textarea {
  min-height: 300px;
  padding: 16px;
  line-height: 1.6;
  resize: vertical;
}

.approval-draft-form input:focus,
.approval-draft-form textarea:focus {
  border-color: var(--teal);
  outline: 2px solid rgba(20, 128, 125, 0.12);
  outline-offset: 0;
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.lead-drawer .drawer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lead-drawer .drawer-actions button {
  width: 100%;
}

.lead-drawer .drawer-actions .primary-button {
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  padding: 13px 16px;
  border: 1px solid #afd6c4;
  border-radius: var(--radius);
  background: #f2fbf6;
  box-shadow: var(--shadow);
  color: #176239;
  font-size: 13px;
  font-weight: 700;
}

.toast svg {
  width: 18px;
  height: 18px;
}

.global-tooltip {
  position: fixed;
  z-index: 180;
  max-width: 260px;
  padding: 7px 9px;
  border: 1px solid #1f3f61;
  border-radius: 4px;
  background: var(--navy-900);
  box-shadow: 0 8px 20px rgba(8, 29, 51, 0.18);
  color: #fff;
  font-size: 10px;
  line-height: 1.4;
  pointer-events: none;
}

.global-tooltip[hidden] {
  display: none;
}

.notification-popover {
  position: fixed;
  top: 78px;
  right: 188px;
  z-index: 50;
  width: 320px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notification-popover h3 {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.notification-item {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.notification-settings-link {
  display: flex;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  align-items: center;
  gap: 9px;
  border: 0;
  background: var(--surface-soft);
  color: var(--navy-800);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.notification-settings-link:hover {
  background: var(--surface-blue);
}

.notification-settings-link svg {
  width: 16px;
  height: 16px;
}

.notification-link {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-blue);
  cursor: pointer;
  text-align: left;
}

.notification-link:hover {
  background: var(--navy-100);
}

.search-wrap { position: relative; }
.search-popover {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 55;
  width: min(430px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 110px));
  overflow: hidden;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search-result {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: 34px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--surface-blue); }
.search-result-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--navy-100);
  color: var(--navy-800);
}
.search-result-icon svg,
.search-result > svg { width: 17px; height: 17px; }
.search-result span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.search-result strong,
.search-result small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result strong { font-size: 13px; }
.search-result small { color: var(--muted); font-size: 11px; }
.search-result-type {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}
.search-empty { padding: 18px; color: var(--muted); font-size: 13px; }

.contact-directory-toolbar {
  display: flex;
  min-height: 72px;
  padding: 14px 16px;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.contact-directory-search {
  position: relative;
  display: block;
  width: min(680px, 100%);
}

.contact-directory-search > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  width: 19px;
  height: 19px;
  color: var(--muted);
  transform: translateY(-50%);
}

.contact-directory-search input {
  width: 100%;
  height: 44px;
  padding: 0 48px 0 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: 0;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
}

.contact-directory-search input:focus {
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(10, 68, 120, 0.1);
}

.contact-directory-search .icon-button {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
}

.contact-directory-search .icon-button[hidden] {
  display: none;
}

.contact-directory-toolbar > span {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.selection-bar {
  display: grid;
  grid-template-columns: 38px minmax(220px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f2faf9;
}
.selection-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--teal-soft);
  color: var(--teal);
}
.selection-icon svg { width: 20px; height: 20px; }
.selection-bar label { display: grid; gap: 5px; }
.selection-bar label span { color: #356261; font-size: 11px; font-weight: 750; }
.selection-bar input,
.history-form input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface);
}
.selection-bar input:focus,
.history-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(10, 133, 133, 0.1);
}
.selection-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: #256d6c;
}
.selection-summary svg { width: 17px; height: 17px; }
.selection-summary > div {
  display: grid;
  gap: 2px;
}
.selection-summary strong {
  font-size: 12px;
}
.selection-summary span {
  color: var(--muted);
  font-size: 11px;
}
.selection-summary.invalid {
  color: #9a5b09;
  background: #fff9ec;
}
.selection-presets {
  display: flex;
  padding: 9px 16px;
  flex-wrap: wrap;
  gap: 7px;
  border-bottom: 1px solid var(--line);
}
.selection-presets button {
  min-height: 30px;
  padding: 5px 9px;
  color: #315368;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}
.selection-presets button:hover {
  color: var(--teal);
  border-color: #91c9c4;
  background: var(--teal-soft);
}
.contacts-table th:last-child,
.contacts-table td:last-child { width: 170px; }
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.contact-link > span:last-child { display: grid; gap: 3px; }
.contact-link strong { color: var(--ink); }
.contact-link small { color: var(--muted); font-size: 11px; }
.row-actions { display: flex; align-items: center; gap: 7px; }
.empty-table { padding: 28px; color: var(--muted); text-align: center; }

.dictation-field { position: relative; }
.dictation-field input,
.dictation-field textarea { padding-right: 48px; }
.dictation-button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--navy-800);
  cursor: pointer;
}
.textarea-dictation .dictation-button { top: 6px; }
.dictation-button:hover,
.dictation-button.active { background: var(--coral-soft); color: var(--coral); }
.dictation-button.active { box-shadow: 0 0 0 2px rgba(232, 82, 69, 0.16); }
.dictation-button svg { width: 18px; height: 18px; }
.csv-modal { width: min(760px, calc(100vw - 32px)); }
.csv-preview { overflow-x: auto; padding: 16px 20px; }
.csv-quality-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}
.csv-quality-summary span {
  background: var(--surface-blue);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  display: grid;
  font-size: 10px;
  gap: 2px;
  padding: 10px;
}
.csv-quality-summary strong {
  color: var(--ink);
  font-size: 17px;
}
.csv-preview .table-list { min-width: 600px; border: 1px solid var(--line); }
.preview-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.mobile-search-modal { top: 16px; transform: translateX(-50%); }
.mobile-search-field {
  position: relative;
  margin: 16px;
}
.mobile-search-field > svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 19px;
  height: 19px;
  color: var(--muted);
  transform: translateY(-50%);
}
.mobile-search-field input {
  width: 100%;
  height: 46px;
  padding: 0 12px 0 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
}
.mobile-search-field input:focus {
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(10, 68, 120, 0.1);
}
.mobile-search-results {
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.mobile-more-modal {
  top: auto;
  bottom: 84px;
  transform: translateX(-50%);
}

.mobile-more-list {
  display: grid;
}

.mobile-more-list > button {
  display: grid;
  min-height: 66px;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.mobile-more-list > button:last-child {
  border-bottom: 0;
}

.mobile-more-list > button > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--navy-100);
  color: var(--navy-800);
}

.mobile-more-list svg {
  width: 17px;
  height: 17px;
}

.mobile-more-list > button > div {
  display: grid;
  gap: 3px;
}

.mobile-more-list strong {
  font-size: 12px;
}

.mobile-more-list small {
  color: var(--muted);
  font-size: 10px;
}

.contact-profile { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.avatar.large { width: 52px; height: 52px; }
.avatar.large svg { width: 24px; height: 24px; }
.contact-profile > div { display: grid; gap: 3px; }
.contact-profile > div > strong { font-size: 16px; }
.contact-profile > div > span { color: var(--muted); font-size: 12px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.tag-list span {
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--navy-100);
  color: var(--navy-800);
  font-size: 10px;
  font-weight: 750;
}
.contact-data .draft-meta-row { grid-template-columns: 110px minmax(0, 1fr); }
.contact-data strong { overflow-wrap: anywhere; }
.drawer-section { padding: 19px 0; border-top: 1px solid var(--line); }
.drawer-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.drawer-section-heading h3 { margin: 0; font-size: 15px; }
.drawer-section-heading span,
.section-copy { color: var(--muted); font-size: 11px; }
.section-copy { margin: -5px 0 12px; }
.contract-table {
  min-width: 760px;
  border: 1px solid var(--line);
}
.contract-table th,
.contract-table td {
  padding: 10px;
  vertical-align: top;
}
.contract-product {
  display: grid;
  gap: 3px;
  min-width: 190px;
}
.contract-product small {
  color: var(--muted);
  font-size: 10px;
}
.consultation-modal {
  width: min(820px, calc(100vw - 32px));
}
.consultation-form-grid {
  gap: 14px;
}
.consultation-topic-section {
  gap: 10px;
}
.consultation-topic-heading,
.consultation-card-heading,
.consultation-card-status,
.consultation-card-next,
.consultation-empty {
  display: flex;
  align-items: center;
}
.consultation-topic-heading {
  justify-content: space-between;
  gap: 16px;
}
.consultation-topic-heading > div {
  display: grid;
  gap: 2px;
}
.consultation-topic-heading strong {
  font-size: 13px;
}
.consultation-topic-heading span {
  color: var(--muted);
  font-size: 11px;
}
.consultation-topic-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.consultation-topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.consultation-topic-row:last-child {
  border-bottom: 0;
}
.consultation-topic-row > span {
  display: grid;
  gap: 2px;
}
.consultation-topic-row small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.consultation-topic-row strong {
  font-size: 12px;
}
.consultation-topic-row select {
  width: 100%;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.consultation-guardrail {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #c9dce9;
  border-radius: var(--radius);
  background: #f3f8fb;
  color: #355269;
  font-size: 11px;
  line-height: 1.5;
}
.consultation-guardrail svg {
  width: 19px;
  height: 19px;
  color: var(--navy-800);
}
.consultation-section .drawer-section-heading {
  align-items: center;
}
.consultation-section .drawer-section-heading > div {
  display: grid;
  gap: 2px;
}

.consultation-section-actions {
  display: flex !important;
  grid-auto-flow: column;
  gap: 7px !important;
}
.consultation-history {
  display: grid;
  gap: 10px;
}
.consultation-card {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.advisory-preparation-card {
  border-left: 3px solid var(--teal);
  background: #f7fbfb;
}
.consultation-card-heading {
  gap: 9px;
}
.consultation-card-heading > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.consultation-card-heading strong {
  font-size: 13px;
}
.consultation-card-heading span {
  color: var(--muted);
  font-size: 10px;
}
.consultation-card-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius);
  background: var(--navy-100);
  color: var(--navy-800);
}
.consultation-card-icon svg {
  width: 16px;
  height: 16px;
}
.consultation-card > p {
  margin: 0;
  color: #3e4b58;
  font-size: 12px;
  line-height: 1.5;
}
.consultation-card-status {
  flex-wrap: wrap;
  gap: 6px;
}
.consultation-card-status span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #e8f5ef;
  color: #17674f;
  font-size: 10px;
  font-weight: 750;
}
.consultation-card-status span.attention {
  background: #fff2d7;
  color: #8a5b00;
}
.consultation-card-next {
  align-items: flex-start;
  gap: 7px;
  padding: 8px 9px;
  border-left: 3px solid var(--teal);
  background: #f2faf9;
  font-size: 11px;
}
.consultation-card-next strong {
  flex: 0 0 auto;
}
.consultation-card .secondary-button {
  justify-self: start;
}
.consultation-empty {
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}
.consultation-empty > svg {
  width: 20px;
  height: 20px;
}
.consultation-empty > span {
  display: grid;
  gap: 3px;
}
.consultation-empty strong {
  color: var(--ink);
  font-size: 12px;
}
.consultation-empty small {
  font-size: 11px;
  line-height: 1.45;
}
.history-form {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 15px;
}
.history-form > select {
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
}
.contact-timeline { margin: 0; padding: 0; list-style: none; }
.contact-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 0 0 16px;
}
.contact-timeline li:not(:last-child)::after {
  position: absolute;
  top: 30px;
  bottom: 2px;
  left: 14px;
  width: 1px;
  background: var(--line);
  content: "";
}
.timeline-icon {
  z-index: 1;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--navy-800);
}
.timeline-icon svg { width: 14px; height: 14px; }
.contact-timeline strong { font-size: 12px; }
.contact-timeline p { margin: 3px 0; color: #3e4b58; font-size: 12px; line-height: 1.45; }
.contact-timeline time { color: var(--muted); font-size: 10px; }
.history-entry-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 120ms ease;
}
.contact-timeline li:hover .history-entry-actions,
.history-entry-actions:focus-within { opacity: 1; }
.danger-icon { color: var(--coral); }

@media (hover: none) {
  .history-entry-actions { opacity: 1; }
}

@media (max-width: 640px) {
  .history-form { grid-template-columns: minmax(0, 1fr) auto; }
  .history-form > select { grid-column: 1 / -1; }
}
.claim-checklist,
.file-list { margin: 0 0 14px; padding: 0; list-style: none; }
.claim-checklist li {
  display: grid;
  min-height: 38px;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.claim-checklist button {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
}
.claim-checklist .done button { border-color: var(--teal); background: var(--teal); color: #fff; }
.claim-checklist .done span { color: var(--muted); text-decoration: line-through; }
.claim-checklist svg { width: 14px; height: 14px; }
.dropzone {
  display: grid;
  min-height: 152px;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 16px;
  border: 1.5px dashed #91a8b9;
  border-radius: var(--radius);
  background: var(--surface-blue);
  text-align: center;
  transition: 140ms ease;
}
.dropzone.dragging { border-color: var(--teal); background: var(--teal-soft); }
.dropzone > svg { width: 24px; height: 24px; color: var(--navy-800); }
.dropzone strong { font-size: 12px; }
.dropzone span { color: var(--muted); font-size: 10px; }
.dropzone input { display: none; }
.dropzone .secondary-button { min-height: 34px; margin-top: 4px; padding: 0 10px; font-size: 11px; }
.file-list { margin-top: 12px; }
.file-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.file-list > li > svg { width: 18px; height: 18px; color: var(--navy-800); }
.file-list li > span { display: grid; min-width: 0; gap: 2px; }
.file-list strong,
.file-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list strong { font-size: 11px; }
.file-list small { color: var(--muted); font-size: 10px; }
.file-list .icon-button { width: 34px; height: 34px; }

.workspace-attachment-field {
  gap: 8px;
}

.workspace-attachment-picker {
  display: grid;
  min-height: 64px;
  padding: 11px 13px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--navy-800);
  background: var(--surface-blue);
  border: 1px dashed #9bb5c9;
  border-radius: 5px;
  cursor: pointer;
}

.workspace-attachment-picker:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.workspace-attachment-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.workspace-attachment-picker > span:first-of-type {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.workspace-attachment-picker svg {
  width: 17px;
  height: 17px;
}

.workspace-attachment-picker > span:last-child {
  display: grid;
  gap: 3px;
}

.workspace-attachment-picker strong {
  font-size: 11px;
}

.workspace-attachment-picker small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.workspace-attachment-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 6px;
  list-style: none;
}

.workspace-attachment-list li {
  display: grid;
  min-height: 50px;
  padding: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.workspace-attachment-open {
  display: grid;
  min-width: 0;
  padding: 3px;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.workspace-attachment-open:disabled {
  cursor: default;
}

.workspace-attachment-open > span:first-child {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--navy-800);
  background: var(--navy-100);
  border-radius: 4px;
}

.workspace-attachment-open svg {
  width: 15px;
  height: 15px;
}

.workspace-attachment-open > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.workspace-attachment-open strong,
.workspace-attachment-open small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-attachment-open strong {
  font-size: 11px;
}

.workspace-attachment-open small {
  color: var(--muted);
  font-size: 9px;
}

.drawer-attachment-section {
  display: grid;
  gap: 10px;
}
.local-note {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 9px;
  padding: 10px;
  border: 1px solid #ebce93;
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: #74531b;
  font-size: 10px;
  line-height: 1.45;
}
.local-note svg { width: 18px; height: 18px; }

.planning-layout,
.actions-layout {
  display: grid;
  gap: 16px;
}

.planner-panel,
.goal-panel,
.action-builder,
.campaign-history {
  overflow: hidden;
}

.planner-canvas {
  overflow-x: auto;
}

.week-grid {
  display: grid;
  min-width: 920px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.planner-day {
  min-height: 360px;
  border-right: 1px solid var(--line);
}

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

.planner-day header {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.planner-day header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.planner-day header strong {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
}

.planner-day.today header strong {
  background: var(--navy-900);
  color: #fff;
}

.planner-day-body {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 300px;
  padding: 8px;
}

.planner-entry {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px;
  border: 1px solid #c9d9e5;
  border-radius: var(--radius);
  background: var(--surface-blue);
  cursor: pointer;
  text-align: left;
}

.planner-entry:hover {
  border-color: var(--navy-800);
}

.planner-entry span,
.planner-entry small {
  color: var(--muted);
  font-size: 9px;
}

.planner-entry strong {
  font-size: 11px;
  line-height: 1.35;
}

.planner-empty {
  display: grid;
  width: 100%;
  min-height: 42px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.planner-empty:hover {
  border-color: var(--navy-800);
  color: var(--navy-800);
}

.planner-empty svg {
  width: 16px;
  height: 16px;
}

.month-weekdays,
.month-grid {
  display: grid;
  min-width: 760px;
  grid-template-columns: repeat(7, 1fr);
}

.month-weekdays {
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.month-weekdays span {
  padding: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

.month-day {
  display: grid;
  min-height: 78px;
  align-content: start;
  gap: 5px;
  padding: 9px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.month-day:nth-child(7n) {
  border-right: 0;
}

.month-day:hover {
  background: var(--surface-blue);
}

.month-day.outside {
  background: var(--surface-soft);
  color: #9aa4ae;
}

.month-day > strong {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
}

.month-day.today > strong {
  background: var(--navy-900);
  color: #fff;
}

.month-day span,
.month-day small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-list {
  display: grid;
}

.goal-row {
  display: grid;
  min-height: 76px;
  grid-template-columns: minmax(160px, 0.8fr) minmax(180px, 1.4fr) 150px 84px;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

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

.goal-copy,
.goal-value {
  display: grid;
  gap: 3px;
}

.goal-copy strong,
.goal-value strong {
  font-size: 13px;
}

.goal-copy span,
.goal-value span {
  color: var(--muted);
  font-size: 10px;
}

.goal-progress,
.campaign-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e6ebef;
}

.goal-progress span,
.campaign-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.goal-controls {
  display: flex;
  gap: 6px;
}

.goal-controls .icon-button {
  width: 36px;
  height: 36px;
  font-size: 19px;
}

.goal-controls svg {
  width: 16px;
  height: 16px;
}

.monitoring-off {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.monitoring-off svg {
  width: 22px;
  height: 22px;
}

.actions-layout {
  grid-template-columns: minmax(620px, 1.15fr) minmax(430px, 0.85fr);
  align-items: start;
}

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

.campaign-form .full {
  grid-column: 1 / -1;
}

.campaign-ai-query textarea {
  min-height: 88px;
  resize: vertical;
}

.campaign-ai-query small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.campaign-selection-presets {
  margin: -4px 0 0;
  padding: 0;
  border: 0;
}

.campaign-advanced {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.campaign-advanced summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  color: var(--navy-900);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  list-style: none;
}

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

.campaign-advanced summary svg {
  width: 17px;
  height: 17px;
  color: var(--teal);
}

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

.campaign-product-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 0 14px;
}

.campaign-product-filters fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
}

.campaign-product-filters legend {
  padding: 0 5px;
  color: var(--navy-900);
  font-size: 10px;
  font-weight: 800;
}

.campaign-product-filters label {
  display: grid;
  min-height: 30px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.campaign-product-filters input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
}

.campaign-form-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.campaign-form-actions > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.campaign-form-actions > span svg {
  width: 17px;
  height: 17px;
  color: var(--teal);
}

.campaign-form-actions .secondary-button {
  min-width: 172px;
  white-space: nowrap;
}

.campaign-table td:nth-child(3) {
  white-space: nowrap;
}

.campaign-preview {
  border-top: 1px solid var(--line);
}

.campaign-selection-result {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.campaign-selection-result > div:first-child {
  display: grid;
  gap: 3px;
}

.campaign-selection-result strong {
  font-size: 12px;
}

.campaign-selection-result > div:first-child span {
  color: var(--muted);
  font-size: 9px;
}

.campaign-criteria-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.campaign-criteria-chips span {
  padding: 5px 7px;
  border: 1px solid #c9e6e2;
  border-radius: 4px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
}

.campaign-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: #f2faf9;
}

.campaign-preview-heading > div {
  display: grid;
  gap: 3px;
}

.campaign-preview-heading .campaign-preview-actions {
  display: flex;
  grid-auto-flow: column;
  gap: 8px;
}

.campaign-preview-heading strong {
  font-size: 13px;
}

.campaign-preview-heading span {
  color: var(--muted);
  font-size: 10px;
}

.campaign-preview ul {
  max-height: 248px;
  overflow-y: auto;
  margin: 0;
  padding: 0 18px;
  list-style: none;
}

.campaign-preview li {
  display: grid;
  min-height: 60px;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
}

.campaign-preview li > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.campaign-preview li strong {
  font-size: 12px;
}

.campaign-preview li small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-preview li > svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.campaign-add-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  padding: 14px 18px 0;
}

.campaign-add-contact label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.campaign-add-contact select {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
}

.campaign-preview-empty {
  grid-template-columns: 1fr !important;
}

.tracking-contact-link {
  padding: 0;
  border: 0;
  color: var(--navy-800);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

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

.campaign-preview .local-note {
  margin: 14px 18px 18px;
}

.campaign-table small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.campaign-table .campaign-progress {
  width: 130px;
}

.opportunity-layout {
  display: grid;
  gap: 16px;
}

.lead-layout {
  display: grid;
  gap: 16px;
}

.opportunity-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.opportunity-summary button {
  display: grid;
  min-height: 104px;
  align-content: center;
  gap: 3px;
  padding: 18px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.opportunity-summary button:last-child {
  border-right: 0;
}

.opportunity-summary button:hover,
.opportunity-summary button.active {
  background: var(--surface-blue);
}

.opportunity-summary button.active {
  box-shadow: inset 0 3px 0 var(--navy-800);
}

.opportunity-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.opportunity-summary strong {
  color: var(--navy-900);
  font-size: 26px;
  line-height: 1.15;
}

.opportunity-summary small {
  color: var(--muted);
  font-size: 10px;
}

.opportunity-panel {
  overflow: hidden;
}

.opportunity-header {
  min-height: 72px;
}

.opportunity-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.opportunity-filters button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: #4b5866;
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.opportunity-filters button:hover,
.opportunity-filters button.active {
  border-color: var(--navy-800);
  background: var(--navy-900);
  color: #fff;
}

.opportunity-table th:first-child,
.opportunity-table td:first-child {
  width: 74px;
  text-align: center;
}

.opportunity-table th:last-child,
.opportunity-table td:last-child {
  width: 108px;
}

.lead-table th:first-child,
.lead-table td:first-child {
  width: 240px;
}

.lead-table th:last-child,
.lead-table td:last-child {
  width: 108px;
}

.lead-contact {
  display: flex;
  min-width: 190px;
  align-items: center;
  gap: 9px;
}

.lead-contact > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.lead-contact strong,
.lead-contact small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-topic {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.lead-topic .opportunity-copy {
  overflow-wrap: anywhere;
}

.lead-contact strong {
  font-size: 12px;
}

.lead-contact small,
.lead-date {
  color: var(--muted);
  font-size: 10px;
}

.lead-setup-note {
  display: grid;
  min-height: 180px;
  grid-template-columns: 34px minmax(0, 520px);
  align-content: center;
  justify-content: center;
  gap: 12px;
  padding: 28px;
  color: var(--muted);
}

.lead-setup-note > svg {
  width: 28px;
  height: 28px;
  color: var(--navy-800);
}

.lead-setup-note > div {
  display: grid;
  gap: 5px;
}

.lead-setup-note strong {
  color: var(--ink);
  font-size: 14px;
}

.lead-setup-note span {
  font-size: 12px;
  line-height: 1.5;
}

.opportunity-score {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #b8c8d6;
  border-radius: 50%;
  background: var(--surface-blue);
  color: var(--navy-800);
  font-size: 14px;
  font-weight: 800;
}

.opportunity-score.medium {
  border-color: #e5c474;
  background: var(--amber-soft);
  color: #8a5900;
}

.opportunity-score.high {
  border-color: #efaaa4;
  background: var(--coral-soft);
  color: #a72d24;
}

.opportunity-contact {
  display: flex;
  min-width: 170px;
  align-items: center;
  gap: 9px;
}

.opportunity-contact > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.opportunity-contact strong,
.opportunity-title {
  font-size: 12px;
}

.opportunity-contact small,
.opportunity-copy {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.opportunity-title + .opportunity-copy {
  margin-top: 4px;
  max-width: 270px;
}

.opportunity-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
}

.opportunity-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--navy-800);
}

.opportunity-empty {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
}

.opportunity-empty > svg {
  width: 32px;
  height: 32px;
  color: var(--green);
}

.opportunity-empty > div {
  display: grid;
  gap: 4px;
}

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

.opportunity-empty span {
  font-size: 12px;
}

.opportunity-drawer-score {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.opportunity-drawer-score > div {
  display: grid;
  gap: 3px;
}

.opportunity-drawer-score strong {
  font-size: 13px;
}

.opportunity-drawer-score span:not(.opportunity-score) {
  color: var(--muted);
  font-size: 10px;
}

.opportunity-drawer-section {
  margin-top: 14px;
  padding: 14px;
  border-left: 3px solid var(--coral);
  background: var(--coral-soft);
}

.opportunity-drawer-section.next {
  border-left-color: var(--teal);
  background: var(--teal-soft);
}

.opportunity-drawer-section > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.opportunity-drawer-section h3 {
  margin: 5px 0;
  font-size: 15px;
}

.opportunity-drawer-section p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.opportunity-drawer-section + .local-note {
  margin-top: 14px;
}

.opportunity-summary .metric-alert {
  color: var(--coral);
}

.opportunity-header {
  align-items: center;
}

.opportunity-header .primary-button {
  flex: 0 0 auto;
}

.opportunity-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.opportunity-search {
  display: flex;
  width: min(300px, 100%);
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.opportunity-search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(20, 128, 125, 0.1);
}

.opportunity-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
}

.opportunity-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}

.opportunity-table {
  min-width: 1160px;
}

.opportunity-table th:first-child,
.opportunity-table td:first-child {
  width: 220px;
  text-align: left;
}

.opportunity-table th:nth-child(2),
.opportunity-table td:nth-child(2) {
  width: 210px;
}

.opportunity-table th:nth-child(3),
.opportunity-table td:nth-child(3) {
  width: 86px;
}

.opportunity-table th:nth-child(4),
.opportunity-table td:nth-child(4) {
  width: 96px;
}

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

.opportunity-table th:nth-child(6),
.opportunity-table td:nth-child(6) {
  width: 92px;
}

.opportunity-table th:nth-child(7),
.opportunity-table td:nth-child(7) {
  width: 124px;
}

.opportunity-table th:last-child,
.opportunity-table td:last-child {
  width: 52px;
  text-align: center;
}

.opportunity-table tr.overdue {
  box-shadow: inset 3px 0 0 var(--coral);
}

.opportunity-evidence {
  display: grid;
  grid-template-columns: 16px auto;
  align-items: center;
  justify-content: start;
  column-gap: 5px;
}

.opportunity-evidence svg {
  width: 15px;
  height: 15px;
  color: var(--navy-800);
}

.opportunity-evidence strong {
  font-size: 12px;
}

.opportunity-evidence small {
  grid-column: 1 / -1;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.opportunity-due {
  color: var(--ink);
  font-size: 10px;
  white-space: nowrap;
}

.opportunity-due.late,
.opportunity-next-grid strong.late {
  color: var(--coral);
}

.opportunity-record-drawer {
  width: min(540px, 100vw);
}

.opportunity-record-head,
.opportunity-record-contact {
  display: flex;
  align-items: center;
}

.opportunity-record-head {
  justify-content: space-between;
  gap: 14px;
}

.opportunity-record-contact {
  min-width: 0;
  gap: 10px;
}

.opportunity-record-contact > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.opportunity-record-contact strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-record-contact span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-record-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.opportunity-record-metrics > div {
  display: grid;
  min-height: 68px;
  align-content: center;
  gap: 4px;
  padding: 11px 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.opportunity-record-metrics span,
.opportunity-record-section > span,
.opportunity-next-grid span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.opportunity-record-metrics strong {
  font-size: 13px;
}

.opportunity-commission-detail {
  display: grid;
  min-height: 58px;
  margin-top: 12px;
  padding: 10px 12px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #c9e6e2;
  background: var(--teal-soft);
}

.opportunity-commission-detail > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--teal);
}

.opportunity-commission-detail svg {
  width: 18px;
  height: 18px;
}

.opportunity-commission-detail strong,
.opportunity-commission-detail small {
  display: block;
}

.opportunity-commission-detail strong {
  font-size: 11px;
}

.opportunity-commission-detail small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.opportunity-commission-detail em {
  color: var(--navy-900);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.opportunity-record-section {
  margin-top: 16px;
  padding: 14px;
  border-left: 3px solid var(--teal);
  background: var(--teal-soft);
}

.opportunity-record-section.notes {
  border-left-color: var(--navy-800);
  background: var(--surface-soft);
}

.opportunity-record-section h3 {
  margin: 5px 0;
  font-size: 15px;
}

.opportunity-record-section p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.opportunity-evidence-section,
.opportunity-history-section {
  margin-top: 16px;
}

.opportunity-evidence-list,
.opportunity-question-list,
.opportunity-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.opportunity-evidence-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.45;
}

.opportunity-evidence-list li:last-child {
  border-bottom: 0;
}

.opportunity-evidence-list svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--teal);
}

.opportunity-question-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 8px;
  padding: 6px 0;
  font-size: 11px;
  line-height: 1.45;
}

.opportunity-question-list button {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: #fff;
}

.opportunity-question-list button:not(:disabled) {
  cursor: pointer;
}

.opportunity-question-list button:disabled {
  opacity: 0.65;
}

.opportunity-question-list button svg {
  width: 14px;
  height: 14px;
}

.opportunity-question-list li.done button {
  border-color: var(--teal);
  background: var(--teal);
}

.opportunity-question-list li.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.opportunity-next-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  margin-top: 16px;
  border: 1px solid var(--line);
}

.opportunity-next-grid > div {
  display: grid;
  min-height: 64px;
  align-content: center;
  gap: 5px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.opportunity-next-grid > div:nth-child(2) {
  border-right: 0;
}

.opportunity-next-grid > div:last-child {
  grid-column: 1 / -1;
  border-right: 0;
  border-bottom: 0;
}

.opportunity-next-grid strong {
  font-size: 11px;
  line-height: 1.45;
}

.opportunity-history-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.opportunity-history-list li:last-child {
  border-bottom: 0;
}

.opportunity-history-list strong,
.opportunity-history-list p,
.opportunity-history-list time {
  display: block;
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
}

.opportunity-history-list p,
.opportunity-history-list time {
  color: var(--muted);
}

.opportunity-editor-modal {
  width: min(1040px, calc(100vw - 32px));
}

.opportunity-win-modal {
  width: min(1040px, calc(100vw - 32px));
}

.opportunity-editor-grid textarea {
  min-height: 88px;
}

.opportunity-editor-grid #opportunity-evidence {
  min-height: 108px;
}

.commission-calculation-preview {
  display: grid;
  min-height: 64px;
  padding: 10px 12px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid #c9e6e2;
  background: var(--teal-soft);
}

.commission-calculation-preview > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--teal);
}

.commission-calculation-preview svg {
  width: 20px;
  height: 20px;
}

.commission-calculation-preview small,
.commission-calculation-preview strong,
.commission-calculation-preview em {
  display: block;
}

.commission-calculation-preview small {
  color: var(--muted);
  font-size: 9px;
}

.commission-calculation-preview strong {
  margin-top: 2px;
  font-size: 17px;
}

.commission-calculation-preview em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.commission-positions-section,
.opportunity-reminders-section {
  padding-top: 4px;
}

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

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

.opportunity-subsection-heading h3 {
  font-size: 14px;
}

.opportunity-subsection-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.commission-position-list,
.opportunity-reminder-list {
  display: grid;
  gap: 8px;
}

.commission-position-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.commission-position-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.commission-position-heading strong {
  font-size: 10px;
}

.commission-position-fields {
  display: grid;
  grid-template-columns: minmax(120px, 1.15fr) minmax(150px, 1.25fr) minmax(125px, 1fr) 72px minmax(125px, 1fr);
  gap: 8px;
}

.commission-position-fields .field {
  min-width: 0;
}

.commission-position-fields label {
  min-height: 24px;
  align-content: end;
}

.commission-position-fields input,
.commission-position-fields select {
  min-width: 0;
}

.commission-position-fields input[readonly] {
  background: var(--surface);
  color: var(--navy-900);
  font-weight: 800;
}

.commission-position-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}

.commission-position-meta [data-position-tax-note] {
  color: var(--teal);
  font-weight: 700;
  text-align: right;
}

.commission-total-preview {
  grid-template-columns: 34px minmax(0, 1fr);
}

.commission-total-preview > input {
  display: none;
}

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

.opportunity-reminder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 36px;
  align-items: end;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.opportunity-reminder-row > .icon-button {
  margin-bottom: 1px;
}

.opportunity-reminder-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.opportunity-commission-positions {
  display: block;
  padding: 12px;
}

.opportunity-commission-positions .drawer-section-heading {
  margin-bottom: 4px;
}

.opportunity-commission-positions ul,
.opportunity-reminder-summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.opportunity-commission-positions li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #c9e6e2;
}

.opportunity-commission-positions li:last-child {
  border-bottom: 0;
}

.opportunity-commission-positions li > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--teal);
}

.opportunity-reminder-summary {
  margin-top: 16px;
}

.opportunity-reminder-summary li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.opportunity-reminder-summary li:last-child {
  border-bottom: 0;
}

.opportunity-reminder-summary svg {
  width: 16px;
  height: 16px;
  color: var(--teal);
}

.opportunity-reminder-summary strong,
.opportunity-reminder-summary small {
  display: block;
  font-size: 10px;
}

.opportunity-reminder-summary small {
  margin-top: 2px;
  color: var(--muted);
}

.lead-drawer-contact {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.lead-drawer-contact > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.lead-drawer-contact strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-drawer-contact > div span {
  color: var(--muted);
  font-size: 10px;
}

.lead-upload-note {
  align-items: center;
  background: var(--surface-blue);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: 34px minmax(0, 1fr);
  margin-bottom: 16px;
  padding: 12px 14px;
}

.lead-upload-note > svg {
  color: var(--teal);
  height: 22px;
  width: 22px;
}

.lead-upload-note > div {
  display: grid;
  gap: 3px;
}

.lead-upload-note strong {
  font-size: 12px;
}

.lead-upload-note span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.lead-upload-note.received {
  background: var(--teal-soft);
  border-color: var(--teal);
}

.lead-file-section {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

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

.lead-file-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
}

.lead-file-button:hover {
  border-color: var(--navy);
}

.lead-file-button > svg {
  color: var(--navy);
  height: 19px;
  width: 19px;
}

.lead-file-button > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.lead-file-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-file-button small {
  color: var(--muted);
}

.lead-drawer-section {
  margin: 14px 0;
  padding: 14px;
  border-left: 3px solid var(--navy-800);
  background: var(--surface-blue);
}

.lead-drawer-section > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.lead-drawer-section p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-line;
}

.lead-answer-section {
  margin: 18px 0;
}

.lead-answer-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.lead-answer-section dl {
  margin: 0;
  border-top: 1px solid var(--line);
}

.lead-answer-section dl div {
  display: grid;
  grid-template-columns: minmax(120px, 38%) minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.lead-answer-section dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.lead-answer-section dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.lead-note-form {
  grid-template-columns: 1fr;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.lead-note-form label {
  font-size: 11px;
  font-weight: 750;
}

.lead-note-form textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  color: var(--ink);
}

.lead-note-form textarea:focus {
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(10, 68, 120, 0.1);
}

.lead-note-form .secondary-button {
  justify-self: start;
}

.queue-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.queue-list li {
  display: grid;
  min-height: 68px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.queue-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--navy-100);
  color: var(--navy-800);
}

.queue-icon svg {
  width: 17px;
  height: 17px;
}

.queue-list li > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.queue-list strong,
.queue-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-list strong {
  font-size: 12px;
}

.queue-list small {
  color: var(--muted);
  font-size: 10px;
}

.queue-empty {
  display: block !important;
  padding: 24px 0;
  color: var(--muted);
  text-align: center;
}

.automation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 16px;
}

.automation-overview,
.automation-activity {
  grid-column: 1 / -1;
}

.automation-followups {
  grid-column: 2;
}

.automation-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.automation-stats > div {
  position: relative;
  min-height: 80px;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.automation-stats > div:last-child {
  border-right: 0;
}

.automation-stats strong,
.automation-stats span {
  display: block;
}

.automation-stats strong {
  color: var(--navy-800);
  font-size: 24px;
}

.automation-stats span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.automation-stats svg {
  position: absolute;
  top: 18px;
  right: 16px;
  width: 20px;
  height: 20px;
  color: var(--teal);
}

.automation-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.automation-queue-list {
  max-height: 560px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.automation-queue-row {
  display: grid;
  min-height: 92px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

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

.automation-queue-copy {
  min-width: 0;
}

.automation-queue-copy > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.automation-queue-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-queue-copy p {
  margin: 5px 0 2px;
  color: #405261;
  font-size: 10px;
}

.automation-queue-copy small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-state {
  flex: 0 0 auto;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.run-state.ready {
  border-color: #b9dcd8;
  background: #edf8f6;
  color: #126a66;
}

.run-state.amber {
  border-color: #ead3a4;
  background: #fff8e9;
  color: #845c16;
}

.run-state.blue {
  border-color: #bfd5e8;
  background: #f1f7fb;
  color: #225b82;
}

.run-state.green {
  border-color: #bdddbf;
  background: #f0f8f0;
  color: #37703d;
}

.automation-queue-row .compact-button {
  min-width: 112px;
  justify-content: center;
}

.automation-queue-empty {
  display: grid;
  min-height: 210px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.automation-queue-empty svg {
  width: 28px;
  height: 28px;
  color: var(--teal);
}

.automation-queue-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.automation-queue-empty span {
  font-size: 10px;
}

.automation-row {
  display: grid;
  min-height: 126px;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

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

.automation-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
}

.automation-icon.active {
  background: var(--teal-soft);
  color: var(--teal);
}

.automation-icon svg {
  width: 22px;
  height: 22px;
}

.automation-copy {
  min-width: 0;
}

.automation-copy > div:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
}

.automation-copy h3 {
  margin: 0;
  font-size: 14px;
}

.automation-copy p {
  margin: 6px 0 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.automation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: #4c5b69;
  font-size: 10px;
}

.automation-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.automation-meta svg {
  width: 13px;
  height: 13px;
}

.automation-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.automation-actions .secondary-button {
  min-height: 38px;
  padding: 0 10px;
  font-size: 11px;
}

.automation-actions .secondary-button svg {
  width: 15px;
  height: 15px;
}

.automation-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

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

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

.automation-summary span {
  color: var(--muted);
  font-size: 11px;
}

.automation-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.automation-config > .secondary-button {
  grid-column: 1 / -1;
  justify-self: end;
}

.automation-approval-option {
  display: grid;
  padding: 12px 14px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  background: var(--surface-blue);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.automation-approval-option input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--teal);
}

.automation-approval-option span {
  display: grid;
  gap: 3px;
}

.automation-approval-option strong {
  font-size: 11px;
}

.automation-approval-option small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.automation-preflight-modal {
  width: min(680px, calc(100vw - 32px));
}

.automation-preflight-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.automation-preflight-summary > div {
  display: grid;
  min-width: 0;
  padding: 16px;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  column-gap: 9px;
  border-right: 1px solid var(--line);
}

.automation-preflight-summary > div:last-child {
  border-right: 0;
}

.automation-preflight-summary span {
  display: grid;
  width: 30px;
  height: 30px;
  grid-row: 1 / 3;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 4px;
}

.automation-preflight-summary svg {
  width: 16px;
  height: 16px;
}

.automation-preflight-summary strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-preflight-summary small {
  color: var(--muted);
  font-size: 9px;
}

.automation-preflight-details {
  display: grid;
  margin: 0;
  padding: 6px 20px;
}

.automation-preflight-details > div {
  display: grid;
  min-height: 45px;
  padding: 9px 0;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.automation-preflight-details dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.automation-preflight-details dd {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.automation-preflight-files {
  display: grid;
  padding: 14px 20px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.automation-preflight-files h3 {
  margin: 0;
  font-size: 12px;
}

@media (max-width: 520px) {
  .automation-preflight-modal {
    width: calc(100vw - 16px);
  }

  .automation-preflight-summary {
    grid-template-columns: 1fr;
  }

  .automation-preflight-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .automation-preflight-details > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

/* Dashboard v2 */
.dashboard-v2 {
  display: grid;
  gap: 16px;
}

.dashboard-kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 0.72fr)) minmax(330px, 1.55fr);
  gap: 12px;
}

.dashboard-kpi {
  display: grid;
  min-width: 0;
  min-height: 112px;
  grid-template-columns: 44px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

button.dashboard-kpi {
  cursor: pointer;
}

button.dashboard-kpi:hover {
  border-color: var(--navy-800);
  background: var(--surface-blue);
}

.dashboard-kpi > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #b8dfda;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
}

.dashboard-kpi > span svg {
  width: 21px;
  height: 21px;
}

.dashboard-kpi > svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.dashboard-kpi > div:not(.dashboard-plan-switch) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dashboard-kpi small,
.dashboard-kpi em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.dashboard-kpi strong {
  font-size: 25px;
  font-weight: 780;
}

.dashboard-kpi-commission {
  grid-template-columns: 44px minmax(130px, 1fr) auto;
  align-content: center;
}

.dashboard-plan-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  align-self: start;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.dashboard-plan-switch button {
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.dashboard-plan-switch button:last-child {
  border-right: 0;
}

.dashboard-plan-switch button.active {
  background: var(--navy-900);
  color: #fff;
}

.dashboard-plan-switch button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.dashboard-plan-link {
  display: inline-flex;
  grid-column: 2 / -1;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--navy-800);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.dashboard-plan-link svg {
  width: 14px;
  height: 14px;
}

.dashboard-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.85fr);
  gap: 16px;
}

.dashboard-week-panel,
.dashboard-team-panel,
.dashboard-due-panel,
.dashboard-task-panel,
.dashboard-followup-panel {
  overflow: hidden;
}

.week-navigation {
  display: flex;
  align-items: center;
  gap: 6px;
}

.week-navigation .icon-button {
  width: 34px;
  height: 34px;
}

.dashboard-week-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  border-top: 1px solid var(--line);
}

.dashboard-week-day {
  min-width: 0;
  min-height: 244px;
  border-right: 1px solid var(--line);
}

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

.dashboard-week-day > header {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.dashboard-week-day > header span {
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.dashboard-week-day > header strong {
  font-size: 15px;
}

.dashboard-week-day.today > header {
  background: var(--navy-900);
  color: #fff;
}

.dashboard-week-day > div {
  display: grid;
}

.dashboard-week-day > div > button {
  display: grid;
  min-height: 48px;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.dashboard-week-day > div > button:hover {
  background: var(--surface-blue);
}

.dashboard-week-day button span,
.dashboard-week-day button small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-week-day button strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-week-day .dashboard-week-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.dashboard-week-empty svg {
  width: 14px;
  height: 14px;
}

.dashboard-team-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.dashboard-team-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dashboard-team-actions .ghost-button {
  min-height: 34px;
  padding: 6px 8px;
}

.dashboard-team-actions svg {
  width: 15px;
  height: 15px;
}

.dashboard-team-list > button {
  display: grid;
  min-height: 64px;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.dashboard-team-list > button:last-child {
  border-bottom: 0;
}

.dashboard-team-list > button:hover,
.dashboard-team-list > button.active {
  background: var(--surface-blue);
}

.dashboard-team-list > button.active {
  box-shadow: inset 3px 0 0 var(--teal);
}

.dashboard-team-list > button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dashboard-team-list strong {
  font-size: 11px;
}

.dashboard-team-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-team-list em {
  color: var(--navy-800);
  font-size: 18px;
  font-style: normal;
  font-weight: 780;
  text-align: right;
}

.team-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-800);
  font-weight: 780;
}

.team-avatar.small {
  width: 30px;
  height: 30px;
  font-size: 9px;
}

.team-avatar.medium {
  width: 40px;
  height: 40px;
  font-size: 11px;
}

.team-avatar.large {
  width: 72px;
  height: 72px;
  font-size: 18px;
}

.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-avatar svg {
  width: 16px;
  height: 16px;
}

.dashboard-work-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.82fr) minmax(440px, 1.55fr) minmax(220px, 0.68fr);
  gap: 16px;
  align-items: start;
}

.dashboard-due-list,
.dashboard-followup-periods {
  display: grid;
  border-top: 1px solid var(--line);
}

.dashboard-due-list > button {
  display: grid;
  min-height: 58px;
  grid-template-columns: 34px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.dashboard-due-list > button:hover {
  background: var(--surface-blue);
}

.dashboard-due-list > button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dashboard-due-list strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-due-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-due-list em {
  color: var(--navy-800);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-due-list > button > svg {
  width: 14px;
  height: 14px;
}

.dashboard-due-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-blue);
  color: var(--navy-800);
}

.dashboard-due-icon.birthday {
  background: var(--teal-soft);
  color: var(--teal);
}

.dashboard-due-icon svg {
  width: 15px;
  height: 15px;
}

.dashboard-task-table {
  border-top: 1px solid var(--line);
}

.dashboard-task-head,
.dashboard-task-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(130px, 0.85fr) 72px 92px;
  align-items: center;
  gap: 10px;
}

.dashboard-task-head {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.dashboard-task-row {
  width: 100%;
  min-height: 54px;
  padding: 7px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.dashboard-task-row:hover {
  background: var(--surface-blue);
}

.dashboard-task-row > span:first-child,
.dashboard-task-assignee {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.dashboard-task-row > span:first-child > i {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-blue);
  color: var(--navy-800);
}

.dashboard-task-row i svg {
  width: 14px;
  height: 14px;
}

.dashboard-task-row > span:first-child > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dashboard-task-row strong,
.dashboard-task-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-task-row strong {
  font-size: 10px;
}

.dashboard-task-row small,
.dashboard-task-row > span:nth-child(3) {
  color: var(--muted);
  font-size: 9px;
}

.dashboard-task-assignee .team-avatar {
  width: 26px;
  height: 26px;
}

.task-status-label {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.task-status-label.in_progress {
  border-color: #b8cfe2;
  background: var(--surface-blue);
  color: var(--navy-800);
}

.task-status-label.waiting {
  border-color: #efd8a1;
  background: var(--amber-soft);
  color: #875d10;
}

.dashboard-followup-periods > button {
  display: grid;
  min-height: 48px;
  grid-template-columns: minmax(0, 1fr) 32px 14px;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.dashboard-followup-periods > button:hover {
  background: var(--surface-blue);
}

.dashboard-followup-periods span {
  font-size: 10px;
}

.dashboard-followup-periods strong {
  color: var(--navy-800);
  font-size: 15px;
  text-align: right;
}

.dashboard-followup-periods svg {
  width: 14px;
  height: 14px;
}

.followup-period-modal {
  width: min(780px, calc(100vw - 32px));
}

.followup-period-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 28px;
  list-style: none;
}

.followup-period-list li {
  display: grid;
  min-height: 70px;
  grid-template-columns: 42px minmax(0, 1fr) minmax(150px, auto) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.followup-period-list li > div {
  min-width: 0;
}

.followup-period-list li > div > strong,
.followup-period-list li > div > small {
  display: block;
}

.followup-period-list li > div > small {
  margin-top: 3px;
  color: var(--muted);
}

.followup-period-assignee {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.dashboard-routine-strip > div {
  display: grid;
  min-height: 68px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.dashboard-routine-strip > div > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-blue);
  color: var(--navy-800);
}

.dashboard-routine-strip svg {
  width: 16px;
  height: 16px;
}

.dashboard-routine-strip p {
  display: grid;
  min-width: 0;
  gap: 2px;
  margin: 0;
}

.dashboard-routine-strip p strong {
  font-size: 11px;
}

.dashboard-routine-strip p small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-routine-strip > .dashboard-routine-summary {
  min-height: 58px;
  grid-column: 1 / -1;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  border-color: #b9ded8;
  background: var(--teal-soft);
}

.dashboard-routine-strip > .dashboard-routine-summary > span {
  background: var(--surface);
  color: var(--teal);
}

.dashboard-routine-summary time {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.dashboard-empty-state {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-empty-state svg {
  width: 16px;
  height: 16px;
}

.drawer-assignee {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.routine-meta .team-avatar {
  width: 22px;
  height: 22px;
  font-size: 8px;
}

.team-management-modal {
  width: min(850px, calc(100vw - 32px));
}

.team-member-editor {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 20px;
}

.team-member-photo {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 10px;
}

.team-member-photo label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.team-member-photo input {
  display: none;
}

.team-member-photo label span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--navy-800);
  cursor: pointer;
  font-size: 10px;
}

.team-member-photo label svg {
  width: 14px;
  height: 14px;
}

.team-member-list-section {
  padding: 0 20px 20px;
}

.team-member-list {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  list-style: none;
}

.team-member-list li {
  display: grid;
  min-height: 64px;
  grid-template-columns: 42px minmax(0, 1fr) auto 36px 36px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.team-member-list li:last-child {
  border-bottom: 0;
}

.team-member-list li > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.team-member-list strong {
  font-size: 11px;
}

.team-member-list small,
.team-member-list em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.sidebar-profile-button {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.sidebar-profile-button > span:last-child {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--navy-900);
  color: #fff;
}

.sidebar-profile-button > span:last-child svg {
  width: 10px;
  height: 10px;
}

.business-plan-mode-switch {
  min-width: 230px;
}

@media (max-width: 1240px) {
  .dashboard-kpi-strip {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .dashboard-kpi-commission {
    grid-column: 1 / -1;
  }

  .dashboard-work-grid {
    grid-template-columns: minmax(240px, 0.8fr) minmax(440px, 1.5fr);
  }

  .dashboard-followup-panel {
    grid-column: 1 / -1;
  }

  .dashboard-followup-periods {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-followup-periods > button {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
}

@media (max-width: 980px) {
  .dashboard-command-grid,
  .dashboard-work-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-followup-panel {
    grid-column: auto;
  }

  .dashboard-week-grid {
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
  }

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

  .dashboard-team-list > button {
    border-right: 1px solid var(--line);
  }
}

@media (max-width: 700px) {
  .dashboard-team-actions {
    align-self: stretch;
    justify-content: space-between;
  }

  .followup-period-list {
    padding: 0 16px;
  }

  .followup-period-list li {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    padding: 12px 0;
  }

  .followup-period-assignee {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .followup-period-list li > .secondary-button {
    grid-column: 2 / -1;
    width: 100%;
  }

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

  .dashboard-kpi {
    min-height: 96px;
    grid-template-columns: 34px minmax(0, 1fr) 12px;
    gap: 8px;
    padding: 12px;
  }

  .dashboard-kpi > span {
    width: 34px;
    height: 34px;
  }

  .dashboard-kpi strong {
    font-size: 20px;
  }

  .dashboard-kpi-commission {
    grid-column: 1 / -1;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .dashboard-plan-switch {
    grid-column: 1 / -1;
  }

  .dashboard-plan-link {
    grid-column: 1 / -1;
  }

  .dashboard-team-list,
  .dashboard-followup-periods,
  .dashboard-routine-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-followup-periods > button {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-task-head {
    display: none;
  }

  .dashboard-task-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .dashboard-task-row > span:first-child {
    grid-column: 1 / -1;
  }

  .dashboard-task-assignee strong {
    display: none;
  }

  .team-member-editor {
    grid-template-columns: 1fr;
  }

  .team-member-list li {
    grid-template-columns: 42px minmax(0, 1fr) 34px 34px;
  }

  .team-member-list .managed-account-status {
    display: none;
  }
}

.automation-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.automation-steps li {
  display: grid;
  min-height: 54px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.automation-steps li > span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-800);
  font-size: 10px;
  font-weight: 800;
}

.automation-steps li > div {
  display: grid;
  gap: 3px;
}

.automation-steps strong {
  font-size: 12px;
}

.automation-steps small {
  color: var(--muted);
  font-size: 9px;
}

.automation-run-meta {
  margin-top: 18px;
}

.contact-briefing {
  margin: 0 0 18px;
  border: 1px solid #b8dfda;
  border-radius: var(--radius);
  background: #f2faf9;
}

.briefing-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border-bottom: 1px solid #cde6e2;
  color: #256d6c;
}

.briefing-heading > svg {
  width: 19px;
  height: 19px;
}

.briefing-heading > div {
  display: grid;
  gap: 2px;
}

.briefing-heading strong {
  font-size: 12px;
}

.briefing-heading span {
  font-size: 9px;
}

.contact-briefing dl {
  margin: 0;
}

.contact-briefing dl > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #dbecea;
}

.contact-briefing dl > div:last-child {
  border-bottom: 0;
}

.contact-briefing dt {
  color: #4d7371;
  font-size: 9px;
  font-weight: 750;
}

.contact-briefing dd {
  margin: 0;
  color: #263f3d;
  font-size: 10px;
  line-height: 1.4;
}

.content-studio-layout {
  display: grid;
  gap: 16px;
}

.content-command {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 16px;
}

.content-command-copy,
.content-command-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-command-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
}

.content-command-icon svg {
  width: 22px;
  height: 22px;
}

.content-command h2 {
  margin: 0;
  font-size: 17px;
}

.content-command p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.content-command-actions > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.content-studio-grid {
  display: grid;
  grid-template-columns: minmax(580px, 1.45fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.content-package-status {
  padding: 6px 9px;
  border: 1px solid #b9cfdf;
  border-radius: 4px;
  background: var(--surface-blue);
  color: var(--navy-800);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.content-package-status.planned {
  border-color: #a8ceb6;
  background: #eef8f2;
  color: var(--green);
}

.content-package-summary {
  display: grid;
  grid-template-columns: minmax(170px, 0.75fr) minmax(260px, 1.25fr);
  gap: 16px 24px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-blue);
}

.content-package-summary > div {
  display: grid;
  align-content: start;
  gap: 4px;
}

.content-package-summary span {
  color: var(--muted);
  font-size: 11px;
}

.content-package-summary strong {
  font-size: 13px;
  line-height: 1.45;
}

.content-package-counts {
  grid-column: 1 / -1;
  display: flex !important;
  flex-wrap: wrap;
  gap: 7px !important;
}

.content-package-counts span {
  padding: 4px 7px;
  border: 1px solid #c9d8e4;
  border-radius: 4px;
  background: var(--surface);
  color: #405263;
  font-weight: 650;
}

.content-channel-list {
  padding: 0 14px;
}

.content-channel-row {
  display: grid;
  width: 100%;
  min-height: 84px;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

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

.content-channel-row:hover .content-channel-copy strong {
  color: var(--navy-800);
}

.content-channel-row > svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.content-channel-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-800);
}

.content-channel-icon.newsletter {
  background: var(--teal-soft);
  color: var(--teal);
}

.content-channel-icon.google {
  background: var(--amber-soft);
  color: var(--amber);
}

.content-channel-icon.podcast {
  background: var(--coral-soft);
  color: var(--coral);
}

.content-channel-icon svg {
  width: 20px;
  height: 20px;
}

.content-channel-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.content-channel-copy strong {
  font-size: 13px;
}

.content-channel-copy span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-channel-copy small {
  color: var(--muted);
  font-size: 11px;
}

.content-package-actions {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.content-package-actions > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
}

.content-package-actions > span svg {
  width: 16px;
  height: 16px;
}

.topic-radar form {
  padding: 10px 14px 14px;
}

.topic-list {
  display: grid;
}

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

.topic-option-wrap {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.topic-option-wrap.selected {
  background: var(--surface-soft);
}

.topic-option {
  position: relative;
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 12px 70px 12px 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.topic-option-wrap:not(:has(.topic-option-actions)) .topic-option {
  padding-right: 34px;
}

.topic-option > span {
  color: var(--teal);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.topic-option strong {
  font-size: 13px;
  line-height: 1.35;
}

.topic-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.topic-option i {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  transform: translateY(-50%);
}

.topic-option.selected i {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.topic-option i svg {
  width: 14px;
  height: 14px;
}

.topic-option-wrap:has(.topic-option-actions) .topic-option i {
  right: 38px;
}

.topic-option-actions {
  position: absolute;
  top: 50%;
  right: 0;
  display: flex;
  gap: 3px;
  transform: translateY(-50%);
}

.topic-option-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.topic-option-actions button:hover {
  background: var(--surface);
  color: var(--navy-800);
}

.topic-option-actions button:last-child:hover,
.danger-icon-button:hover {
  color: var(--coral);
}

.topic-option-actions svg {
  width: 14px;
  height: 14px;
}

.compact-editor-modal {
  width: min(720px, calc(100vw - 32px));
}

.compact-editor-modal textarea {
  min-height: 96px;
}

.help-modal {
  width: min(560px, calc(100vw - 32px));
}

.help-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 6px 22px 18px;
  list-style: none;
}

.help-steps li {
  display: grid;
  min-height: 54px;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.help-steps li:last-child {
  border-bottom: 0;
}

.help-steps span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-800);
  font-size: 10px;
  font-weight: 800;
}

.help-steps strong {
  font-size: 12px;
  line-height: 1.4;
}

.content-form-fields {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(170px, 1.3fr);
  gap: 10px;
  padding-top: 14px;
}

.topic-radar-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.topic-radar-actions > span {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.topic-radar-actions > span svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.topic-radar-actions .primary-button {
  width: 100%;
}

.content-empty {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.content-empty svg {
  width: 32px;
  height: 32px;
  color: var(--teal);
}

.content-empty strong {
  color: var(--ink);
  font-size: 15px;
}

.content-empty span {
  max-width: 360px;
  font-size: 12px;
  line-height: 1.5;
}

.connection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.connection-grid > button {
  display: grid;
  min-height: 82px;
  grid-template-columns: 34px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.connection-grid > button:last-child {
  border-right: 0;
}

.connection-grid > button:hover {
  background: var(--surface-blue);
}

.connection-grid > button > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--navy-800);
}

.connection-grid > button > span svg {
  width: 17px;
  height: 17px;
}

.connection-grid > button > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.connection-grid strong {
  font-size: 12px;
}

.connection-grid small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-grid em {
  color: var(--amber);
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
  text-align: right;
}

.connection-grid > button > svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.content-drawer-intro {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.content-drawer-intro > div {
  display: grid;
  gap: 4px;
}

.content-drawer-intro > div strong {
  font-size: 13px;
}

.content-drawer-intro > div span {
  color: var(--muted);
  font-size: 11px;
}

.content-channel-form {
  display: grid;
  gap: 14px;
  padding: 18px 0;
}

.content-channel-form textarea {
  min-height: 290px;
  line-height: 1.55;
  resize: vertical;
}

.advisory-layout {
  display: grid;
  gap: 16px;
}

.advisory-command {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 16px;
}

.advisory-command > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}

.advisory-command-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-800);
}

.advisory-command-icon svg {
  width: 22px;
  height: 22px;
}

.advisory-command h2 {
  margin: 0;
  font-size: 17px;
}

.advisory-command p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.advisory-mode {
  min-width: 260px;
  grid-template-columns: repeat(2, 1fr);
}

.advisory-grid {
  display: grid;
  grid-template-columns: minmax(430px, 0.9fr) minmax(540px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.playbook-library {
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.playbook-search {
  display: grid;
  min-height: 48px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.playbook-search > svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.playbook-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}

.playbook-search span {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.playbook-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 318px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.playbook-tabs > button {
  display: grid;
  min-height: 88px;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: #455463;
  cursor: pointer;
  text-align: left;
}

.playbook-tabs > button:last-child {
  border-right: 0;
}

.playbook-tabs > button:hover,
.playbook-tabs > button.active {
  background: var(--surface-blue);
  color: var(--navy-900);
}

.playbook-tabs > button.active {
  box-shadow: inset 0 -3px 0 var(--navy-800);
}

.playbook-tabs > button > svg {
  width: 22px;
  height: 22px;
}

.playbook-tabs > button > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.playbook-tabs em {
  overflow: hidden;
  color: var(--teal);
  font-size: 8px;
  font-style: normal;
  font-weight: 750;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.playbook-tabs strong {
  font-size: 11px;
}

.playbook-tabs small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.playbook-empty {
  display: grid;
  min-height: 130px;
  grid-column: 1 / -1;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.playbook-empty svg {
  width: 22px;
  height: 22px;
}

.playbook-empty strong {
  color: var(--ink);
  font-size: 12px;
}

.playbook-empty span {
  font-size: 10px;
}

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

.advisory-form .full {
  grid-column: 1 / -1;
}

.advisory-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.advisory-form-actions > span {
  display: inline-flex;
  max-width: 55%;
  align-items: flex-start;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.advisory-form-actions > span svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.advisory-result-summary {
  display: flex;
  min-height: 102px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-blue);
}

.advisory-result-summary > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.advisory-result-summary > div:first-child > span,
.advisory-result-summary small {
  color: var(--muted);
  font-size: 10px;
}

.advisory-result-summary > div:first-child > strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advisory-result-metrics {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.advisory-result-metrics > span {
  display: grid;
  min-width: 74px;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid #c8d8e5;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.advisory-result-metrics strong {
  color: var(--navy-900);
  font-size: 19px;
}

.advisory-opportunity-list {
  padding: 0 14px;
}

.advisory-opportunity-row {
  display: grid;
  width: 100%;
  min-height: 92px;
  grid-template-columns: 28px minmax(0, 1fr) 42px 18px;
  align-items: center;
  gap: 11px;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

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

.advisory-opportunity-row:hover .advisory-opportunity-copy > strong {
  color: var(--navy-800);
}

.advisory-rank {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: #526271;
  font-size: 10px;
  font-weight: 750;
}

.advisory-opportunity-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.advisory-opportunity-copy > strong {
  font-size: 13px;
}

.advisory-opportunity-copy > span {
  display: -webkit-box;
  overflow: hidden;
  color: #4f5d6b;
  font-size: 10px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.advisory-score {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #b9cad8;
  border-radius: 50%;
  background: var(--surface-blue);
  color: var(--navy-800);
  font-size: 12px;
  font-weight: 800;
}

.advisory-score.medium {
  border-color: #e3c68c;
  background: var(--amber-soft);
  color: #9a6500;
}

.advisory-score.high {
  border-color: #e2aaa5;
  background: var(--coral-soft);
  color: #b53b31;
}

.advisory-opportunity-row > svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.advisory-result-actions {
  display: flex;
  min-height: 72px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.advisory-result-actions > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  color: var(--muted);
  font-size: 9px;
}

.advisory-result-actions > span svg {
  width: 15px;
  height: 15px;
}

.advisory-empty {
  display: grid;
  min-height: 520px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.advisory-empty svg {
  width: 34px;
  height: 34px;
  color: var(--navy-800);
}

.advisory-empty strong {
  color: var(--ink);
  font-size: 15px;
}

.advisory-empty span {
  max-width: 320px;
  font-size: 11px;
  line-height: 1.5;
}

.advisory-history-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.advisory-history-list > button {
  display: grid;
  min-height: 72px;
  grid-template-columns: 36px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.advisory-history-list > button:nth-child(2n) {
  border-right: 0;
}

.advisory-history-list > button:hover {
  background: var(--surface-blue);
}

.advisory-history-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-800);
}

.advisory-history-icon svg {
  width: 17px;
  height: 17px;
}

.advisory-history-list > button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.advisory-history-list strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advisory-history-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advisory-history-list em {
  color: var(--teal);
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
}

.advisory-history-list > button > svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.advisory-history-empty {
  padding: 24px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.advisory-drawer-score,
.advisory-briefing-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.advisory-drawer-score > div,
.advisory-briefing-head > div {
  display: grid;
  gap: 4px;
}

.advisory-drawer-score > div strong,
.advisory-briefing-head > div strong {
  font-size: 13px;
}

.advisory-drawer-score > div span,
.advisory-briefing-head > div span {
  color: var(--muted);
  font-size: 10px;
}

.advisory-drawer-section {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  padding: 13px 14px;
  border-left: 3px solid var(--navy-800);
  background: var(--surface-blue);
}

.advisory-drawer-section.risk {
  border-left-color: var(--coral);
  background: var(--coral-soft);
}

.advisory-drawer-section.opener {
  border-left-color: var(--teal);
  background: var(--teal-soft);
}

.advisory-drawer-section > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.advisory-drawer-section p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}

.advisory-product-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.advisory-product-list em {
  padding: 5px 7px;
  border: 1px solid #bed0df;
  border-radius: 4px;
  background: var(--surface);
  color: var(--navy-800);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.advisory-question-list,
.advisory-bullet-list,
.advisory-check-list,
.advisory-briefing-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.advisory-question-list {
  counter-reset: advisory-question;
}

.advisory-question-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.45;
  counter-increment: advisory-question;
}

.advisory-question-list li::before {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-800);
  content: counter(advisory-question);
  font-size: 9px;
  font-weight: 750;
}

.advisory-bullet-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.5;
}

.advisory-check-list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.advisory-check-list svg {
  width: 15px;
  height: 15px;
  color: var(--teal);
}

.advisory-briefing-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.advisory-briefing-list li > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-900);
  color: #fff;
  font-size: 10px;
  font-weight: 750;
}

.advisory-briefing-list li > div {
  display: grid;
  gap: 4px;
}

.advisory-briefing-list strong {
  font-size: 11px;
}

.advisory-briefing-list p {
  margin: 0;
  color: #455361;
  font-size: 10px;
  line-height: 1.45;
}

.advisory-briefing-list small {
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 1120px) {
  .routine-command {
    align-items: flex-start;
  }

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

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

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

  .right-stack .panel {
    min-width: 0;
  }

  .metrics-panel .section-header,
  .right-stack .section-header {
    min-height: 54px;
  }

  .metric {
    padding: 14px;
  }

  .metric svg {
    display: none;
  }

  .search {
    width: 230px;
  }

  .routines-layout {
    grid-template-columns: 1fr;
  }

  .routines-panel,
  .followups-table-panel,
  .activity-panel {
    grid-column: 1;
  }

  .automation-layout {
    grid-template-columns: 1fr;
  }

  .automation-overview,
  .automations-panel,
  .automation-followups,
  .automation-work-queue,
  .automation-activity {
    grid-column: 1;
  }

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

  .content-studio-grid {
    grid-template-columns: 1fr;
  }

  .advisory-grid {
    grid-template-columns: 1fr;
  }

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

  .connection-grid > button:nth-child(2) {
    border-right: 0;
  }

  .connection-grid > button:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .goal-row {
    grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 1.2fr) 130px 84px;
  }
}

@media (max-width: 820px) {
  :root {
    --sidebar-width: 0px;
  }

  body {
    background: var(--surface);
  }

  .sidebar {
    display: none;
  }

  .main-area {
    margin-left: 0;
    padding: 16px 14px 92px;
  }

  .topbar {
    min-height: 54px;
    align-items: center;
    margin-bottom: 14px;
  }

  .title-block h1 {
    font-size: 22px;
  }

  .title-block p {
    font-size: 13px;
  }

  .search,
  .search-wrap,
  .desktop-primary,
  .desktop-quick {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .topbar-actions .icon-button {
    width: 40px;
    height: 40px;
  }

  .mobile-add {
    display: inline-grid;
  }

  .mobile-search {
    display: inline-grid;
  }

  .dashboard-grid {
    gap: 12px;
  }

  .planning-layout,
  .actions-layout,
  .content-studio-grid,
  .advisory-grid,
  .opportunity-layout,
  .lead-layout {
    gap: 12px;
  }

  .planner-panel,
  .goal-panel,
  .action-builder,
  .campaign-history,
  .content-command,
  .content-package,
  .topic-radar,
  .channel-connections,
  .advisory-command,
  .advisory-form-panel,
  .advisory-result-panel,
  .advisory-history {
    border-right: 0;
    border-left: 0;
  }

  .opportunity-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .opportunity-summary button:nth-child(2) {
    border-right: 0;
  }

  .opportunity-summary button:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .opportunity-panel,
  .lead-panel {
    border-right: 0;
    border-left: 0;
  }

  .opportunity-header {
    display: grid;
    height: auto;
    align-items: stretch;
  }

  .opportunity-filters {
    justify-content: flex-start;
  }

  .planner-panel .section-header {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
  }

  .planner-panel .page-toolbar {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .planner-panel .segmented,
  .planner-panel .primary-button {
    width: 100%;
  }

  .week-grid {
    min-width: 820px;
  }

  .goal-row {
    grid-template-columns: minmax(0, 1fr) 120px 76px;
    gap: 10px;
    padding: 12px;
  }

  .goal-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .goal-value {
    justify-self: end;
  }

  .goal-controls {
    justify-self: end;
  }

  .campaign-table .campaign-progress {
    width: 100%;
  }

  .routine-command {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 12px;
  }

  .routine-command-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .routine-command-actions .secondary-button {
    min-width: 0;
    padding: 0 10px;
    font-size: 12px;
  }

  .left-stack,
  .right-stack {
    gap: 12px;
  }

  .right-stack {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tasks-panel {
    border-right: 0;
    border-left: 0;
  }

  .section-header {
    min-height: 56px;
    padding: 10px 12px;
  }

  .section-header h2 {
    font-size: 18px;
  }

  .tasks-panel .section-header {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .tasks-panel .section-header .segmented {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    margin-top: 8px;
  }

  .task-list {
    padding: 0;
  }

  .task-row {
    min-height: 91px;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 4px 10px;
    padding: 13px 12px;
  }

  .task-check {
    grid-row: 1 / 3;
  }

  .task-kind {
    display: none;
  }

  .task-copy {
    align-self: end;
  }

  .task-title {
    font-size: 14px;
    white-space: normal;
  }

  .due {
    grid-column: 2;
    align-self: start;
  }

  .task-row .action-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
    padding: 0;
  }

  .task-row .action-button span {
    display: none;
  }

  .followup-panel,
  .projects-panel,
  .shortcuts-panel {
    display: none;
  }

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

  .metric {
    min-height: 88px;
    padding: 14px 6px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    text-align: center;
  }

  .metric:last-child {
    border-right: 0;
  }

  .metric-value {
    font-size: 23px;
  }

  .metric-label {
    font-size: 11px;
  }

  .approval-row {
    min-height: 72px;
  }

  .page-panel {
    min-height: 0;
    border-right: 0;
    border-left: 0;
  }

  .routines-layout {
    gap: 12px;
  }

  .routine-row {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 13px 12px;
  }

  .automation-row {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 13px 12px;
  }

  .automation-queue-row {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 12px;
  }

  .automation-queue-row .automation-icon {
    width: 38px;
    height: 38px;
  }

  .automation-queue-row .compact-button {
    grid-column: 2;
    min-width: 0;
    justify-self: start;
  }

  .automation-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .automation-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .automation-stats > div:nth-child(2) {
    border-right: 0;
  }

  .automation-stats > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .routine-symbol {
    width: 38px;
    height: 38px;
  }

  .routine-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .routine-meta {
    gap: 6px 12px;
  }

  .assist-label {
    display: none;
  }

  .page-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .selection-bar {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: end;
    padding: 12px;
  }

  .selection-bar .icon-button {
    grid-column: 3;
  }

  .contacts-table tr {
    padding: 12px;
  }

  .contacts-table td::before {
    display: inline-block;
    width: 104px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
  }

  .contacts-table td:first-child::before,
  .contacts-table td:last-child::before {
    display: none;
  }

  .contacts-table td:last-child {
    position: static;
    margin-top: 10px;
  }

  .contacts-table th:last-child,
  .contacts-table td:last-child {
    width: auto;
  }

  .table-list {
    display: block;
  }

  .table-list thead {
    display: none;
  }

  .table-list tbody,
  .table-list tr,
  .table-list td {
    display: block;
  }

  .table-list tr {
    position: relative;
    padding: 12px 52px 12px 12px;
    border-bottom: 1px solid var(--line);
  }

  .table-list td {
    padding: 3px 0;
    border: 0;
  }

  .table-list td:last-child {
    position: absolute;
    top: 18px;
    right: 12px;
  }

  .followup-table tr {
    padding-right: 12px;
  }

  .followup-table td::before {
    display: inline-block;
    width: 82px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
  }

  .followup-table td:last-child {
    position: static;
    margin-top: 8px;
  }

  .followup-table td:last-child::before {
    display: none;
  }

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

  .contract-table tr {
    padding-right: 12px;
  }

  .contract-table td::before {
    display: inline-block;
    width: 76px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
  }

  .contract-table td:last-child {
    position: static;
  }

  .opportunity-table tr,
  .lead-table tr {
    padding-right: 12px;
  }

  .opportunity-table td,
  .lead-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }

  .opportunity-table td::before,
  .lead-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
  }

  .opportunity-table td:first-child,
  .opportunity-table td:last-child,
  .lead-table td:first-child,
  .lead-table td:last-child {
    display: block;
    width: auto;
    text-align: left;
  }

  .opportunity-table td:first-child::before,
  .opportunity-table td:last-child::before,
  .lead-table td:first-child::before,
  .lead-table td:last-child::before {
    display: none;
  }

  .opportunity-table td:last-child,
  .lead-table td:last-child {
    position: static;
    margin-top: 8px;
  }

  .opportunity-table td:last-child .secondary-button,
  .lead-table td:last-child .secondary-button {
    width: 100%;
  }

  .activity-row {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 10px 12px;
  }

  .activity-row time {
    grid-column: 2;
  }

  .project-table {
    display: block;
  }

  .project-table thead {
    display: none;
  }

  .project-table tbody,
  .project-table tr,
  .project-table td {
    display: block;
  }

  .project-table tr {
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }

  .project-table td {
    padding: 4px 0;
    border: 0;
  }

  .project-table td::before {
    display: inline-block;
    width: 112px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
  }

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

  .template-item {
    min-height: 150px;
    border-right: 0;
  }

  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    display: grid;
    height: 72px;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 20px rgba(10, 31, 51, 0.06);
  }

  .mobile-nav-button {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #3d4a58;
    font-size: 10px;
    font-weight: 650;
  }

  .mobile-nav-button.active {
    color: var(--navy-900);
  }

  .mobile-nav-button svg {
    width: 21px;
    height: 21px;
  }

  .notification-popover {
    top: 72px;
    right: 14px;
    left: 14px;
    width: auto;
  }

  .toast {
    right: 14px;
    bottom: 86px;
    left: 14px;
    max-width: none;
  }
}

@media (max-width: 760px) {
  .mobile-table-sort {
    display: flex;
    width: 100%;
    align-items: end;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 12px 4px;
  }

  .mobile-table-sort label {
    display: grid;
    min-width: 0;
    gap: 4px;
  }

  .mobile-table-sort label > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
  }

  .mobile-table-sort select {
    width: min(220px, 66vw);
    height: 38px;
    padding: 0 30px 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font-size: 12px;
  }

  .projects-panel .mobile-table-sort {
    padding-right: 14px;
  }
}

@media (max-width: 520px) {
  .csv-quality-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-area {
    padding: 13px 0 88px;
  }

  .topbar {
    gap: 10px;
    padding: 0 12px;
  }

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

  .mobile-brand {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: var(--radius);
    background: var(--navy-900);
    color: #fff;
  }

  .mobile-brand svg {
    width: 24px;
    height: 24px;
  }

  .desktop-heading {
    display: none;
  }

  .mobile-heading {
    display: block;
  }

  .topbar-actions {
    gap: 4px;
    margin-left: auto;
  }

  .topbar-actions .icon-button {
    width: 36px;
    height: 36px;
  }

  .title-block {
    min-width: 0;
  }

  .view-content > .page-panel,
  .view-content > .routine-command,
  .routines-layout > .panel,
  .dashboard-grid > .left-stack > .panel,
  .dashboard-grid > .right-stack > .panel {
    border-radius: 0;
  }

  .routine-command {
    border-right: 0;
    border-left: 0;
  }

  .routine-command-actions {
    grid-template-columns: 1fr;
  }

  .routine-command-actions .secondary-button {
    width: 100%;
  }

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

  .field.full {
    grid-column: auto;
  }

  .drawer {
    width: 100vw;
  }

  .selection-bar {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .selection-bar > .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .selection-bar .icon-button {
    position: absolute;
    right: 12px;
  }

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

  .history-form .secondary-button {
    width: 100%;
  }

  .consultation-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .consultation-topic-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 10px;
  }

  .consultation-section .drawer-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .consultation-section .drawer-section-heading .primary-button,
  .consultation-section .drawer-section-heading .secondary-button,
  .consultation-card .secondary-button {
    width: 100%;
  }

  .consultation-section-actions {
    width: 100%;
    grid-auto-flow: row;
  }

  .drawer-actions {
    flex-wrap: wrap;
  }

  .drawer-actions .primary-button,
  .drawer-actions .secondary-button {
    flex: 1 1 auto;
  }

  .campaign-form {
    grid-template-columns: 1fr;
    padding: 14px 12px;
  }

  .content-command,
  .content-package-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .content-command-actions {
    justify-content: space-between;
  }

  .content-package-actions .secondary-button,
  .content-package-actions .primary-button {
    width: 100%;
  }

  .content-package-actions > span {
    margin-right: 0;
  }

  .content-package-summary {
    grid-template-columns: 1fr;
  }

  .content-package-counts {
    grid-column: auto;
  }

  .content-channel-row {
    grid-template-columns: 40px minmax(0, 1fr) 18px;
  }

  .content-channel-row .status {
    grid-column: 2;
    justify-self: start;
  }

  .content-channel-row > svg {
    grid-column: 3;
    grid-row: 1;
  }

  .content-form-fields,
  .connection-grid {
    grid-template-columns: 1fr;
  }

  .connection-grid > button,
  .connection-grid > button:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .connection-grid > button:last-child {
    border-bottom: 0;
  }

  .content-channel-form textarea {
    min-height: 230px;
  }

  .advisory-command,
  .advisory-form-actions,
  .advisory-result-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .advisory-mode {
    width: 100%;
    min-width: 0;
  }

  .playbook-tabs,
  .advisory-form,
  .advisory-history-list {
    grid-template-columns: 1fr;
  }

  .playbook-tabs > button {
    min-height: 66px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .playbook-tabs > button.active {
    box-shadow: inset 3px 0 0 var(--navy-800);
  }

  .advisory-form .full,
  .advisory-form-actions {
    grid-column: auto;
  }

  .advisory-form-actions > span {
    max-width: none;
  }

  .advisory-form-actions .primary-button,
  .advisory-result-actions .secondary-button,
  .advisory-result-actions .primary-button {
    width: 100%;
  }

  .advisory-result-metrics {
    width: 100%;
  }

  .advisory-result-metrics > span {
    flex: 1;
  }

  .advisory-opportunity-row {
    grid-template-columns: 26px minmax(0, 1fr) 38px;
  }

  .advisory-opportunity-row > svg {
    display: none;
  }

  .advisory-result-actions > span {
    width: 100%;
    margin-right: 0;
  }

  .advisory-history-list > button {
    border-right: 0;
  }

  .advisory-history-list em {
    display: none;
  }

  .opportunity-summary button {
    min-height: 88px;
    padding: 13px 12px;
  }

  .opportunity-summary strong {
    font-size: 22px;
  }

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

  .opportunity-filters button {
    width: 100%;
  }

  .opportunity-table tr,
  .lead-table tr {
    padding-right: 12px;
  }

  .opportunity-table td,
  .lead-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }

  .opportunity-table td::before,
  .lead-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
  }

  .opportunity-table td:first-child,
  .opportunity-table td:last-child,
  .lead-table td:first-child,
  .lead-table td:last-child {
    display: block;
    width: auto;
    text-align: left;
  }

  .opportunity-table td:first-child::before,
  .opportunity-table td:last-child::before,
  .lead-table td:first-child::before,
  .lead-table td:last-child::before {
    display: none;
  }

  .opportunity-table td:last-child,
  .lead-table td:last-child {
    position: static;
    margin-top: 8px;
  }

  .opportunity-table td:last-child .secondary-button,
  .lead-table td:last-child .secondary-button {
    width: 100%;
  }

  .campaign-form .full,
  .campaign-form-actions {
    grid-column: auto;
  }

  .campaign-form-actions,
  .campaign-preview-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .campaign-form-actions .secondary-button,
  .campaign-preview-heading .primary-button {
    width: 100%;
  }

  .queue-list li {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 10px 0;
  }

  .queue-list li .secondary-button {
    grid-column: 2;
    justify-self: start;
  }

  .automation-config {
    grid-template-columns: 1fr;
  }

  .automation-config > .secondary-button {
    grid-column: auto;
    width: 100%;
  }

  .contact-briefing dl > div {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .auth-shell {
    padding: 18px 12px 14px;
  }

  .auth-brand {
    padding-left: 4px;
  }

  .auth-panel {
    padding: 22px 18px;
  }

  .auth-copy h1 {
    font-size: 24px;
  }

  .account-overview {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .account-symbol {
    width: 42px;
    height: 42px;
  }

  .account-overview .status-pill {
    grid-column: 2;
    justify-self: start;
  }

  .account-details > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.kfz-workflow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
  gap: 16px;
  align-items: start;
}

.kfz-main {
  display: grid;
  gap: 16px;
}

.kfz-side {
  position: sticky;
  top: 20px;
}

.kfz-local-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.kfz-local-note svg,
.kfz-document-hint svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

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

.kfz-upload {
  display: grid;
  min-height: 92px;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-blue);
  cursor: pointer;
}

.kfz-upload:hover {
  border-color: var(--navy-800);
}

.kfz-upload input {
  display: none;
}

.kfz-upload-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--navy-900);
}

.kfz-upload-icon svg,
.kfz-upload > svg {
  width: 21px;
  height: 21px;
}

.kfz-upload > span:nth-child(3) {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.kfz-upload strong {
  font-size: 13px;
}

.kfz-upload small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kfz-upload > svg {
  color: var(--navy-800);
}

.kfz-document-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.kfz-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 8px 18px 4px;
  list-style: none;
}

.kfz-steps li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.kfz-steps li:last-child {
  border-bottom: 0;
}

.kfz-steps li > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-900);
  font-size: 12px;
  font-weight: 800;
}

.kfz-steps li > div {
  display: grid;
  gap: 3px;
}

.kfz-steps strong {
  font-size: 13px;
}

.kfz-steps small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.kfz-action-copy {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  margin: 8px 18px 16px;
  padding: 12px;
  border: 1px solid #b8cfe2;
  border-radius: var(--radius);
  background: var(--surface-blue);
}

.kfz-action-copy > span {
  color: var(--navy-800);
}

.kfz-action-copy svg {
  width: 21px;
  height: 21px;
}

.kfz-action-copy p {
  margin: 0;
  color: #42515f;
  font-size: 11px;
  line-height: 1.5;
}

.kfz-action-copy strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 12px;
}

.kfz-submit {
  width: calc(100% - 36px);
  margin: 0 18px;
}

.kfz-agent-number {
  display: block;
  padding: 10px 18px 16px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

@media (max-width: 1120px) {
  .kfz-workflow {
    grid-template-columns: 1fr;
  }

  .kfz-side {
    position: static;
  }
}

@media (max-width: 820px) {
  .kfz-workflow {
    gap: 12px;
  }

  .kfz-main {
    gap: 12px;
  }
}

@media (max-width: 620px) {
  .kfz-document-grid,
  .kfz-form-grid {
    grid-template-columns: 1fr;
  }

  .kfz-local-note {
    display: none;
  }
}

@media (max-width: 520px) {
  .section-header-actions {
    width: 100%;
  }

  .section-header-actions .secondary-button,
  .routines-panel .section-header .primary-button {
    flex: 1;
  }

  .topic-radar .section-header,
  .routines-panel .section-header,
  .automations-panel .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .routine-actions,
  .automation-actions {
    flex-wrap: wrap;
  }

  .compact-editor-modal,
  .help-modal {
    width: calc(100vw - 16px);
  }

  .kfz-workflow > .kfz-main > .panel,
  .kfz-action-panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .kfz-document-grid,
  .kfz-form-grid {
    padding: 14px 12px;
  }
}

@media (max-width: 1120px) {
  .opportunity-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .opportunity-search {
    width: 100%;
  }

  .opportunity-filters {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .opportunity-header {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .opportunity-table tr.overdue {
    box-shadow: inset 3px 0 0 var(--coral);
  }

  .opportunity-table td:last-child .icon-button {
    width: 100%;
    border: 1px solid var(--line-strong);
  }

  .opportunity-editor-modal {
    width: calc(100vw - 16px);
  }

  .opportunity-win-modal {
    width: calc(100vw - 16px);
  }

  .commission-position-fields {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .position-label-field,
  .position-product-field,
  .position-commission-field {
    grid-column: span 2;
  }

  .opportunity-subsection-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .reminder-preset-actions {
    justify-content: flex-start;
  }

  .opportunity-reminder-row {
    grid-template-columns: minmax(0, 1fr) 36px;
  }

  .opportunity-reminder-row .field:first-of-type {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .opportunity-record-metrics {
    grid-template-columns: 1fr;
  }

  .opportunity-next-grid {
    grid-template-columns: 1fr;
  }

  .opportunity-next-grid > div,
  .opportunity-next-grid > div:nth-child(2) {
    border-right: 0;
  }

  .opportunity-next-grid > div:last-child {
    grid-column: auto;
  }

  .commission-position-fields {
    grid-template-columns: 1fr;
  }

  .position-label-field,
  .position-product-field,
  .position-commission-field {
    grid-column: auto;
  }

  .commission-position-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .commission-position-meta [data-position-tax-note] {
    text-align: left;
  }
}

.notification-settings-modal {
  width: min(760px, calc(100vw - 32px));
}

.push-device-status {
  display: grid;
  margin: 0 20px 18px;
  padding: 16px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: var(--surface-blue);
  border: 1px solid #d5e2ec;
  border-radius: var(--radius);
}

.push-device-status > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--navy-800);
  background: var(--surface);
  border: 1px solid #ccdae5;
  border-radius: 5px;
}

.push-device-status > span svg {
  width: 21px;
  height: 21px;
}

.push-device-status strong,
.push-device-status p {
  display: block;
}

.push-device-status strong {
  font-size: 13px;
}

.push-device-status p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.push-device-status.active {
  background: var(--teal-soft);
  border-color: #b9dfda;
}

.push-device-status.active > span {
  color: var(--teal);
  border-color: #b9dfda;
}

.push-device-status.error {
  background: var(--coral-soft);
  border-color: #f0c0bb;
}

.push-device-status.error > span {
  color: var(--coral);
  border-color: #f0c0bb;
}

.notification-preference-list {
  border-top: 1px solid var(--line);
}

.notification-preference-row {
  position: relative;
  display: grid;
  min-height: 64px;
  padding: 10px 20px;
  grid-template-columns: 34px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.notification-preference-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--navy-800);
  background: var(--navy-100);
  border-radius: 4px;
}

.notification-preference-icon svg {
  width: 17px;
  height: 17px;
}

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

.notification-preference-row strong {
  font-size: 12px;
}

.notification-preference-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.notification-preference-row input {
  position: absolute;
  opacity: 0;
}

.notification-preference-row i {
  position: relative;
  display: block;
  width: 36px;
  height: 20px;
  background: #cbd3da;
  border-radius: 10px;
}

.notification-preference-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  content: "";
  background: #fff;
  border-radius: 50%;
  transition: transform 150ms ease;
}

.notification-preference-row input:checked + i {
  background: var(--teal);
}

.notification-preference-row input:checked + i::after {
  transform: translateX(16px);
}

.notification-time-grid {
  display: grid;
  padding: 16px 20px;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.notification-time-grid label {
  display: grid;
  gap: 6px;
  color: #354250;
  font-size: 10px;
  font-weight: 800;
}

.notification-time-grid input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.notification-compact-options {
  display: flex;
  padding: 0 20px 16px;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.notification-compact-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #354250;
  font-size: 10px;
  font-weight: 700;
}

.notification-compact-options input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

@media (max-width: 520px) {
  .notification-settings-modal {
    width: calc(100vw - 16px);
  }

  .push-device-status {
    margin-right: 12px;
    margin-left: 12px;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .push-device-status > .primary-button,
  .push-device-status > .secondary-button {
    width: 100%;
    grid-column: 1 / -1;
  }

  .notification-preference-row {
    padding-right: 14px;
    padding-left: 14px;
  }

  .notification-time-grid {
    padding-right: 14px;
    padding-left: 14px;
    grid-template-columns: 1fr;
  }

  .notification-compact-options {
    padding-right: 14px;
    padding-left: 14px;
  }
}

.tracking-page {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.tracking-page > *,
.tracking-main-grid > *,
.tracking-lower-grid > * {
  min-width: 0;
}

.tracking-overview {
  overflow: hidden;
}

.tracking-header {
  align-items: center;
}

.tracking-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--line);
}

.tracking-kpi {
  display: grid;
  min-width: 0;
  min-height: 98px;
  padding: 18px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
  border-right: 1px solid var(--line);
}

.tracking-kpi:last-child {
  border-right: 0;
}

.tracking-kpi > span {
  display: grid;
  width: 34px;
  height: 34px;
  grid-row: 1 / span 2;
  place-items: center;
  color: var(--navy-800);
  background: var(--navy-100);
  border-radius: 4px;
}

.tracking-kpi svg {
  width: 18px;
  height: 18px;
}

.tracking-kpi strong,
.tracking-kpi small {
  display: block;
}

.tracking-kpi strong {
  font-size: 25px;
  line-height: 1;
}

.tracking-kpi small {
  margin-top: 5px;
  min-height: 26px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.tracking-kpi em {
  grid-column: 2;
  color: var(--teal);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.tracking-finance-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface);
}

.tracking-finance-strip > div {
  display: grid;
  min-height: 82px;
  padding: 14px 16px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-content: center;
  gap: 3px 10px;
  border-right: 1px solid var(--line);
}

.tracking-finance-strip > div:last-child {
  border-right: 0;
}

.tracking-finance-strip span {
  display: grid;
  width: 28px;
  height: 28px;
  grid-row: 1 / span 2;
  place-items: center;
  color: var(--teal);
}

.tracking-finance-strip svg {
  width: 17px;
  height: 17px;
}

.tracking-finance-strip strong,
.tracking-finance-strip small {
  display: block;
  min-width: 0;
}

.tracking-finance-strip strong {
  font-size: 18px;
}

.tracking-finance-strip small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracking-main-grid,
.tracking-lower-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.8fr);
}

.tracking-lower-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.tracking-funnel,
.tracking-goals,
.tracking-insights {
  padding: 4px 18px 18px;
}

.funnel-row {
  display: grid;
  min-height: 68px;
  grid-template-columns: 34px minmax(155px, 0.9fr) minmax(130px, 1.4fr) 42px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

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

.funnel-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--navy-800);
  background: var(--surface-blue);
  border-radius: 4px;
}

.funnel-icon svg {
  width: 17px;
  height: 17px;
}

.funnel-copy {
  min-width: 0;
}

.funnel-copy strong,
.funnel-copy span {
  display: block;
}

.funnel-copy strong {
  font-size: 12px;
}

.funnel-copy span {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnel-track,
.tracking-goal-bar {
  height: 7px;
  overflow: hidden;
  background: #e9eef2;
  border-radius: 2px;
}

.funnel-track span,
.tracking-goal-bar span {
  display: block;
  height: 100%;
  background: var(--navy-800);
  border-radius: inherit;
}

.funnel-row:nth-child(n + 4) .funnel-track span {
  background: var(--teal);
}

.funnel-value {
  color: var(--navy-900);
  font-size: 18px;
  text-align: right;
}

.tracking-goal-row {
  display: grid;
  min-height: 66px;
  padding: 10px 0;
  grid-template-columns: minmax(100px, 1fr) 72px;
  align-items: center;
  gap: 8px 12px;
  border-bottom: 1px solid var(--line);
}

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

.tracking-goal-row > div:first-child {
  min-width: 0;
}

.tracking-goal-row strong,
.tracking-goal-row span {
  display: block;
}

.tracking-goal-row strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracking-goal-row span,
.tracking-goal-row em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.tracking-goal-row em {
  text-align: right;
}

.tracking-goal-bar {
  grid-column: 1 / -1;
}

.tracking-entry-form {
  display: grid;
  padding: 4px 18px 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tracking-entry-form label,
.tracking-custom-metric label {
  display: grid;
  gap: 6px;
  color: #354250;
  font-size: 10px;
  font-weight: 800;
}

.tracking-entry-form input,
.tracking-entry-form select,
.tracking-metric-editor-row input,
.tracking-custom-metric input {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 0 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: 0;
}

.tracking-entry-form input:focus,
.tracking-entry-form select:focus,
.tracking-metric-editor-row input:focus,
.tracking-custom-metric input:focus {
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(10, 68, 120, 0.1);
}

.tracking-entry-form .task-contact-search-field > input {
  height: 40px;
  padding-right: 48px;
  padding-left: 40px;
}

.tracking-note {
  grid-column: span 2;
}

.tracking-entry-form .primary-button {
  align-self: end;
}

.tracking-auto-note {
  display: flex;
  padding: 12px 18px;
  align-items: center;
  gap: 9px;
  color: #45606a;
  background: var(--teal-soft);
  border-top: 1px solid #c9e6e2;
  font-size: 10px;
  line-height: 1.45;
}

.tracking-auto-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--teal);
}

.tracking-insights {
  display: grid;
  gap: 0;
}

.tracking-insights > div {
  display: grid;
  min-height: 58px;
  padding: 12px 0;
  grid-template-columns: 26px 1fr;
  align-items: start;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.tracking-insights span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--navy-800);
  background: var(--navy-100);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
}

.tracking-insights p {
  margin: 1px 0 0;
  color: #3f4b57;
  font-size: 10px;
  line-height: 1.55;
}

.tracking-week-chart {
  display: grid;
  height: 132px;
  padding: 12px 18px 14px;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 7px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}

.tracking-week-chart > div {
  display: grid;
  height: 100%;
  grid-template-rows: minmax(0, 1fr) 14px 14px;
  align-items: end;
  text-align: center;
}

.tracking-week-chart > div > span {
  display: block;
  width: 72%;
  max-width: 24px;
  min-height: 3px;
  margin: 0 auto;
  background: var(--navy-800);
  border-radius: 2px 2px 0 0;
}

.tracking-week-chart strong {
  color: var(--ink);
  font-size: 9px;
}

.tracking-week-chart small {
  color: var(--muted);
  font-size: 8px;
}

.tracking-table {
  min-width: 760px;
}

.tracking-log-panel {
  overflow: hidden;
}

.tracking-log-panel .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.tracking-table td:first-child,
.tracking-table td:nth-child(3) {
  white-space: nowrap;
}

.tracking-empty {
  display: grid;
  padding: 28px;
  gap: 4px;
  color: var(--muted);
  text-align: center;
}

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

.business-plan-page {
  display: grid;
  gap: 16px;
}

.business-plan-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 2px 2px;
}

.business-plan-hero > div:first-child {
  display: grid;
  gap: 5px;
}

.business-plan-kicker {
  color: var(--teal-700);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.business-plan-hero h2 {
  margin: 0;
  font-size: 24px;
}

.business-plan-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.business-plan-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.business-plan-summary {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.business-plan-summary > div {
  display: grid;
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
}

.business-plan-summary > div:last-child {
  border-right: 0;
}

.business-plan-summary svg {
  width: 20px;
  height: 20px;
  grid-row: 1 / 3;
  color: var(--teal-700);
}

.business-plan-summary strong {
  overflow-wrap: anywhere;
  font-size: 20px;
}

.business-plan-summary small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.business-plan-main-panel,
.business-plan-special-panel,
.business-plan-history-panel {
  overflow: hidden;
}

.business-plan-joker {
  display: grid;
  gap: 4px;
}

.business-plan-joker > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.business-plan-joker select {
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.business-plan-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.business-plan-category {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.business-plan-category:nth-child(2n) {
  border-right: 0;
}

.business-plan-category-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.business-plan-category-heading > div {
  display: grid;
  gap: 2px;
}

.business-plan-category-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.business-plan-category-heading strong {
  font-size: 19px;
}

.business-plan-stage {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.business-plan-stage.reached {
  border-color: #9acfc7;
  background: #edf9f7;
  color: #14786f;
}

.business-plan-delta {
  width: fit-content;
  font-size: 10px;
  font-weight: 700;
}

.business-plan-delta.positive {
  color: #187447;
}

.business-plan-delta.negative {
  color: #b43b3b;
}

.business-plan-delta.neutral {
  color: var(--muted);
}

.business-plan-progress {
  overflow: hidden;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-soft);
}

.business-plan-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal-600);
}

.business-plan-category-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.business-plan-category-meta > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.business-plan-category-meta small {
  color: var(--muted);
  font-size: 9px;
}

.business-plan-category-meta strong {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.business-plan-cap-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 13px 18px;
  background: #fff8e8;
  color: #755018;
  font-size: 11px;
  line-height: 1.45;
}

.business-plan-cap-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.business-plan-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.business-plan-next-list,
.business-plan-quality-list {
  display: grid;
}

.business-plan-next-list > div,
.business-plan-quality-list > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
}

.business-plan-next-list > div > span {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--navy-800);
  font-size: 10px;
  font-weight: 800;
}

.business-plan-next-list p,
.business-plan-quality-list p {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
  margin: 0;
}

.business-plan-next-list strong,
.business-plan-quality-list strong {
  font-size: 12px;
}

.business-plan-next-list small,
.business-plan-quality-list small {
  color: var(--muted);
  font-size: 10px;
}

.business-plan-next-list em,
.business-plan-quality-list em {
  flex: 0 0 auto;
  color: var(--navy-800);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.business-plan-quality-list > div > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
}

.business-plan-quality-list svg {
  width: 15px;
  height: 15px;
}

.business-plan-quality-list .good > span {
  background: #e8f6ee;
  color: #167045;
}

.business-plan-quality-list .warning > span {
  background: #fff4d8;
  color: #926111;
}

.business-plan-quality-list .critical > span {
  background: #fdeaea;
  color: #b43b3b;
}

.business-plan-quality-list .critical em {
  color: #b43b3b;
}

.business-plan-special-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.business-plan-stock-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.business-plan-stock-grid > div {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 15px 16px;
  border-right: 1px solid var(--line);
}

.business-plan-stock-grid > div:last-child {
  border-right: 0;
}

.business-plan-stock-grid span,
.business-plan-stock-grid small {
  color: var(--muted);
  font-size: 10px;
}

.business-plan-stock-grid strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.business-plan-stock-grid em {
  position: absolute;
  top: 15px;
  right: 16px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.business-plan-stock-grid em.positive {
  color: #187447;
}

.business-plan-stock-grid em.negative {
  color: #b43b3b;
}

.business-plan-special-grid > div {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 15px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.business-plan-special-grid > div:nth-child(3n) {
  border-right: 0;
}

.business-plan-special-grid > div > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.business-plan-special-grid > div > strong {
  font-size: 16px;
}

.business-plan-special-grid > div > small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.business-plan-history-panel .table-list {
  min-width: 860px;
}

.business-plan-source-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  color: var(--muted);
  font-size: 10px;
}

.business-plan-source-note svg {
  width: 15px;
  height: 15px;
}

.commission-control-panel {
  overflow: hidden;
}

.commission-control-empty {
  display: grid;
  min-height: 150px;
  align-items: center;
  gap: 18px;
  padding: 24px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
}

.commission-control-empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--teal-100);
  color: var(--teal-700);
}

.commission-control-empty-icon svg {
  width: 22px;
  height: 22px;
}

.commission-control-empty h2,
.commission-control-heading h2 {
  margin: 2px 0 4px;
  font-size: 18px;
}

.commission-control-empty p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.commission-control-heading {
  align-items: center;
}

.commission-control-summary {
  display: grid;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.commission-control-summary > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.commission-control-summary > div:last-child {
  border-right: 0;
}

.commission-control-summary span,
.commission-control-summary small {
  color: var(--muted);
  font-size: 10px;
}

.commission-control-summary strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.commission-control-summary .attention strong {
  color: #b43b3b;
}

.commission-control-summary .balanced strong {
  color: #167045;
}

.commission-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
}

.commission-anomaly-section,
.commission-category-section {
  min-width: 0;
}

.commission-anomaly-section {
  border-right: 1px solid var(--line);
}

.commission-anomaly-section .drawer-section-heading,
.commission-category-section .drawer-section-heading,
.commission-history .drawer-section-heading {
  padding: 14px 18px;
}

.commission-anomaly-list {
  display: grid;
}

.commission-anomaly-list article {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  grid-template-columns: 30px minmax(0, 1fr) auto;
}

.commission-anomaly-list article.ok {
  background: #f4faf6;
}

.commission-anomaly-list article.question {
  background: #fff9ea;
}

.commission-anomaly-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #fff1e7;
  color: #a34c1d;
}

.commission-anomaly-list article.high .commission-anomaly-icon {
  background: #fdeaea;
  color: #b43b3b;
}

.commission-anomaly-list article.ok .commission-anomaly-icon {
  background: #e8f6ee;
  color: #167045;
}

.commission-anomaly-icon svg {
  width: 14px;
  height: 14px;
}

.commission-anomaly-list article > div:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.commission-anomaly-list article > div:nth-child(2) strong {
  font-size: 11px;
}

.commission-anomaly-list article > div:nth-child(2) small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.commission-review-actions {
  display: flex;
  gap: 5px;
}

.commission-review-actions button {
  display: inline-flex;
  height: 30px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--navy-800);
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.commission-review-actions button.active {
  border-color: var(--navy-800);
  background: var(--navy-800);
  color: #fff;
}

.commission-review-actions svg {
  width: 13px;
  height: 13px;
}

.commission-control-clear {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px;
  border-top: 1px solid var(--line);
  color: #167045;
  font-size: 11px;
  font-weight: 700;
}

.commission-control-clear svg {
  width: 16px;
  height: 16px;
}

.commission-category-list {
  display: grid;
}

.commission-category-list > div {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 18px;
  border-top: 1px solid var(--line);
}

.commission-category-list span {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
}

.commission-category-list strong {
  flex: 0 0 auto;
  font-size: 10px;
}

.commission-category-list strong.negative {
  color: #b43b3b;
}

.commission-under-earnings {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  background: #fff8e8;
  color: #755018;
  font-size: 10px;
}

.commission-under-earnings svg {
  width: 14px;
  height: 14px;
}

.commission-category-section .workspace-attachment-list,
.commission-category-section .local-note {
  margin: 12px 18px;
}

.commission-history {
  border-top: 1px solid var(--line);
}

.commission-history > div:not(.drawer-section-heading) {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr) auto 34px;
}

.commission-history > div > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.commission-history > div > span strong {
  font-size: 11px;
}

.commission-history > div > span small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annual-check-plan-modal {
  width: min(720px, calc(100vw - 32px));
}

.annual-workflow-panel {
  overflow: hidden;
}

.annual-workflow-stats {
  display: grid;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.annual-workflow-stats > div {
  display: grid;
  gap: 3px;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.annual-workflow-stats > div:last-child {
  border-right: 0;
}

.annual-workflow-stats strong {
  color: var(--navy-900);
  font-size: 22px;
}

.annual-workflow-stats span {
  color: var(--muted);
  font-size: 10px;
}

.annual-workflow-list {
  display: grid;
}

.annual-workflow-list article {
  display: grid;
  min-height: 66px;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.annual-workflow-list article:last-child {
  border-bottom: 0;
}

.annual-workflow-list article > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.annual-workflow-list article strong,
.annual-workflow-list article small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annual-workflow-list article strong {
  font-size: 12px;
}

.annual-workflow-list article small {
  color: var(--muted);
  font-size: 10px;
}

.annual-workflow-state {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.annual-workflow-state.amber {
  background: #fff2d6;
  color: #8a5d00;
}

.annual-workflow-state.blue {
  background: var(--navy-100);
  color: var(--navy-800);
}

.annual-workflow-state.green,
.annual-workflow-state.ready {
  background: var(--teal-soft);
  color: var(--teal);
}

.annual-workflow-empty {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.annual-workflow-empty svg {
  width: 18px;
}

.annual-check-plan-summary {
  display: grid;
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.annual-check-plan-summary > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.annual-check-plan-summary > div:last-child {
  border-right: 0;
}

.annual-check-plan-summary strong {
  font-size: 19px;
}

.annual-check-plan-summary span {
  color: var(--muted);
  font-size: 9px;
}

.annual-check-plan-modal form > .form-grid {
  padding: 18px;
}

.dispatch-documentation-modal {
  width: min(720px, calc(100vw - 32px));
}

.dispatch-document-preview {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.dispatch-document-preview > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--teal-soft);
  color: var(--teal);
}

.dispatch-document-preview svg {
  width: 20px;
}

.dispatch-document-preview div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dispatch-document-preview strong,
.dispatch-document-preview small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-document-preview small {
  color: var(--muted);
  font-size: 10px;
}

.dispatch-documentation-modal form > .form-grid {
  padding: 18px 20px;
}

.system-status-modal {
  width: min(820px, calc(100vw - 32px));
}

.system-status-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
  border-bottom: 1px solid var(--line);
}

.system-status-primary {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.system-status-primary > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--teal-soft);
  color: var(--teal);
}

.system-status-primary.local > span {
  background: #fff2d6;
  color: #8a5d00;
}

.system-status-primary.error > span {
  background: #fff0f0;
  color: var(--coral);
}

.system-status-primary svg {
  width: 21px;
}

.system-status-primary > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.system-status-primary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-status-summary dl {
  display: grid;
  margin: 0;
}

.system-status-summary dl > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.system-status-summary dl > div:last-child {
  border-bottom: 0;
}

.system-status-summary dt {
  color: var(--muted);
}

.system-status-summary dd {
  margin: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-data-counts,
.backup-restore-summary {
  display: grid;
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.system-data-counts > div,
.backup-restore-summary > div {
  display: grid;
  gap: 2px;
  padding: 12px 18px;
  border-right: 1px solid var(--line);
}

.system-data-counts > div:last-child,
.backup-restore-summary > div:last-child {
  border-right: 0;
}

.system-data-counts strong,
.backup-restore-summary strong {
  font-size: 18px;
}

.system-data-counts span,
.backup-restore-summary span {
  color: var(--muted);
  font-size: 9px;
}

.system-status-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.system-status-actions button {
  display: grid;
  min-height: 64px;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.system-status-actions button:hover:not(:disabled) {
  border-color: var(--navy-800);
}

.system-status-actions button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.system-status-actions button > svg {
  width: 20px;
  color: var(--teal);
}

.system-status-actions button span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.system-status-actions button strong {
  font-size: 11px;
}

.system-status-actions button small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-audit-section {
  border-bottom: 1px solid var(--line);
}

.system-audit-section .drawer-section-heading > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.system-audit-section .drawer-section-heading svg {
  width: 16px;
  height: 16px;
}

.system-audit-list {
  max-height: 260px;
  overflow: auto;
}

.system-audit-list article {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 126px;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  border-top: 1px solid var(--line);
}

.system-audit-list article > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--navy-100);
  color: var(--navy-800);
}

.system-audit-list article svg {
  width: 15px;
}

.system-audit-list article > div,
.system-audit-list time {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.system-audit-list article strong,
.system-audit-list article small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-audit-list article strong {
  font-size: 10px;
}

.system-audit-list article small,
.system-audit-list time {
  color: var(--muted);
  font-size: 9px;
}

.system-audit-list time {
  text-align: right;
}

.system-audit-empty {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.system-audit-empty svg {
  width: 17px;
}

.backup-restore-modal,
.undo-import-modal {
  width: min(620px, calc(100vw - 32px));
}

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

.backup-restore-details {
  display: grid;
  margin: 0;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.backup-restore-details > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  padding: 5px 0;
  font-size: 10px;
}

.backup-restore-details dt {
  color: var(--muted);
}

.backup-restore-details dd {
  margin: 0;
  font-weight: 700;
}

.backup-restore-modal form {
  display: grid;
  gap: 16px;
  padding: 18px 20px 0;
}

.backup-restore-modal form .modal-actions {
  margin: 0 -20px;
}

.undo-import-summary {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
}

.undo-import-summary > span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--navy-100);
  color: var(--navy-800);
}

.undo-import-summary svg {
  width: 21px;
}

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

.undo-import-summary small {
  color: var(--muted);
  font-size: 10px;
}

.annual-check-drawer-plan {
  display: grid;
  gap: 12px;
}

.annual-check-drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.annual-check-drawer-stats span {
  display: grid;
  gap: 2px;
  padding: 10px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.annual-check-drawer-stats span:last-child {
  border-right: 0;
}

.annual-check-drawer-stats strong {
  color: var(--ink);
  font-size: 16px;
}

.business-plan-editor-modal {
  width: min(880px, calc(100vw - 32px));
}

.business-plan-editor-modal form {
  display: grid;
  gap: 16px;
}

.business-plan-editor-section {
  display: grid;
  min-width: 0;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}

.business-plan-editor-section legend {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.business-plan-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.business-plan-editor-grid label {
  display: grid;
  min-width: 0;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 10px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.business-plan-editor-grid label:nth-child(3n) {
  border-right: 0;
}

.business-plan-editor-grid label > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.business-plan-editor-grid strong {
  overflow-wrap: anywhere;
  font-size: 10px;
}

.business-plan-editor-grid small {
  color: var(--muted);
  font-size: 8px;
}

.business-plan-editor-grid input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
}

.business-plan-editor-note {
  padding: 0 16px;
}

.tracking-metrics-modal {
  width: min(980px, calc(100vw - 32px));
}

.commission-settings-modal {
  width: min(820px, calc(100vw - 32px));
}

.commission-settings-modal form {
  display: grid;
  gap: 16px;
}

.commission-profile-field {
  margin: 0 20px;
}

.commission-profile-field small {
  color: var(--muted);
  font-size: 9px;
}

.commission-rate-editor {
  margin: 0 20px;
  border-top: 1px solid var(--line);
}

.commission-rate-head,
.commission-rate-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.8fr) 130px;
  align-items: center;
  gap: 12px;
}

.commission-rate-head {
  min-height: 32px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.commission-rate-row {
  min-height: 52px;
  border-top: 1px solid var(--line);
}

.commission-rate-row strong {
  font-size: 11px;
}

.commission-rate-row > span {
  color: var(--muted);
  font-size: 10px;
}

.commission-rate-row label {
  position: relative;
  display: block;
}

.commission-rate-row input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
}

.commission-rate-row em {
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  transform: translateY(-50%);
}

.tracking-metric-editor {
  max-width: 100%;
  padding: 0 20px;
  overflow-x: auto;
}

.tracking-metric-editor-head,
.tracking-metric-editor-row {
  display: grid;
  min-width: 720px;
  grid-template-columns: 44px minmax(180px, 1fr) 90px 90px 100px 40px;
  align-items: center;
  gap: 10px;
}

.tracking-metric-editor-head {
  height: 36px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.tracking-metric-editor-row {
  min-height: 56px;
  border-top: 1px solid var(--line);
}

.tracking-active-toggle {
  position: relative;
  display: block;
  width: 34px;
  height: 20px;
}

.tracking-active-toggle input {
  position: absolute;
  opacity: 0;
}

.tracking-active-toggle span {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #cbd3da;
  border-radius: 10px;
}

.tracking-active-toggle span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  content: "";
  background: white;
  border-radius: 50%;
  transition: transform 150ms ease;
}

.tracking-active-toggle input:checked + span {
  background: var(--teal);
}

.tracking-active-toggle input:checked + span::after {
  transform: translateX(14px);
}

.tracking-core-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--navy-800);
}

.tracking-core-mark svg {
  width: 17px;
  height: 17px;
}

.tracking-custom-metric {
  display: grid;
  margin: 18px 20px 0;
  padding: 16px;
  grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(110px, 0.7fr));
  align-items: end;
  gap: 10px;
  background: var(--surface-blue);
  border: 1px solid #d7e4ed;
  border-radius: var(--radius);
}

.tracking-custom-metric > div {
  align-self: center;
}

.tracking-custom-metric strong,
.tracking-custom-metric span {
  display: block;
}

.tracking-custom-metric strong {
  font-size: 12px;
}

.tracking-custom-metric span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

@media (max-width: 1120px) {
  .tracking-main-grid,
  .tracking-lower-grid {
    grid-template-columns: 1fr;
  }

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

  .tracking-kpi:nth-child(3n) {
    border-right: 0;
  }

  .tracking-kpi:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .tracking-custom-metric {
    grid-template-columns: repeat(4, 1fr);
  }

  .tracking-custom-metric > div {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .tracking-header {
    align-items: stretch;
    flex-direction: column;
  }

  .tracking-header .page-toolbar {
    width: 100%;
  }

  .tracking-header .segmented {
    flex: 1;
  }

  .tracking-kpi {
    min-height: 88px;
    padding: 14px;
  }

  .funnel-row {
    grid-template-columns: 32px minmax(125px, 0.8fr) minmax(90px, 1fr) 34px;
    gap: 9px;
  }

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

  .tracking-note {
    grid-column: span 1;
  }

  .tracking-entry-form .primary-button {
    width: 100%;
  }

  .tracking-custom-metric {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .tracking-finance-strip > div:nth-child(2n) {
    border-right: 0;
  }

  .tracking-finance-strip > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .tracking-page {
    gap: 12px;
  }

  .tracking-page > .panel,
  .tracking-main-grid > .panel,
  .tracking-lower-grid > .panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

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

  .tracking-kpi:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .tracking-kpi:nth-child(2n) {
    border-right: 0;
  }

  .tracking-kpi:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .tracking-kpi strong {
    font-size: 21px;
  }

  .funnel-row {
    min-height: 72px;
    grid-template-columns: 30px minmax(0, 1fr) 34px;
  }

  .funnel-track {
    grid-column: 2 / -1;
    width: 100%;
  }

  .funnel-copy span {
    white-space: normal;
  }

  .tracking-entry-form {
    grid-template-columns: 1fr;
  }

  .tracking-note {
    grid-column: auto;
  }

  .tracking-custom-metric {
    margin-right: 12px;
    margin-left: 12px;
    grid-template-columns: 1fr;
  }

  .tracking-custom-metric > div {
    grid-column: auto;
  }

  .tracking-metric-editor {
    padding: 0 12px;
  }

  .tracking-week-chart {
    padding-right: 12px;
    padding-left: 12px;
  }

  .tracking-finance-strip {
    grid-template-columns: 1fr;
    border-right: 0;
    border-left: 0;
  }

  .tracking-finance-strip > div {
    min-height: 68px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .tracking-finance-strip > div:first-child {
    border-top: 0;
  }

  .commission-rate-editor {
    margin-right: 12px;
    margin-left: 12px;
  }

  .commission-profile-field {
    margin-right: 12px;
    margin-left: 12px;
  }

  .commission-rate-head {
    display: none;
  }

  .commission-rate-row {
    padding: 10px 0;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 4px 10px;
  }

  .commission-rate-row > span {
    grid-column: 1;
  }

  .commission-rate-row label {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

html[data-theme="dark"] .nav-button {
  color: #c6d2dc;
}

html[data-theme="dark"] .mobile-nav {
  background: rgba(21, 29, 36, 0.97);
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .mobile-nav-button {
  color: #aebbc6;
}

html[data-theme="dark"] .mobile-nav-button.active {
  color: #8ec8ef;
}

html[data-theme="dark"] .secondary-button:not(:disabled),
html[data-theme="dark"] .action-button:not(:disabled),
html[data-theme="dark"] .ghost-button {
  color: #8ec8ef;
}

html[data-theme="dark"] .field label,
html[data-theme="dark"] .account-details dd,
html[data-theme="dark"] .selection-bar label span {
  color: var(--ink);
}

html[data-theme="dark"] .task-check:not(.checked),
html[data-theme="dark"] .notification-preference-row i::after,
html[data-theme="dark"] .tracking-active-toggle span::after,
html[data-theme="dark"] .dashboard-section-options i::after {
  background: #eef3f7;
}

html[data-theme="dark"] .completed-action,
html[data-theme="dark"] .login-success,
html[data-theme="dark"] .status-pill {
  border-color: #315f4a;
  background: #183426;
  color: #7dd69e;
}

html[data-theme="dark"] .status-pill.local {
  border-color: #66532e;
  background: #352d1d;
  color: #f0c66b;
}

html[data-theme="dark"] .status-pill.error,
html[data-theme="dark"] .security-note.error,
html[data-theme="dark"] .login-notice.error {
  border-color: #663c3c;
  background: #382222;
  color: #ff9b93;
}

html[data-theme="dark"] .security-note,
html[data-theme="dark"] .login-notice {
  border-color: #355164;
  background: #182936;
  color: #b9d6e8;
}

html[data-theme="dark"] .account-symbol,
html[data-theme="dark"] .auth-symbol {
  background: #173b3b;
  color: var(--teal);
}

html[data-theme="dark"] .auth-shell {
  background:
    linear-gradient(#1c2933 1px, transparent 1px),
    linear-gradient(90deg, #1c2933 1px, transparent 1px),
    var(--surface-soft);
  background-size: 36px 36px;
}

html[data-theme="dark"] .auth-panel {
  box-shadow: var(--shadow);
}

@media (max-width: 720px) {
  .settings-shortcuts,
  .appearance-theme-options,
  .dashboard-section-options,
  .system-status-actions {
    grid-template-columns: 1fr;
  }

  .system-status-summary {
    grid-template-columns: 1fr;
  }

  .system-status-primary {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .system-data-counts,
  .annual-workflow-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-data-counts > div,
  .annual-workflow-stats > div {
    border-bottom: 1px solid var(--line);
  }

  .annual-workflow-list article {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .annual-workflow-state {
    grid-column: 1 / -1;
  }

  .system-audit-list article {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .system-audit-list time {
    display: none;
  }

  .routine-command-action-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .managed-account-list li {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .managed-account-list .secondary-button {
    grid-column: 2 / -1;
    justify-self: stretch;
  }
}

@media (max-width: 820px) {
  .business-plan-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .business-plan-actions {
    width: 100%;
  }

  .business-plan-actions .secondary-button,
  .business-plan-actions .primary-button {
    flex: 1;
  }

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

  .commission-control-empty {
    align-items: start;
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .commission-control-empty .primary-button {
    grid-column: 1 / -1;
  }

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

  .commission-control-summary > div:nth-child(2) {
    border-right: 0;
  }

  .commission-control-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .commission-control-grid {
    grid-template-columns: 1fr;
  }

  .commission-anomaly-section {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .business-plan-summary > div:nth-child(2) {
    border-right: 0;
  }

  .business-plan-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .business-plan-categories,
  .business-plan-detail-grid {
    grid-template-columns: 1fr;
  }

  .business-plan-category {
    border-right: 0;
  }

  .business-plan-special-grid,
  .business-plan-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .business-plan-stock-grid > div:nth-child(2) {
    border-right: 0;
  }

  .business-plan-stock-grid > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .business-plan-special-grid > div:nth-child(3n),
  .business-plan-editor-grid label:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .business-plan-special-grid > div:nth-child(2n),
  .business-plan-editor-grid label:nth-child(2n) {
    border-right: 0;
  }

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

  .lead-summary button:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .task-filters.full {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(72px, 1fr));
  }

  .contacts-table tr {
    padding-right: 12px;
  }

  .contacts-table td:last-child {
    position: static;
    margin-top: 10px;
  }

  .contacts-table .row-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .business-plan-hero h2 {
    font-size: 21px;
  }

  .business-plan-actions,
  .business-plan-category-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .business-plan-summary > div,
  .business-plan-summary > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .business-plan-summary > div:last-child {
    border-bottom: 0;
  }

  .business-plan-main-panel .section-header {
    align-items: stretch;
  }

  .business-plan-joker select {
    width: 100%;
  }

  .business-plan-special-grid,
  .business-plan-editor-grid,
  .business-plan-stock-grid {
    grid-template-columns: 1fr;
  }

  .business-plan-special-grid > div,
  .business-plan-special-grid > div:nth-child(2n),
  .business-plan-special-grid > div:nth-child(3n),
  .business-plan-editor-grid label,
  .business-plan-editor-grid label:nth-child(2n),
  .business-plan-editor-grid label:nth-child(3n) {
    border-right: 0;
  }

  .business-plan-editor-grid label {
    grid-template-columns: minmax(0, 1fr) 100px;
  }

  .business-plan-stock-grid > div,
  .business-plan-stock-grid > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .business-plan-stock-grid > div:last-child {
    border-bottom: 0;
  }

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

  .campaign-preview-heading .campaign-preview-actions,
  .campaign-add-contact {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .campaign-add-contact label {
    grid-column: auto;
  }

  .campaign-preview-actions .secondary-button,
  .campaign-preview-actions .primary-button,
  .campaign-add-contact .secondary-button {
    width: 100%;
  }

  .campaign-filter-grid,
  .campaign-product-filters,
  .campaign-product-filters fieldset {
    grid-template-columns: 1fr;
  }

  .followup-track {
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(72px, 1fr));
    padding-bottom: 6px;
  }

  .routine-dashboard-summary {
    align-items: flex-start;
    padding-right: 0;
    padding-left: 0;
  }
}

@media (max-width: 820px) {
  .contact-directory-toolbar {
    display: grid;
    gap: 8px;
    padding: 12px;
  }

  .contact-directory-search {
    width: 100%;
  }

  .contact-directory-toolbar > span {
    margin-left: 0;
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .search-result {
    grid-template-columns: 32px minmax(0, 1fr) 16px;
  }

  .search-result-type {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
