/* Desktop layout authority loaded after the core OS theme. */

/*
 * The overview uses a dark operational surface, while the core OS stylesheet
 * also supports light portfolio cards. Keep the dark overview's content
 * explicit so later light-theme inheritance cannot reduce card contrast.
 */
body.meshline-os-v2 #dashboardScreen .workspace-project-card {
  color: #eef4ff;
}

body.meshline-os-v2 #dashboardScreen .workspace-project-card-state,
body.meshline-os-v2 #dashboardScreen .workspace-project-progress-head,
body.meshline-os-v2 #dashboardScreen .workspace-project-footer {
  color: rgba(214, 226, 250, 0.76);
}

body.meshline-os-v2 #dashboardScreen .workspace-project-copy > strong,
body.meshline-os-v2 #dashboardScreen .workspace-project-progress-head strong,
body.meshline-os-v2 #dashboardScreen .workspace-project-stat strong {
  color: #f7f9ff;
}

body.meshline-os-v2 #dashboardScreen .workspace-project-description,
body.meshline-os-v2 #dashboardScreen .workspace-project-stat span {
  color: rgba(207, 219, 245, 0.72);
}

body.meshline-os-v2 #dashboardScreen .workspace-project-flow span {
  color: rgba(197, 214, 246, 0.68);
}

body.meshline-os-v2 #dashboardScreen .workspace-project-flow i {
  border-color: rgba(141, 174, 235, 0.24);
  color: rgba(222, 235, 255, 0.82);
  background: #0b1630;
}

body.meshline-os-v2 #dashboardScreen .workspace-project-flow span.is-ready {
  color: rgba(234, 246, 255, 0.9);
}

body.meshline-os-v2 #dashboardScreen .workspace-project-flow span.is-ready i {
  border-color: rgba(88, 230, 178, 0.34);
  color: #dffff2;
  background: rgba(88, 230, 178, 0.11);
}

body.meshline-os-v2 #dashboardScreen .workspace-project-connection-row span {
  color: #f2c988;
}

body.meshline-os-v2 #dashboardScreen .workspace-project-connection-row span.is-connected {
  color: #b8f7dc;
}

body.meshline-os-v2 #dashboardScreen .workspace-project-menu {
  color: rgba(224, 235, 255, 0.76);
}

