/* The new desktop workspace is an alternate projection of the same DOM and
   API commands. Keeping the selectors under html.new-ui makes /classic a
   reliable, byte-for-byte functional fallback. */
@media (min-width: 600px) {
  html.new-ui {
    --new-nav-width: 17.5rem;
    --new-surface: #fff;
    --new-soft: #f2f5f1;
    --new-accent: #1f6049;
  }

  html.new-ui .app-shell {
    grid-template-columns: var(--new-nav-width) minmax(0, 1fr);
  }

  html.new-ui .side-nav {
    width: var(--new-nav-width);
    padding: 1rem;
    gap: 0.6rem;
    overflow: hidden auto;
  }

  html.new-ui .side-brand {
    grid-template-columns: 2.75rem 1fr;
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
  }

  html.new-ui .new-nav-caption {
    margin: 0 0.75rem 0.2rem;
    color: rgb(239 247 243 / 62%);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  html.new-ui .new-primary-navigation {
    display: grid;
    gap: 0.35rem;
  }

  html.new-ui .new-workspace-link {
    min-height: 3.35rem;
    padding: 0.75rem;
    border: 1px solid transparent;
    border-radius: 0.85rem;
    font-size: 1rem;
  }

  html.new-ui .new-workspace-link.active {
    border-color: rgb(255 255 255 / 18%);
    background: rgb(255 255 255 / 16%);
    box-shadow: inset 3px 0 #a9d8c4;
  }

  html.new-ui .new-nav-icon {
    display: grid;
    width: 1.7rem;
    place-items: center;
    font-size: 1rem;
  }

  html.new-ui .new-nav-help {
    display: grid;
    gap: 0.2rem;
    margin-top: auto;
    padding: 0.85rem;
    border-radius: 0.8rem;
    color: rgb(239 247 243 / 74%);
    background: rgb(255 255 255 / 7%);
    font-size: 0.78rem;
    line-height: 1.35;
  }

  html.new-ui .new-classic-link {
    padding: 0.5rem 0.75rem;
    color: rgb(239 247 243 / 68%);
    font-size: 0.78rem;
    text-decoration: none;
  }

  html.new-ui .new-legacy-pipeline {
    margin-top: 0.15rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgb(255 255 255 / 12%);
  }

  html.new-ui .new-legacy-pipeline summary {
    display: flex;
    align-items: center;
    min-height: 2.65rem;
    gap: 0.45rem;
    padding: 0.4rem 0.65rem;
    border-radius: 0.7rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 750;
    list-style: none;
  }

  html.new-ui .new-legacy-pipeline summary::-webkit-details-marker {
    display: none;
  }

  html.new-ui .new-legacy-pipeline summary::after {
    margin-left: auto;
    content: "⌄";
    transition: transform 160ms ease;
  }

  html.new-ui .new-legacy-pipeline:not([open]) summary::after {
    transform: rotate(-90deg);
  }

  html.new-ui .new-legacy-pipeline summary:hover {
    background: rgb(255 255 255 / 14%);
  }

  html.new-ui .new-legacy-pipeline-links {
    display: grid;
    gap: 0.1rem;
    padding: 0.15rem 0 0.2rem 0.65rem;
  }

  html.new-ui .new-legacy-pipeline-links .nav-link {
    min-height: 2.45rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.88rem;
  }

  html.new-ui .topbar {
    padding: 1rem clamp(1.25rem, 3vw, 2.5rem);
  }

  html.new-ui #main {
    width: 100%;
    max-width: none;
    padding: 1.25rem clamp(1.25rem, 3vw, 2.5rem) 3rem;
  }

  html.new-ui .new-workspace-tabs {
    position: sticky;
    top: 0;
    z-index: 11;
    display: flex;
    gap: 0.35rem;
    margin: -0.35rem 0 1.25rem;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: rgb(247 245 239 / 96%);
    backdrop-filter: blur(12px);
  }

  html.new-ui .new-workspace-tabs a {
    padding: 0.65rem 0.9rem;
    border-radius: 0.6rem;
    color: var(--muted);
    font-weight: 750;
    text-decoration: none;
  }

  html.new-ui .new-workspace-tabs a.active {
    color: #fff;
    background: var(--forest);
  }

  html.new-ui .panel,
  html.new-ui .workflow-section,
  html.new-ui .data-view,
  html.new-ui .table-shell {
    border-radius: 0.85rem;
    box-shadow: none;
  }

  html.new-ui .card-list,
  html.new-ui .schedule-list {
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    background: var(--new-surface);
  }

  html.new-ui .card-list > article,
  html.new-ui .schedule-list > article,
  html.new-ui .workflow-card {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 1rem 1.15rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
  }

  html.new-ui .card-list > article:last-child,
  html.new-ui .schedule-list > article:last-child,
  html.new-ui .workflow-card:last-child {
    border-bottom: 0;
  }

  html.new-ui .item-actions,
  html.new-ui .actions {
    justify-content: flex-end;
  }

  html.new-ui .new-labelled-action {
    width: auto;
    min-width: max-content;
    gap: 0.35rem;
    padding-inline: 0.7rem;
  }

  html.new-ui .new-action-label {
    font-size: 0.78rem;
    font-weight: 750;
  }

  html.new-ui .data-table .cell-actions {
    width: auto;
    min-width: 24rem;
    white-space: normal;
  }

  html.new-ui .data-table .cell-actions .actions,
  html.new-ui .data-table .cell-actions .item-actions {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  html.new-ui .data-table .cell-actions .table-icon-action.new-labelled-action {
    display: inline-flex;
    width: auto;
    min-width: max-content;
    padding-inline: 0.7rem;
  }

  html.new-ui .pipeline-table .pipeline-actions-column {
    width: 8.75rem;
    min-width: 8.75rem;
    white-space: nowrap;
  }

  html.new-ui .pipeline-table .pipeline-icon-button {
    width: 2.125rem;
    min-width: 2.125rem;
    min-height: 2.125rem;
    padding: 0;
  }

  html.new-ui .payment-allocation-details {
    margin-top: 0.6rem;
    font-size: 0.82rem;
  }

  html.new-ui .allocation-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-top: 1px solid var(--line);
  }

  html.new-ui #form-dialog {
    width: min(44rem, calc(100vw - var(--new-nav-width)));
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0 0 0 auto;
    border-radius: 1rem 0 0 1rem;
  }

  html.new-ui #form-dialog[open] {
    animation: new-drawer-in 160ms ease-out;
  }

  html.new-ui #dialog-form {
    min-height: 100%;
  }

  html.new-ui .dialog-actions {
    position: sticky;
    bottom: 0;
    padding-block: 0.8rem;
    background: #fff;
  }

  @keyframes new-drawer-in {
    from {
      transform: translateX(2rem);
      opacity: 0;
    }
  }
}
