    @import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

    html, body {
      font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      text-rendering: optimizeLegibility;
      letter-spacing: -0.01em;
    }

    .font-mono:not(code):not(pre) {
      font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
      letter-spacing: -0.01em;
    }

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

    :root {
      --primary: #0b57d0;
      --on-primary: #ffffff;
      --primary-container: #d3e3fd;
      --on-primary-container: #041e49;
      --primary-fixed: #d3e3fd;
      --primary-fixed-dim: #a8c7fa;
      --on-primary-fixed: #041e49;
      --on-primary-fixed-variant: #0842a0;
      --secondary: #188038;
      --on-secondary: #ffffff;
      --secondary-container: #c4eed0;
      --on-secondary-container: #0d3b1e;
      --secondary-fixed: #c4eed0;
      --secondary-fixed-dim: #81c995;
      --on-secondary-fixed: #0d3b1e;
      --on-secondary-fixed-variant: #146c2e;
      --tertiary: #b06000;
      --on-tertiary: #ffffff;
      --tertiary-container: #ffddb3;
      --on-tertiary-container: #3b2100;
      --tertiary-fixed: #ffddb3;
      --tertiary-fixed-dim: #ffb95f;
      --on-tertiary-fixed: #3b2100;
      --on-tertiary-fixed-variant: #8a4f00;
      --error: #d93025;
      --on-error: #ffffff;
      --error-container: #f9dedc;
      --on-error-container: #5f1410;
      --background: #f3f6fc;
      --on-background: #0b1220;
      --surface: #f3f6fc;
      --on-surface: #0b1220;
      --surface-variant: #e1e3e8;
      --on-surface-variant: #475569;
      --outline: #64748b;
      --outline-variant: #dce4ef;
      --inverse-surface: #303030;
      --inverse-on-surface: #f1f1f1;
      --inverse-primary: #a8c7fa;
      --surface-container-lowest: #ffffff;
      --surface-container-low: #f8faff;
      --surface-container: #fff;
      --surface-container-high: #f0f5fa;
      --surface-container-highest: #e8eef5;
      --surface-dim: #d9dbe0;
      --surface-bright: #ffffff;
      --surface-tint: #0b57d0;

      /* Glow & Glass */
      --glow-blue: 90, 153, 255;
      --glow-violet: 167, 113, 255;
      --glow-teal: 67, 212, 190;
      --glow-amber: 255, 190, 91;
      --gloss-border: rgba(255, 255, 255, .62);

      /* Card & Polish tokens */
      --mc-card-radius: 18px;
      --mc-card-padding: 22px;
      --mc-card-border: 1px solid var(--outline-variant, var(--outline));
      --mc-card-shadow: 0 2px 8px -2px rgb(0 0 0 / 0.06), 0 1px 3px -1px rgb(0 0 0 / 0.04);
      --mc-card-shadow-hover: 0 8px 24px -4px rgb(0 0 0 / 0.1), 0 4px 12px -2px rgb(0 0 0 / 0.06);
      --mc-teal: #0f766e;
      --mc-teal-weak: rgb(13 148 136 / 0.12);
      --mc-navy-900: #0b1220;
      --mc-navy-800: #111a2e;
      --mc-indigo-600: #4f46e5;
      --mc-focus-ring: 0 0 0 3px rgb(79 70 229 / 0.35);

      /* Accents */
      --mc-accent-cyan: #06b6d4;
      --mc-accent-blue: #3b82f6;
      --mc-accent-violet: #a855f7;
      --mc-accent-amber: #f59e0b;
    }

    .dark {
      --primary: #a8c7fa;
      --on-primary: #062e6f;
      --primary-container: #0842a0;
      --on-primary-container: #d3e3fd;
      --primary-fixed: #d3e3fd;
      --primary-fixed-dim: #a8c7fa;
      --on-primary-fixed: #041e49;
      --on-primary-fixed-variant: #0842a0;
      --secondary: #81c995;
      --on-secondary: #0b3b1b;
      --secondary-container: #146c2e;
      --on-secondary-container: #c4eed0;
      --secondary-fixed: #c4eed0;
      --secondary-fixed-dim: #81c995;
      --on-secondary-fixed: #0d3b1e;
      --on-secondary-fixed-variant: #146c2e;
      --tertiary: #ffb95f;
      --on-tertiary: #4a2800;
      --tertiary-container: #8a4f00;
      --on-tertiary-container: #ffddb3;
      --tertiary-fixed: #ffddb3;
      --tertiary-fixed-dim: #ffb95f;
      --on-tertiary-fixed: #3b2100;
      --on-tertiary-fixed-variant: #8a4f00;
      --error: #f28b82;
      --on-error: #601410;
      --error-container: #8c1d18;
      --on-error-container: #f9dedc;
      --background: #0c1220;
      --on-background: #f1f5f9;
      --surface: #0c1220;
      --on-surface: #f1f5f9;
      --surface-variant: #303844;
      --on-surface-variant: #94a3b8;
      --outline: #94a3b8;
      --outline-variant: #2b3b52;
      --inverse-surface: #e3e2e6;
      --inverse-on-surface: #303034;
      --inverse-primary: #0b57d0;
      --surface-container-lowest: #0b0e13;
      --surface-container-low: #111a2b;
      --surface-container: #172133;
      --surface-container-high: #1e2a3e;
      --surface-container-highest: #25334a;
      --surface-dim: #0f1217;
      --surface-bright: #303b48;
      --surface-tint: #a8c7fa;

      /* Gloss */
      --gloss-border: rgba(255, 255, 255, .12);

      /* Card & Polish tokens */
      --mc-card-border: 1px solid var(--outline-variant, var(--outline));
      --mc-card-shadow: 0 2px 12px -2px rgb(0 0 0 / 0.35), 0 1px 4px -1px rgb(0 0 0 / 0.25);
      --mc-card-shadow-hover: 0 10px 32px -4px rgb(0 0 0 / 0.45), 0 4px 16px -2px rgb(0 0 0 / 0.3);
      --mc-teal-weak: rgb(13 148 136 / 0.18);
      --mc-focus-ring: 0 0 0 3px rgb(129 140 248 / 0.4);
    }

    /* Tailwind's bare `border` utility otherwise inherits a light default.
       Keep intentionally colored borders (primary/error/etc.) untouched. */
    .dark [class~="border"]:not([class*="border-"]) {
      border-color: var(--outline-variant);
    }

    .dark [class*="border-surface-variant"] {
      border-color: color-mix(in srgb, var(--surface-variant) 55%, transparent) !important;
    }

    *,
    *::before,
    *::after {
      scrollbar-color: var(--outline-variant) transparent;
      scrollbar-width: thin;
    }

    ::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background: var(--outline-variant);
      border-radius: 8px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: var(--outline);
    }

    .page-view {
      display: none;
    }

    .page-view.active {
      display: flex;
      animation: fadeIn .2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(4px);
      }

      to {
        opacity: 1;
        transform: none;
      }
    }

    .nav-item.active {
      background-color: var(--surface-container-high) !important;
      color: var(--primary) !important;
      font-weight: 600;
    }

    .nav-item.active .nav-icon {
      color: var(--primary) !important;
    }

    /* Unified operator view: detail pages remain available through search and
       deep links, but the primary navigation presents one operating picture. */
    #sidebar .nav-item[data-tab="missions"],
    #sidebar .nav-item[data-tab="tasks"],
    #sidebar .nav-item[data-tab="approvals"],
    #sidebar .nav-item[data-tab="agents"],
    #sidebar .nav-item[data-tab="automations"],
    #sidebar .nav-item[data-tab="sessions"],
    #sidebar .nav-item[data-tab="logs-events"],
    #sidebar .nav-item[data-tab="models-usage"],
    #sidebar .nav-item[data-tab="system-health"] {
      display: none;
    }

    #sidebar details:has(.nav-item[data-tab="agents"]),
    #sidebar details:has(.nav-item[data-tab="models-usage"]) {
      display: none;
    }

    .spin {
      animation: spin 1s linear infinite;
      display: inline-block;
    }

    @keyframes spin {
      100% {
        transform: rotate(360deg);
      }
    }

    @keyframes agentWorking {

      0%,
      100% {
        transform: scale(.9);
        opacity: .65;
        box-shadow: 0 0 0 0 rgba(121, 218, 166, .45);
      }

      50% {
        transform: scale(1.15);
        opacity: 1;
        box-shadow: 0 0 0 6px rgba(121, 218, 166, 0);
      }
    }

    @keyframes agentStandby {

      0%,
      100% {
        opacity: .45;
        box-shadow: 0 0 0 0 rgba(229, 181, 103, .25);
      }

      50% {
        opacity: 1;
        box-shadow: 0 0 0 5px rgba(229, 181, 103, 0);
      }
    }

    @keyframes agentIdle {

      0%,
      100% {
        opacity: .35;
      }

      50% {
        opacity: .7;
      }
    }

    .agent-status-dot {
      display: inline-block;
      flex-shrink: 0;
    }

    .agent-status-dot.working {
      background: #79daa6;
      animation: agentWorking 1.6s ease-in-out infinite;
    }

    .agent-status-dot.available {
      background: #e5b567;
      animation: agentStandby 2.8s ease-in-out infinite;
    }

    .agent-status-dot.idle {
      background: #9c8f7d;
      animation: agentIdle 3.5s ease-in-out infinite;
    }

    .agent-card.working {
      border-color: rgba(121, 218, 166, .55);
      box-shadow: 0 0 22px rgba(121, 218, 166, .08);
    }

    .agent-card.available {
      border-color: rgba(229, 181, 103, .25);
    }

    .agent-card.idle {
      opacity: .88;
    }

    .agent-command-panel {
      background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 34%), var(--surface-container-low);
    }

    .agent-command-panel .agent-kpi-grid>div {
      transition: transform .18s ease, border-color .18s ease;
    }

    .agent-command-panel .agent-kpi-grid>div:hover {
      transform: translateY(-2px);
      border-color: color-mix(in srgb, var(--primary) 45%, transparent);
    }

    #teamRunsList>article {
      position: relative;
      overflow: hidden;
    }

    #teamRunsList>article::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 3px;
      background: var(--primary);
      opacity: .55;
    }

    .team-outcome-details summary::-webkit-details-marker {
      display: none;
    }

    .team-outcome-details summary::after {
      content: 'expand_more';
      font-family: 'Material Symbols Outlined';
      color: var(--outline);
      margin-left: .5rem;
    }

    .team-outcome-details[open] summary::after {
      content: 'expand_less';
    }

    .team-outcome-details[open] {
      border-color: color-mix(in srgb, var(--primary) 38%, var(--surface-variant));
    }

    #agentSkillsSection {
      display: none;
    }

    @media (prefers-reduced-motion: reduce) {

      .agent-status-dot,
      .agent-card {
        animation: none !important;
      }
    }

    /* Interaction layer (v6) - scoped only. No global transitions, no section-wide hover. */
    a,
    button,
    [role="button"] {
      -webkit-tap-highlight-color: transparent;
    }

    button:not(:disabled) {
      cursor: pointer;
    }

    button:disabled {
      cursor: not-allowed;
      opacity: .6;
    }

    button:focus-visible,
    a:focus-visible,
    input:focus-visible,
    select:focus-visible,
    .nav-item:focus-visible {
      outline: 2px solid var(--primary);
      outline-offset: 2px;
    }

    .nav-item {
      transition: background-color .15s ease, color .15s ease;
    }

    .nav-group>summary::-webkit-details-marker {
      display: none;
    }

    .nav-group-chevron {
      transition: transform .15s ease;
    }

    .nav-group:not([open]) .nav-group-chevron {
      transform: rotate(-90deg);
    }

    body.viewer .viewer-write {
      display: none !important;
    }

    .nav-item:active {
      transform: translateY(1px);
    }

    .stat-card {
      transition: border-color .15s ease, background-color .15s ease;
    }

    button.stat-card:hover,
    .stat-card[onclick]:hover {
      border-color: color-mix(in srgb, var(--primary) 50%, transparent);
      background-color: var(--surface-container-high);
    }

    .stat-card:active {
      transform: translateY(1px);
    }

    /* Glossy visual layer: color is used as an information signal, not as
       decoration. The same accents remain readable in both themes. */
    #page-command-centre>div>section:first-child,
    #page-command-centre .stat-card,
    #page-command-centre .rounded-2xl,
    #page-command-centre .rounded-xl,
    #page-agents .agent-command-panel,
    #page-agents .team-outcome-details {
      position: relative;
      overflow: hidden;
      background-image: linear-gradient(135deg, rgba(255, 255, 255, .10), transparent 34%), linear-gradient(115deg, rgba(var(--glow-blue), .08), rgba(var(--glow-violet), .05) 48%, rgba(var(--glow-teal), .06));
      border-color: color-mix(in srgb, var(--gloss-border) 55%, var(--surface-variant));
      box-shadow: 0 10px 30px rgba(15, 23, 42, .06), inset 0 1px 0 var(--gloss-border);
    }

    .dark #page-command-centre>div>section:first-child,
    .dark #page-command-centre .stat-card,
    .dark #page-command-centre .rounded-2xl,
    .dark #page-command-centre .rounded-xl,
    .dark #page-agents .agent-command-panel,
    .dark #page-agents .team-outcome-details {
      background-image: linear-gradient(135deg, rgba(255, 255, 255, .07), transparent 32%), radial-gradient(circle at 100% 0%, rgba(var(--glow-violet), .15), transparent 38%), linear-gradient(115deg, rgba(var(--glow-blue), .08), rgba(var(--glow-teal), .04));
      box-shadow: 0 14px 40px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .12);
    }

    body {
      background-image: radial-gradient(circle at 8% 0%, rgba(var(--glow-blue), .08), transparent 28%), radial-gradient(circle at 92% 12%, rgba(var(--glow-violet), .07), transparent 24%);
    }

    .dark body {
      background-image: radial-gradient(circle at 8% 0%, rgba(var(--glow-blue), .14), transparent 30%), radial-gradient(circle at 92% 12%, rgba(var(--glow-violet), .12), transparent 28%);
    }

    #page-command-centre .stat-card:nth-child(1) {
      border-left: 3px solid rgb(var(--glow-teal));
    }

    #page-command-centre .stat-card:nth-child(2) {
      border-left: 3px solid rgb(var(--glow-violet));
    }

    #page-command-centre .stat-card:nth-child(3) {
      border-left: 3px solid rgb(var(--glow-blue));
    }

    #page-command-centre .stat-card:nth-child(4) {
      border-left: 3px solid rgb(var(--glow-amber));
    }

    #page-command-centre .stat-card:nth-child(5) {
      border-left: 3px solid var(--primary);
    }

    #page-command-centre .stat-card:nth-child(6) {
      border-left: 3px solid var(--tertiary);
    }

    #ccWork details,
    #ccSystem>div>div {
      transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    }

    #ccWork details:hover,
    #ccSystem>div>div:hover {
      transform: translateY(-2px);
      border-color: color-mix(in srgb, var(--primary) 55%, var(--surface-variant));
      box-shadow: 0 8px 24px rgba(var(--glow-blue), .12);
    }

    @media (prefers-reduced-motion: reduce) {

      #ccWork details,
      #ccSystem>div>div {
        transition: none;
      }
    }

    /* Fluid, content-adaptive layout (v6.2) */
    .auto-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      gap: 0.75rem;
    }

    .auto-grid>*,
    main * {
      min-width: 0;
    }

    .break-any {
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .card-flex {
      height: auto;
      min-height: 0;
    }

    iframe {
      max-width: 100%;
      border: 0;
    }

    #crmEmbed {
      width: 100%;
      height: min(74vh, 780px);
      min-height: 480px;
      display: block;
    }

    /* Native DOOM CRM surface: intentionally namespaced so it cannot collide with Mission Control. */
    .mc-crm {
      --crm-cyan: #0891b2;
      --crm-green: #10b981;
      --crm-red: #ef4444;
      --crm-amber: #f59e0b;
      --crm-wa: #25d366;
      position: relative;
      overflow: hidden;
    }

    .mc-crm-shell {
      background: linear-gradient(135deg, rgba(8, 145, 178, .08), transparent 34%), var(--surface-container-low, #f8fafc);
      border: 1px solid var(--surface-variant, #dbe4ea);
      border-radius: 20px;
    }

    .dark .mc-crm-shell,
    [data-theme="dark"] .mc-crm-shell {
      background: linear-gradient(135deg, rgba(8, 145, 178, .14), transparent 34%), var(--surface-container-low, #111827);
    }

    .mc-crm-grid {
      display: block;
    }

    #app>.flex-1,
    #app main {
      min-width: 0;
    }

    .mc-crm-grid,
    .mc-crm-board,
    #page-doom-sports {
      max-width: 100%;
      min-width: 0;
    }

    #crmViewControls {
      margin-bottom: 12px;
    }

    #crmViewControls button,
    .mc-crm-drawer button {
      min-height: 44px;
      padding: 8px 12px;
      border-radius: 9px;
    }

    #crmViewControls button[aria-pressed="true"] {
      background: var(--primary);
      color: var(--on-primary);
    }

    .crm-filter-label {
      display: block;
      margin: 0 0 4px;
      font-size: 12px; line-height: 1.4;
      color: var(--on-surface-variant);
    }

    .mc-crm-board.mc-crm-list {
      display: flex;
      flex-direction: column;
      overflow: visible;
    }

    .mc-crm-list .mc-crm-col {
      width: 100%;
      min-height: 0;
    }

    .mc-crm-list .mc-crm-col:has(.mc-crm-col-body > div:only-child) {
      display: none;
    }

    .mc-crm-list .mc-crm-card {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .mc-crm-list .mc-crm-card h4 {
      margin: 0;
      grid-column: 1;
    }

    .mc-crm-list .mc-crm-person {
      margin: 0;
      grid-column: 1;
    }

    .mc-crm-list .mc-crm-preview {
      grid-column: 2;
      grid-row: 1 / span 3;
      min-height: 0;
    }

    .mc-crm-list .mc-crm-card-footer {
      grid-column: 1 / -1;
      margin: 0;
    }

    .mc-crm-drawer input {
      background: var(--surface-container);
      color: var(--on-surface);
      padding: 8px;
      margin: 5px 0;
    }

    .mc-crm-board {
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: minmax(250px, 280px);
      gap: 12px;
      overflow-x: auto;
      padding: 2px 2px 8px;
      align-items: start;
    }

    .mc-crm-col {
      min-height: 190px;
      background: color-mix(in srgb, var(--surface-container, #fff) 88%, transparent);
      border: 1px solid var(--surface-variant, #dbe4ea);
      border-radius: 16px;
      overflow: hidden;
    }

    .mc-crm-col-head {
      padding: 11px 12px;
      border-bottom: 1px solid var(--surface-variant, #dbe4ea);
      display: flex;
      justify-content: space-between;
      gap: 8px;
      font-size: 11px;
      font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    .mc-crm-col-body {
      padding: 9px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .mc-crm-card {
      background: var(--surface-container, #fff);
      border: 1px solid var(--surface-variant, #dbe4ea);
      border-left: 3px solid var(--crm-cyan);
      border-radius: 13px;
      padding: 11px;
      cursor: pointer;
      transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    }

    .mc-crm-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 22px rgba(8, 145, 178, .12);
      border-color: var(--crm-cyan);
    }

    .mc-crm-card.urgent {
      border-left-color: var(--crm-red);
    }

    .mc-crm-card.priority {
      border-left-color: var(--crm-amber);
    }

    .mc-crm-card {
      padding: 14px;
      font-size: 13px; line-height: 1.45;
      color: var(--on-surface, #172033);
    }

    .mc-crm-card h4 {
      font-size: 15px; font-weight: 700; line-height: 1.3;
      margin: 9px 0 12px;
      overflow-wrap: break-word;
    }

    .mc-crm-card:focus-visible {
      outline: 2px solid var(--crm-cyan);
      outline-offset: 3px;
    }

    .mc-crm-person {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 12px;
    }

    .mc-crm-person .initials {
      display: grid;
      place-items: center;
      flex: 0 0 30px;
      height: 30px;
      border-radius: 50%;
      background: rgba(8, 145, 178, .14);
      font-weight: 700;
    }

    .mc-crm-person small {
      display: block;
      opacity: .7;
      font-size: 11px;
    }

    .mc-crm-preview {
      border-radius: 9px;
      padding: 10px;
      background: var(--surface-container-high, #edf2f7);
      min-height: 78px;
    }

    .mc-crm-preview small {
      display: block;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: .04em;
      margin-bottom: 5px;
      opacity: .7;
    }

    .mc-crm-preview p {
      margin: 0;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      overflow-wrap: anywhere;
      font-size: 12px;
    }

    .mc-crm-card-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      margin-top: 12px;
    }

    .mc-crm-card-footer button {
      min-height: 40px;
      padding: 6px 10px;
      border-radius: 8px;
      background: rgba(8, 145, 178, .12);
      color: inherit;
      font-weight: 600;
    }

    .mc-crm-card-footer time {
      font-size: 11px;
      opacity: .7;
    }

    .mc-crm-contact {
      background: linear-gradient(135deg, rgba(8, 145, 178, .12), rgba(16, 185, 129, .08));
      border: 1px solid rgba(8, 145, 178, .28);
      border-radius: 16px;
      padding: 14px;
    }

    .mc-crm-avatar {
      width: 42px;
      height: 42px;
      border-radius: 13px;
      display: grid;
      place-items: center;
      background: linear-gradient(135deg, #0891b2, #14b8a6);
      color: white;
      font-weight: 800;
    }

    .mc-crm-drawer {
      position: fixed;
      top: 72px;
      right: 18px;
      width: min(420px, calc(100vw - 36px));
      max-height: calc(100vh - 96px);
      overflow: auto;
      z-index: 40;
      transform: translateX(calc(100% + 28px));
      opacity: 0;
      pointer-events: none;
      box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
      transition: transform .24s cubic-bezier(.16, 1, .3, 1), opacity .18s ease;
    }

    .mc-crm-drawer.mc-crm-open {
      transform: translateX(0);
      opacity: 1;
      pointer-events: auto;
    }

    .mc-crm-pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      max-width: 100%;
      padding: 5px 9px;
      border-radius: 999px;
      font: 600 11px/1.3 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
      white-space: normal;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .mc-crm-pill.cyan {
      background: rgba(8, 145, 178, .13);
      color: #0e7490;
    }

    .mc-crm-pill.green {
      background: rgba(16, 185, 129, .14);
      color: #047857;
    }

    .mc-crm-pill.red {
      background: rgba(239, 68, 68, .14);
      color: #b91c1c;
    }

    .mc-crm-pill.amber {
      background: rgba(245, 158, 11, .16);
      color: #b45309;
    }

    .mc-crm-pill.wa {
      background: rgba(37, 211, 102, .16);
      color: #128c45;
    }

    .mc-crm-pill.tag-cyan {
      background: rgba(14, 165, 233, .14);
      color: #0369a1;
    }

    .mc-crm-pill.tag-green {
      background: rgba(34, 197, 94, .14);
      color: #15803d;
    }

    .mc-crm-pill.tag-amber {
      background: rgba(245, 158, 11, .16);
      color: #a16207;
    }

    .mc-crm-pill.tag-purple {
      background: rgba(139, 92, 246, .14);
      color: #6d28d9;
    }

    .mc-crm-pill.tag-slate {
      background: rgba(100, 116, 139, .14);
      color: #475569;
    }

    #mcCrmFilters,
    #mcCrmTagFilters,
    #mcAgencyStageFilters {
      flex-wrap: nowrap;
    }

    #mcCrmTagFilters {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      overflow: visible;
    }

    #mcCrmTagFilters select {
      min-width: 0;
      width: 100%;
      appearance: auto;
    }

    #mcCrmTagFilters select {
      min-height: 44px;
      border-radius: 10px;
      font-size: 13px; line-height: 1.4;
    }

    @media(max-width:480px) {
      #mcCrmTagFilters {
        grid-template-columns: 1fr;
      }
    }

    #mcCrmFilters>button,
    #mcCrmTagFilters>button,
    #mcAgencyStageFilters>button {
      flex: 0 0 auto;
      width: max-content;
      min-width: max-content;
      white-space: nowrap;
    }

    .dark .mc-crm-pill.cyan,
    [data-theme="dark"] .mc-crm-pill.cyan {
      color: #67e8f9;
    }

    .dark .mc-crm-pill.green,
    [data-theme="dark"] .mc-crm-pill.green {
      color: #6ee7b7;
    }

    .dark .mc-crm-pill.red,
    [data-theme="dark"] .mc-crm-pill.red {
      color: #fca5a5;
    }

    .dark .mc-crm-pill.amber,
    [data-theme="dark"] .mc-crm-pill.amber {
      color: #fcd34d;
    }

    @media (max-width:1100px) {
      .mc-crm-drawer {
        top: 64px;
        right: 12px;
        width: min(400px, calc(100vw - 24px));
        max-height: calc(100vh - 80px);
      }
    }

    @media (max-width:760px) {
      .mc-crm-shell {
        padding: 12px !important;
        border-radius: 14px;
      }

      .mc-crm-grid {
        display: block;
      }

      .mc-crm-board {
        display: grid;
        grid-auto-flow: row;
        grid-template-columns: 1fr;
        gap: 10px;
        overflow: visible;
        padding: 0;
      }

      .mc-crm-board {
        grid-auto-columns: auto;
      }

      .mc-crm-col {
        min-width: 0;
        width: 100%;
      }

      .mc-crm-col-body {
        padding: 8px;
      }

      .mc-crm-card {
        padding: 12px;
        width: 100%;
        min-width: 0;
      }

      .mc-crm-card .font-body-sm {
        font-size: 14px;
        line-height: 1.25;
      }

      .mc-crm-card .mc-crm-pill {
        max-width: 48%;
      }

      .mc-crm-list .mc-crm-card .mc-crm-pill {
        max-width: 100%;
        overflow-wrap: normal;
        word-break: normal;
              }

      .mc-crm-drawer {
        top: 58px;
        right: 8px;
        width: calc(100vw - 16px);
        max-height: calc(100vh - 70px);
      }

      #mcCrmSearch {
        min-width: 0;
        width: 100%;
      }
    }

    .mob-only {
      display: none;
    }

    @media (max-width: 767px) {
      #sidebar {
        transform: translateX(-100%);
        transition: transform .25s cubic-bezier(.16, 1, .3, 1);
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
      }

      #sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, .5);
        z-index: 60 !important;
      }

      #sidebarOverlay {
        z-index: 55 !important;
      }

      main {
        padding: calc(3.5rem + 0.85rem) 1rem calc(5.25rem + env(safe-area-inset-bottom)) !important;
      }

      /* kill flex min-width:auto overflow - a flex child can otherwise stretch past the viewport */
      html,
      body {
        max-width: 100%;
        overflow-x: hidden;
      }

      #app,
      #app>div,
      #app>div>main,
      .page-view {
        min-width: 0 !important;
        max-width: 100% !important;
      }

      .page-view>div,
      .page-view>section {
        min-width: 0 !important;
        max-width: 100% !important;
      }

      .overflow-x-auto {
        max-width: 100%;
      }

      .desk-only {
        display: none !important;
      }

      .mob-only {
        display: flex;
      }

      .auto-grid {
        grid-template-columns: 1fr !important;
      }

      section,
      .stat-card,
      .card-flex,
      [class*="grid"]>* {
        height: auto !important;
        min-height: 0 !important;
      }

      .font-headline-xl {
        font-size: clamp(1.3rem, 6vw, 1.9rem) !important;
      }

      .font-headline-lg {
        font-size: clamp(1.05rem, 5vw, 1.5rem) !important;
      }

      .font-headline-sm {
        font-size: clamp(0.95rem, 4vw, 1.15rem) !important;
      }

      .font-body-md {
        font-size: clamp(0.82rem, 3.6vw, 0.95rem) !important;
      }

      .font-body-sm {
        font-size: clamp(0.78rem, 3.4vw, 0.9rem) !important;
      }

      .font-label-md {
        font-size: clamp(0.72rem, 3vw, 0.85rem) !important;
      }

      p,
      span,
      div {
        overflow-wrap: anywhere;
      }

      /* Only .desk-only tables hide on mobile; plain tables remain available. */
      iframe {
        height: 72vh !important;
        min-height: 430px !important;
      }

      .stat-card .font-headline-lg {
        font-size: 1.35rem;
        line-height: 1.6rem;
      }

      input,
      select {
        font-size: 16px !important;
      }
    }


    body:not(.authed) #sidebarOverlay,
    body:not(.authed) #toast {
      display: none !important;
    }

    .skel {
      background: linear-gradient(90deg, var(--surface-container) 25%, var(--surface-container-high) 37%, var(--surface-container) 63%);
      background-size: 400% 100%;
      animation: shimmer 1.4s ease infinite;
      border-radius: 8px;
    }

    @keyframes shimmer {
      0% {
        background-position: 100% 0;
      }

      100% {
        background-position: 0 0;
      }
    }

    .stat-card {
      transition: transform .15s ease, border-color .15s ease;
    }

    .stat-card:hover {
      transform: translateY(-1px);
      border-color: var(--primary);
    }

    @media (prefers-reduced-motion: reduce) {

      *,
      *::before,
      *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
      }
    }

    .mc-qty-unknown {
      font-size: .72rem;
      padding: 2px 6px;
      border-radius: 999px;
      border: 1px dashed var(--outline);
      color: var(--on-surface-variant)
    }

    .mc-chip {
      display: inline-block;
      font-size: .7rem;
      padding: 2px 7px;
      border-radius: 999px;
      border: 1px solid var(--outline);
      color: var(--on-surface-variant)
    }

    .mc-chip-warn {
      border-style: dashed;
      color: #9a6b00
    }
  