@media (min-width: 1181px) {
  body.meshline-os-v2 #loginScreen .auth-entry-card-classic,
  body.meshline-os-v2 #loginScreen .auth-form-grid,
  body.meshline-os-v2 #loginScreen .auth-form-grid .field {
    min-width: 0;
    max-width: 100%;
  }

  body.meshline-os-v2 #loginScreen .auth-entry-card-classic {
    grid-template-columns: minmax(0, 1fr) !important;
    overflow: hidden;
  }

  body.meshline-os-v2 #loginScreen .auth-entry-card-classic .helper-text {
    white-space: normal;
  }

  body.meshline-os-v2 #loginScreen .auth-form-grid input,
  body.meshline-os-v2 #loginScreen .auth-form-grid button,
  body.meshline-os-v2 #loginScreen .full-button {
    width: 100%;
    max-width: 100%;
  }

  body.meshline-os-v2 #loginScreen .auth-text-button {
    justify-self: end;
    width: auto !important;
    max-width: max-content;
    min-height: 32px;
    padding: 4px 0;
    border: 0;
    color: #355dcc;
    background: transparent !important;
    box-shadow: none;
  }

  body.meshline-os-v2 #loginScreen .auth-divider {
    margin: 10px 0;
    color: var(--os-muted);
    background: transparent !important;
  }

  body.meshline-os-v2 #loginScreen .auth-divider::before {
    background: #e0e3de !important;
  }

  body.meshline-os-v2 #loginScreen .auth-divider span {
    padding-inline: 12px;
    color: var(--os-muted) !important;
    background: #fff !important;
  }

  body.meshline-os-v2 .workspace-header {
    grid-template-columns: minmax(128px, 0.48fr) minmax(350px, 1fr) max-content !important;
    gap: 12px !important;
  }

  body.meshline-os-v2 .workspace-header-actions {
    min-width: 0;
    gap: 7px;
  }

  body.meshline-os-v2 .workspace-route-chip { width: 100%; }

  body.meshline-os-v2 .workspace-user-pill {
    width: 146px;
    max-width: 146px;
  }

  body.meshline-os-v2 .workspace-user-copy,
  body.meshline-os-v2 .workspace-user-copy strong {
    min-width: 0;
    overflow: hidden;
  }

  body.meshline-os-v2 .workspace-user-copy strong {
    display: block;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .workspace-user-copy { display: none !important; }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .workspace-route-chip {
    width: max-content;
    max-width: min(440px, 100%);
  }

  body.meshline-os-v2 #agentScreen .agent-studio-overview-shell .panel-head.compact {
    align-items: flex-start;
    gap: 16px;
  }

  body.meshline-os-v2 #agentScreen .agent-studio-overview-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  body.meshline-os-v2 #agentScreen .agent-studio-module-catalog,
  body.meshline-os-v2 #agentScreen .workspace-project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  body.meshline-os-v2 #agentScreen .agent-studio-module-card {
    grid-template-rows: auto auto 1fr;
    min-height: 244px !important;
  }

  body.meshline-os-v2 #agentScreen .agent-studio-module-catalog > .agent-studio-module-card:only-child {
    grid-column: 1 / -1;
  }

  body.meshline-os-v2 #agentScreen .agent-studio-module-catalog > .agent-studio-module-card:only-child .agent-studio-module-foot {
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.5fr) !important;
    align-items: end;
  }

  body.meshline-os-v2 #agentScreen .agent-studio-module-card--create {
    position: relative;
    isolation: isolate;
  }

  body.meshline-os-v2 #agentScreen .agent-studio-module-card--create::after {
    position: absolute;
    z-index: 0;
    right: 28px;
    bottom: 24px;
    width: 126px;
    height: 76px;
    border: 1px solid rgba(45, 132, 103, 0.14);
    border-radius: 18px;
    content: "";
    background:
      radial-gradient(circle at 20% 50%, #52c7d8 0 4px, transparent 5px),
      radial-gradient(circle at 50% 22%, #7187e9 0 4px, transparent 5px),
      radial-gradient(circle at 80% 50%, #8b6bea 0 4px, transparent 5px),
      linear-gradient(rgba(68, 146, 121, 0.16), rgba(68, 146, 121, 0.16)) 25% 50% / 52% 1px no-repeat,
      linear-gradient(135deg, rgba(70, 181, 198, 0.1), rgba(112, 101, 225, 0.08));
    opacity: 0.85;
    pointer-events: none;
  }

  body.meshline-os-v2 #agentScreen .agent-studio-module-card--create > * {
    position: relative;
    z-index: 1;
  }

  body.meshline-os-v2 #agentScreen .agent-studio-module-foot {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-content: end;
    align-items: stretch;
    gap: 10px !important;
    width: 100%;
    min-width: 0;
  }

  body.meshline-os-v2 #agentScreen .agent-studio-module-status,
  body.meshline-os-v2 #agentScreen .agent-studio-module-summary-row,
  body.meshline-os-v2 #agentScreen .marketing-project-card-actions {
    width: 100%;
    min-width: 0;
  }

  body.meshline-os-v2 #agentScreen .agent-studio-module-status {
    display: grid;
    gap: 4px;
    padding: 10px 11px;
    border: 1px solid #e0e3de;
    border-radius: 8px;
  }

  body.meshline-os-v2 #agentScreen .agent-studio-module-summary-row {
    padding: 0 2px;
    border: 0 !important;
    background: transparent !important;
  }

  body.meshline-os-v2 #agentScreen .marketing-project-card-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
  }

  body.meshline-os-v2 #agentScreen .marketing-project-card-actions .primary-button,
  body.meshline-os-v2 #agentScreen .marketing-project-card-actions .secondary-button {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .agent-workspace-shell[data-layout="marketing-minimal"] {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .agent-operations-shell { grid-template-columns: 1fr; }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-queue-empty {
    grid-template-columns: 106px minmax(220px, 1fr) max-content;
  }

  body.meshline-os-v2 #reportsScreen .signals-glance-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  body.meshline-os-v2 #reportsScreen .signals-glance-strip > :last-child {
    grid-column: auto !important;
  }

  body.meshline-os-v2 #reportsScreen .report-range-context {
    flex-wrap: nowrap;
  }

  body.meshline-os-v2 #reportsScreen .report-compare-toggle {
    white-space: nowrap;
  }
}

@media (min-width: 1181px) and (max-width: 1599px) {
  body.meshline-os-v2 .desktop-operator-tools button {
    width: 32px;
    min-width: 32px;
    justify-content: center;
    padding-inline: 5px;
  }

  body.meshline-os-v2 .desktop-operator-tools button strong,
  body.meshline-os-v2 .desktop-operator-tools button kbd { display: none !important; }

  body.meshline-os-v2 .desktop-operator-tools [data-desktop-command-open] {
    width: auto;
    padding-inline: 8px;
  }

  body.meshline-os-v2 .desktop-operator-tools [data-desktop-command-open] strong {
    display: block !important;
  }

  body.meshline-os-v2 .workspace-user-shell,
  body.meshline-os-v2 .workspace-user-pill {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
  }

  body.meshline-os-v2 .workspace-user-pill {
    grid-template-columns: 28px;
    justify-content: center;
    padding: 3px;
  }

  body.meshline-os-v2 .workspace-user-copy {
    display: none !important;
  }

  body.meshline-os-v2 .workspace-utility-pill span {
    overflow: visible;
    font-size: 0.54rem !important;
    text-overflow: clip;
  }

  body.meshline-os-v2 button.workspace-utility-pill {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto;
    align-content: center;
    justify-items: start;
    gap: 1px !important;
  }

  body.meshline-os-v2 button.workspace-utility-pill span,
  body.meshline-os-v2 button.workspace-utility-pill strong {
    width: 100%;
    text-align: left;
  }
}

