/* Desktop-only layout authority loaded after the core OS theme. */
@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;
  }
}
