.shell,
#app:has(.shell) ~ #dialog {
  --canvas: #f4f7fb;
  --surface: #fff;
  --ink: #142238;
  --muted: #52647a;
  --line: #dce5ef;
  --control-line: #cbd8e6;
  --nav: #102039;
  --nav-muted: #b7c9de;
  --nav-line: #2f4561;
  --accent: #1664b8;
  --accent-hover: #124e91;
  --workspace-tint: #e8f2ff;
  --nav-hover: #233b59;
  --panel-soft: #f3f7fc;
  --control-hover: #dcecff;
  --hero-fill: linear-gradient(112deg, #10213b, #234c76);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.shell,
.shell.research-shell { color: var(--ink); background: var(--canvas); }
.shell :is(.workspace-body, .card) { min-width: 0; }
.shell .main > .stack { grid-template-columns: minmax(0, 1fr); }
.shell .table-wrap { max-width: 100%; }
.shell :focus-visible, #app:has(.shell) ~ #dialog :focus-visible { outline-color: #2d78c7; }
.shell .sidebar :focus-visible { outline-color: #a6d2ff; }
.shell .sidebar .eyebrow { font-family: inherit; }
.shell .workspace-avatar { color: #dceeff; background: #2a4564; }
.shell .workspace-avatar:has(.workspace-logo) { position: relative; overflow: hidden; }
.shell .workspace-logo { position: absolute; inset: 0; width: 100%; height: 100%; padding: 3px; object-fit: contain; background: var(--surface); }
.shell .nav-item { color: #e3edf8; }
.shell .nav-item:hover { color: white; background: var(--nav-hover); }
.shell .nav-item[aria-current="page"] { color: #183a62; background: var(--workspace-tint); }
.shell .workspace-wallet { color: #f4f8ff; background: #1b3351; border-color: var(--nav-line); }
.shell :is(.wallet-kicker, .wallet-revealed, .wallet-count span) { color: #cee2f8; }
.shell .workspace-wallet .btn { color: #183a62; background: #d2e8ff; border-color: #d2e8ff; }
.shell .workspace-wallet .btn:hover { background: #e6f2ff; border-color: #e6f2ff; }

.shell .hero::after { filter: grayscale(1); opacity: .19; }
.shell .hero :is(.eyebrow, p) { color: #d9e9fa; }
.shell.carrier-shell .pack-selected { border-color: #9fbee0; background: var(--panel-soft); box-shadow: inset 0 0 0 1px #9fbee0; }

:where(.shell, #app:has(.shell) ~ #dialog) .field { color: #344b64; }
:where(.shell, #app:has(.shell) ~ #dialog) .btn:not(.primary, .dark, .quiet) { color: #243f5b; }
:where(.shell, #app:has(.shell) ~ #dialog) .btn:not(.primary, .dark):hover { background: var(--panel-soft); }
:where(.shell, #app:has(.shell) ~ #dialog) .btn.dark { background: var(--nav); border-color: var(--nav); }
:where(.shell, #app:has(.shell) ~ #dialog) .btn.dark:hover { background: var(--nav-hover); border-color: var(--nav-hover); }
:where(.shell, #app:has(.shell) ~ #dialog) .alert { color: #264f78; }
#app:has(.shell) ~ #dialog { box-shadow: 0 18px 65px #10203948; }
#app:has(.shell) ~ #dialog::backdrop { background: #10203983; }
#app:has(.shell) ~ #toast:not(:empty) { background: #102039; box-shadow: 0 5px 20px #10203935; }

.shell .badge:not(.good, .warn),
.shell .avatar { color: #214e7d; }
.shell th, .shell .research-workspace #results th { color: #466079; background: var(--panel-soft); }
.shell tbody tr:hover, .shell tbody tr.selected { background: #f3f8ff; }
.shell .tray { background: var(--nav); box-shadow: 0 7px 22px #10203932; }
.shell .tray .muted { color: #d3e6f9; }
.shell .tray .quiet:hover { background: var(--nav-hover); }

.shell :is(.workspace-switch, .research-switch, .pipeline-column) { background: var(--panel-soft); }
.shell .workspace-switch a:hover, .shell .research-switch button:hover { color: var(--ink); background: var(--control-hover); }
.shell .workspace-switch a[data-active="true"] { color: var(--accent-hover); background: var(--workspace-tint); }
.shell .research-switch button[aria-pressed="true"] { color: var(--accent-hover); box-shadow: 0 1px 2px #10203916; }
.shell :is(.research-notice, .research-selection-bar) { border-color: var(--control-line); background: var(--workspace-tint); color: #264f78; }
.shell .research-notice :is(strong, p), .shell .research-focus { color: #355674; }
.shell .research-tabs button { color: #243f5b; }
.shell .research-tabs button:hover { border-color: #9fbee0; }
.shell .research-tabs button[aria-pressed="true"] { border-color: var(--nav); background: var(--nav); color: #fff; }
.shell .research-tabs button span { color: #214e7d; }
.shell .research-tabs button[aria-pressed="true"] span { background: #385979; color: #fff; }
.shell .research-chip { border-color: #a5b7ca; background: var(--panel-soft); color: #405974; }
.shell .research-chip:is(:hover, [aria-expanded="true"]) { border-color: #9fbee0; background: var(--workspace-tint); color: var(--accent-hover); }

.shell.research-shell {
  --canvas: #f5f6f8;
  --ink: #172331;
  --muted: #566171;
  --line: #e4e7ec;
  --control-line: #cfd6e0;
  --panel-soft: #f7f8fa;
  --workspace-tint: #eaf2fc;
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
}
.research-shell .main { max-width: 1280px; padding-top: clamp(22px, 4vw, 47px); }
.research-shell .research-workspace { gap: clamp(14px, 2.2vw, 24px); }
.catalog-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.3vw, 15px);
}
.catalog-category {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  padding: clamp(11px, 1.45vw, 19px);
  border: 1px solid var(--control-line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.catalog-category:hover { border-color: var(--accent); background: var(--panel-soft); }
.catalog-category[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--workspace-tint);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.catalog-category-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; color: var(--muted); }
.catalog-category-top > .icon { width: 16px; height: 16px; }
.catalog-category-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--accent-hover);
  background: var(--workspace-tint);
}
.catalog-category[aria-pressed="true"] .catalog-category-icon { color: #fff; background: var(--accent-hover); }
.catalog-category-title { font-size: clamp(.95rem, 1.65vw, 1.24rem); font-weight: 720; line-height: 1.2; overflow-wrap: anywhere; }
.catalog-category[aria-pressed="true"] .catalog-category-title { color: var(--accent-hover); }
.catalog-category-description { color: var(--muted); font-size: clamp(.78rem, 1.15vw, .9rem); line-height: 1.35; }
@media (min-width: 1050px) {
  .catalog-categories { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.catalog-intro { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 14px 26px; }
.catalog-intro h1 { font-size: clamp(2.15rem, 4vw, 3rem); font-weight: 720; letter-spacing: -.046em; }
.catalog-intro p { max-width: 59ch; margin-top: 9px; font-size: .97rem; line-height: 1.55; }
.catalog-intro p strong { color: var(--ink); font-weight: 670; }
.research-shell .catalog-intro .research-switch { background: #e9edf2; }
.catalog-intro .research-switch button { min-height: 35px; padding-inline: 11px; }
.research-shell .catalog-intro .research-switch button[aria-pressed="true"] { background: #fff; }

.research-shell .research-filters.card,
.research-shell .research-workspace #results .card { border-radius: 15px; }
.research-shell .research-form { gap: 12px; padding: clamp(13px, 2vw, 19px); }
.research-shell .research-form .field { gap: 6px; font-size: .81rem; font-weight: 640; }
.research-shell .research-form :is(input, select) { min-height: 43px; padding-inline: 11px; background: var(--panel-soft); }
.research-shell .research-form .btn { min-height: 43px; }
.research-shell .research-guided-filter .research-form { padding: 13px 0 0; }
.research-shell [data-form="real-catalog-search"] { grid-template-columns: minmax(0, 1fr); }
.research-shell [data-form="real-catalog-search"] .research-company-field { grid-template-columns: minmax(0, 1fr); }
.research-shell [data-form="real-catalog-search"] .research-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.catalog-filter-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 6px; }
@media (min-width: 1240px) {
  .research-shell [data-form="real-catalog-search"] { grid-template-columns: minmax(175px, 1fr) minmax(0, 3fr); }
}
@media (max-width: 880px) {
  .research-shell [data-form="real-catalog-search"] .research-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog-filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 570px) {
  .research-shell [data-form="real-catalog-search"] .research-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-filter-actions { grid-column: auto; }
  .research-shell .research-form .field :is(input, select) { font-size: 16px; }
  .catalog-filter-actions .btn.primary { flex: 1; }
}
@media (max-width: 390px) {
  .research-shell [data-form="real-catalog-search"] .research-secondary { grid-template-columns: minmax(0, 1fr); }
}

.research-shell .research-workspace #results .section-head { padding: 15px clamp(13px, 2vw, 21px); }
.research-shell .research-workspace #results h2 { font-size: 1.15rem; font-weight: 710; letter-spacing: -.024em; }
.research-shell .research-workspace #results .section-head p { margin-top: 3px; font-size: .85rem; }
.shell.research-shell .research-workspace #results th {
  background: var(--panel-soft);
  color: #4c5969;
  font: inherit;
  font-size: .79rem;
  font-weight: 680;
  letter-spacing: 0;
  text-transform: none;
}
.research-shell .research-workspace #results :is(th, td) { padding: 10px clamp(9px, 1.4vw, 17px); }
.research-shell .research-workspace #results td { font-size: .88rem; }
.research-shell .research-workspace #results .foot { padding: 10px clamp(13px, 2vw, 21px); font-size: .82rem; }
.catalog-page-size, .catalog-select-page { display: inline-flex; align-items: center; gap: 8px; }
.catalog-page-size { color: var(--muted); font-weight: 610; }
.catalog-page-size select {
  min-height: 33px;
  padding: 4px 7px;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: inherit;
}
.catalog-select-page { min-height: 33px; font-size: .9rem; font-weight: 710; cursor: pointer; }
.catalog-selection-bar > .flex { gap: 8px; }
.research-shell #results .table-wrap { position: relative; overscroll-behavior-inline: contain; }
.real-catalog-results table { min-width: 585px; table-layout: fixed; white-space: normal; }
.real-catalog-results th:first-child { width: 26%; }
.real-catalog-results th:nth-child(3) { width: 18%; }
.real-catalog-results th:nth-child(n+4) { width: 13%; }
.real-catalog-results :is(th, td) { overflow-wrap: anywhere; }
.catalog-driver-name { font-weight: 660; }
.research-workspace .catalog-contact-cell { white-space: nowrap; }
.catalog-contact-lock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #edf0f4;
  color: #4e5b6b;
  font-size: .75rem;
  font-weight: 620;
}
.catalog-contact-lock .icon { width: 12px; height: 12px; }
.catalog-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.shell .pipeline-column-head > span { background: var(--workspace-tint); }
.shell .pipeline-card:hover { border-color: #9fbee0; box-shadow: 0 2px 6px #10203917; }
.shell .pipeline-column.is-drop-target { border-color: var(--accent); background: var(--workspace-tint); }

.shell .recruiting-overview { overflow: hidden; }
.shell .recruiting-stage-chart { display: grid; gap: 12px; padding: 18px 22px 22px; }
.shell .recruiting-stage-chart > div { display: grid; grid-template-columns: 78px minmax(0, 1fr) 38px; align-items: center; gap: 12px; }
.shell .recruiting-stage-chart strong { text-align: right; font-variant-numeric: tabular-nums; }
.shell .recruiting-stage-chart meter { width: 100%; height: 12px; appearance: none; }
.shell .recruiting-stage-chart meter::-webkit-meter-bar { background: var(--workspace-tint); border: none; }
.shell .recruiting-stage-chart meter::-webkit-meter-optimum-value { background: var(--accent); }
.shell .recruiting-stage-chart meter::-moz-meter-bar { background: var(--accent); }

.shell.carrier-portal {
  --canvas: #fff;
  --ink: #13191f;
  --muted: #536170;
  --line: #e1e6eb;
  --control-line: #cfd7df;
  --panel-soft: #f2f5f8;
  --workspace-tint: #cce2fb;
  --accent: #0759b2;
  --accent-hover: #064486;
}
.shell.carrier-portal .sidebar {
  --nav-muted: #4d5b6a;
  --nav-line: #dbe2e9;
  padding: 24px 12px 15px;
  border-inline-end: 1px solid var(--line);
  background: #f2f5f8;
  color: var(--ink);
}
.carrier-portal .sidebar .brand { margin-bottom: 19px; font-size: 1.22rem; }
.carrier-portal .sidebar .workspace { background: #fff; }
.carrier-portal .workspace-avatar { color: #123c69; background: #bde2ff; border-radius: 50%; }
.carrier-portal .sidebar .eyebrow { font-family: inherit; letter-spacing: .06em; }
.carrier-portal .sidebar .nav-item { color: var(--ink); min-height: 41px; border-radius: 11px; }
.carrier-portal .sidebar .nav-item:hover { color: var(--ink); background: #e5ebf2; }
.carrier-portal .sidebar .nav-item[aria-current="page"] { background: var(--workspace-tint); color: #0b4283; }
.carrier-portal .sidebar .nav-item .icon { color: currentColor; }
.carrier-portal .sidebar :focus-visible { outline-color: #2169b8; }
.carrier-portal .sidebar .sidebar-find { align-self: flex-start; margin: 0 0 19px 4px; min-height: 39px; }
.carrier-portal .sidebar .workspace-wallet { background: #fff; color: var(--ink); }
.carrier-portal .sidebar :is(.wallet-kicker, .wallet-revealed) { color: var(--muted); }
.carrier-portal .sidebar .workspace-wallet .btn { color: #064486; background: #e7f1fe; border-color: #d8e7f9; }
.carrier-portal .sidebar .workspace-wallet .btn:hover { background: #dbeafb; }
.carrier-portal :is(.btn.primary, .btn.dark) { border-radius: 999px; }
.carrier-portal :is(.header-actions, .sidebar, .dashboard-credit) .btn.primary {
  background: #141c25;
  border-color: #141c25;
  color: #fff;
}
.carrier-portal :is(.header-actions, .sidebar, .dashboard-credit) .btn.primary:hover { background: #243546; border-color: #243546; }
.carrier-portal.research-shell { --canvas: #f7f8fa; }

.carrier-dashboard .header { min-height: 71px; border-bottom: 0; }
.dashboard-workspace-name { font-size: clamp(1.3rem, 3vw, 1.8rem); letter-spacing: -.032em; line-height: 1.18; overflow-wrap: anywhere; }
.carrier-dashboard .header-actions .workspace-avatar { width: 39px; height: 39px; }
.carrier-dashboard .main { padding-top: clamp(20px, 4vw, 46px); }
.carrier-dashboard .carrier-home { grid-template-columns: minmax(0, 1fr); gap: clamp(24px, 3vw, 36px); }
.dashboard-access h2, .dashboard-activity h2 { font-size: 1.12rem; }
.dashboard-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 12px 8px;
  margin-top: 15px;
}
.dashboard-shortcut {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 9px;
  min-width: 0;
  border: 0;
  border-radius: 12px;
  padding: 7px 4px;
  background: transparent;
  color: var(--ink);
  font-weight: 630;
  font-size: .83rem;
  text-align: center;
}
.dashboard-shortcut span { display: grid; place-items: center; width: 53px; height: 53px; border-radius: 50%; background: var(--panel-soft); }
.dashboard-shortcut .icon { width: 24px; height: 24px; }
.dashboard-shortcut:hover { color: var(--accent-hover); }
.dashboard-shortcut:hover span { background: #e4effc; }
.dashboard-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: clamp(15px, 2.5vw, 25px); border: 1px solid var(--line); border-radius: 16px; background: var(--panel-soft); }
.dashboard-credit { flex: 1 1 230px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px 14px; }
.dashboard-credit p, .dashboard-totals dt { color: var(--muted); font-size: .82rem; font-weight: 620; }
.dashboard-credit strong { display: block; font-size: 1.9rem; letter-spacing: -.04em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dashboard-totals { flex: 2 1 340px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.dashboard-totals > div { border-inline-start: 1px solid var(--line); padding-inline: 11px 0; }
.dashboard-totals dd { margin: 4px 0 0; font-size: 1.33rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.dashboard-activity .section-head { padding: 0 0 13px; }
.dashboard-activity .section-head .btn { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.dashboard-activity .table-wrap { border-bottom: 1px solid var(--line); }
.dashboard-activity table { min-width: 520px; }
.dashboard-activity :is(th, td) { padding-block: 12px; }
.dashboard-activity .empty { padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.carrier-dashboard .home-recent > .card { border-radius: 15px; }
@media (max-width: 780px) {
  .carrier-shell .demo-company-switch { display: none; }
  .carrier-dashboard .carrier-workspace-header { gap: 8px 12px; }
  .carrier-dashboard .dashboard-workspace-name { grid-column: 1; grid-row: 1; }
  .carrier-dashboard .header-actions { grid-column: 2; grid-row: 1; }
  .carrier-dashboard .mobile-nav { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 500px) {
  .dashboard-shortcuts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 3px; }
  .dashboard-shortcut { font-size: .75rem; }
  .dashboard-shortcut span { width: 45px; height: 45px; }
  .dashboard-shortcut .icon { width: 21px; height: 21px; }
  .dashboard-totals > div { padding-inline-start: 7px; }
}

.shell .logo-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding-top: 0; }
.shell .logo-form .field { flex: 1 1 235px; }
.shell .logo-form-preview { align-self: center; }
.shell .logo-form-preview .workspace-avatar { width: 48px; height: 48px; }
.shell .logo-form input::file-selector-button {
  margin-inline-end: 8px;
  padding: 3px 8px;
  border: 1px solid var(--control-line);
  border-radius: 5px;
  color: var(--ink);
  background: var(--panel-soft);
  font: inherit;
}
.shell .logo-form .form-error { flex-basis: 100%; }

.division-crm-filters .catalog-page-size { min-height: 37px; }
.division-crm-filter-actions { flex-wrap: wrap; }
.division-crm-table th:nth-child(1) { width: 28%; }
.division-crm-table th:nth-child(2) { width: 19%; }
.division-crm-table th:nth-child(3) { width: 13%; }
.division-crm-table th:nth-child(n+4) { width: calc(40% / 3); }
.division-crm-contact-actions { margin-top: 8px; flex-wrap: wrap; }
