@layer components {
  .workspace-catalog-shell {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 3rem 0 5rem;
    display: grid;
    gap: 2.5rem;
  }

  .workspace-catalog-heading,
  .workspace-card-heading,
  .workspace-create-row,
  .workspace-switcher-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .workspace-catalog-heading h1,
  .workspace-create-panel h2,
  .workspace-catalog-shell h2 {
    margin: 0.2rem 0 0.45rem;
  }

  .workspace-catalog-heading p,
  .workspace-create-panel p,
  .workspace-empty-state p {
    color: var(--text-muted);
    margin: 0;
  }

  .workspace-catalog-eyebrow {
    color: var(--accent) !important;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .workspace-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
  }

  .workspace-catalog-card,
  .workspace-create-panel,
  .workspace-empty-state {
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--bg-raised);
  }

  .workspace-catalog-card {
    color: inherit;
    padding: 1.1rem;
    display: grid;
    gap: 0.65rem;
    text-decoration: none;
  }

  .workspace-catalog-card:hover,
  .workspace-catalog-card:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
  }

  .workspace-catalog-card code,
  .workspace-catalog-card small,
  .workspace-repository-summary small {
    color: var(--text-muted);
  }

  .workspace-card-heading > span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
  }

  .workspace-card-heading > .workspace-state-active {
    border-color: color-mix(in srgb, var(--success) 50%, var(--line));
    color: var(--success);
  }

  .workspace-repository-summary {
    display: grid;
    gap: 0.2rem;
  }

  .workspace-empty-state {
    padding: 1.5rem;
    margin-top: 1rem;
  }

  .workspace-create-panel {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.3fr);
    gap: 2rem;
  }

  .workspace-create-panel form {
    display: grid;
    gap: 1rem;
  }

  .workspace-create-panel label {
    display: grid;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.8rem;
  }

  .workspace-create-panel input,
  .workspace-switcher select {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 0.45rem;
    background: var(--bg);
    color: var(--text);
    padding: 0.65rem 0.75rem;
    font: inherit;
  }

  .workspace-create-row > label {
    flex: 1;
  }

  .workspace-primary-action,
  .workspace-secondary-action {
    border-radius: 0.45rem;
    padding: 0.65rem 0.9rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
  }

  .workspace-primary-action {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--bg);
  }

  .workspace-secondary-action {
    border: 1px solid var(--line);
    background: var(--bg-raised);
    color: var(--text);
  }

  .workspace-primary-action:disabled,
  .workspace-secondary-action:disabled {
    opacity: 0.55;
    cursor: wait;
  }

  .workspace-catalog-alert {
    border-left: 3px solid var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, transparent);
    padding: 0.75rem 0.9rem;
    color: var(--text);
  }

  .workspace-switcher {
    display: grid;
    gap: 0.45rem;
    padding: 0 0.75rem 0.85rem;
    border-bottom: 1px solid var(--line);
  }

  .workspace-switcher label {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
  }

  .workspace-switcher select {
    width: 100%;
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
  }

  .workspace-switcher-actions {
    display: flex;
    gap: 0.75rem;
    font-size: 0.72rem;
  }

  .workspace-switcher-error {
    color: var(--danger);
    font-size: 0.7rem;
  }

  @media (max-width: 760px) {
    .workspace-create-panel {
      grid-template-columns: 1fr;
    }

    .workspace-create-row,
    .workspace-catalog-heading {
      align-items: stretch;
      flex-direction: column;
    }
  }
}