@media (min-width: 1600px) {
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .agent-operations-shell {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  }

  body.meshline-os-v2 #agentScreen .agent-studio-module-catalog,
  body.meshline-os-v2 #agentScreen .workspace-project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Marshy control room release QA — one command surface, one accent system. */
@media (min-width: 761px) {
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode {
    --marshy-cyan: #19a9c8;
    --marshy-violet: #6f61de;
    --marshy-violet-soft: #f0eefe;
    --marshy-cyan-soft: #eaf8fb;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode #marketingMinimalHero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.72fr);
    gap: 18px;
    min-width: 0;
    padding: 18px 20px;
    border: 1px solid #d9dce8;
    border-radius: 16px;
    color: #182130;
    background:
      radial-gradient(circle at 100% 0%, rgba(111, 97, 222, 0.11), transparent 34%),
      radial-gradient(circle at 0% 100%, rgba(25, 169, 200, 0.09), transparent 36%),
      linear-gradient(145deg, #ffffff, #f7f8fc);
    box-shadow: 0 14px 34px rgba(24, 33, 48, 0.08);
    overflow: hidden;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-minimal-hero-copy,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-minimal-hero-actions,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .agent-operations-shell,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .agent-queue-panel,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .agent-review-panel {
    min-width: 0;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-minimal-hero-copy h3 {
    color: #182130;
    font-size: clamp(1.25rem, 1.7vw, 1.7rem);
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-minimal-hero-copy .eyebrow {
    color: var(--marshy-cyan);
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-minimal-hero-copy .helper-text {
    display: block !important;
    color: #657080;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-minimal-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-minimal-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    align-self: stretch;
    justify-items: stretch;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-minimal-hero-actions .pill {
    grid-column: 1 / -1;
    justify-content: center;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-minimal-hero-actions .primary-button,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-minimal-hero-actions .secondary-button {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.76rem;
    white-space: nowrap;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode #marketingHeroRunBtn {
    grid-column: 1 / -1;
    border-color: #5d52c7;
    background: linear-gradient(135deg, #248dac, #6f61de);
    box-shadow: 0 8px 18px rgba(79, 72, 185, 0.2);
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode #agentQueueRecentRunsBtn,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode #agentQueueRecentPublishedBtn,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode #agentQueueRunWorkflowBtn {
    display: none !important;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .agent-operations-shell {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .agent-queue-panel,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .agent-review-panel,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-published-panel,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .agent-workflow-panel {
    position: relative;
    border-top: 3px solid var(--marshy-violet) !important;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #fbfbfe);
    box-shadow: 0 10px 26px rgba(26, 34, 55, 0.065);
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .panel-head .eyebrow,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-panel-head .eyebrow {
    color: #1687a2;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-panel-head-actions {
    min-width: 0;
    flex: 0 1 auto;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-queue-empty,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-review-empty,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-published-empty {
    border-color: #dcdde8;
    background: linear-gradient(135deg, #fafbfe, #f6f4fd);
  }
}

@media (min-width: 1400px) {
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .workspace-user-shell,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .workspace-user-pill {
    width: 176px !important;
    min-width: 176px !important;
    max-width: 176px !important;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .workspace-user-pill {
    grid-template-columns: minmax(0, 1fr) 30px !important;
    gap: 8px;
    justify-content: stretch;
    padding: 4px 6px 4px 10px !important;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .workspace-user-copy {
    display: grid !important;
    text-align: left;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .workspace-user-copy strong {
    color: #27313c !important;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .workspace-user-copy small {
    color: #7b8491 !important;
  }
}

@media (min-width: 1500px) {
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .agent-operations-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-queue-empty {
    grid-template-columns: 94px minmax(0, 1fr);
    grid-template-areas:
      "steps title"
      "steps description"
      "steps summary"
      "actions actions";
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-queue-empty .agent-queue-empty-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-queue-empty .agent-queue-empty-actions button {
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 761px) and (max-width: 1399px) {
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode #marketingMinimalHero {
    grid-template-columns: 1fr;
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-minimal-hero-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.meshline-os-v2 #agentScreen.marketing-minimal-mode .marketing-minimal-hero-actions .pill,
  body.meshline-os-v2 #agentScreen.marketing-minimal-mode #marketingHeroRunBtn {
    grid-column: auto;
  }
}
