/* Therapist workspace (C3) — dense, calm, professional. Cloudflare-dashboard
   clarity, not art: rows, states, actions. Layered like the fleet. */

  .workspace-main {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 20px 96px;
  }

  .workspace-title {
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    margin: 0 0 6px;
  }

  .workspace-lede {
    color: color-mix(in srgb, currentColor 62%, transparent);
    margin: 0 0 36px;
  }

  .workspace-section {
    margin: 0 0 44px;
  }

  .workspace-section > h2 {
    font-size: 1.15rem;
    margin: 0 0 12px;
  }

  .workspace-signin-prompt {
    border: 1px dashed color-mix(in srgb, currentColor 30%, transparent);
    border-radius: 14px;
    padding: 36px 24px;
    text-align: center;
  }

  /* ---- builder ---- */
  .builder-form {
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    border-radius: 14px;
    padding: 18px;
    display: grid;
    gap: 12px;
  }

  .builder-label {
    font-size: 0.85rem;
    font-weight: 600;
  }

  .builder-input,
  .builder-select {
    font: inherit;
    padding: 8px 12px;
    border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    max-width: 100%;
  }

  .builder-fields {
    display: grid;
    gap: 10px;
  }

  .builder-field {
    border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    border-radius: 10px;
    padding: 12px;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;

    & .builder-field-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;

      & .builder-input { flex: 1 1 160px; }
    }

    & .builder-options {
      font: 0.85rem/1.5 ui-monospace, monospace;
      padding: 8px 10px;
    }

    & .builder-remove {
      margin-inline-start: auto;
    }
  }

  .builder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .intake-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;

    & .builder-input { flex: 1 1 200px; }
  }

  /* ---- forms list ---- */
  .forms-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
  }

  .form-card {
    border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    border-radius: 12px;
    padding: 14px 16px;
    display: grid;
    gap: 10px;

    & .form-card-head {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 6px 12px;

      & .form-card-title { font-weight: 650; }
      & .form-card-meta {
        color: color-mix(in srgb, currentColor 60%, transparent);
        font-size: 0.85rem;
      }
    }

    & .form-card-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
  }

  .form-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;

    & .form-link-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px 10px;
      font-size: 0.85rem;

      & .form-link-url {
        font-family: ui-monospace, monospace;
        overflow-wrap: anywhere;
        color: color-mix(in srgb, currentColor 65%, transparent);
      }

      & .form-link-state {
        border-radius: 999px;
        padding: 1px 9px;
        font-size: 0.75rem;
        font-weight: 600;
        background: color-mix(in srgb, currentColor 10%, transparent);
      }

      & .form-link-state[data-state="active"] {
        color: #2e6b3f;
        background: color-mix(in srgb, #2e6b3f 14%, transparent);
      }
    }
  }

  .form-responses {
    display: grid;
    gap: 8px;

    & .form-response {
      border-left: 3px solid color-mix(in srgb, currentColor 25%, transparent);
      padding: 6px 12px;
      display: grid;
      gap: 2px;

      & .form-response-when {
        font-size: 0.78rem;
        color: color-mix(in srgb, currentColor 55%, transparent);
      }
    }
  }

  .forms-empty,
  .patients-empty {
    color: color-mix(in srgb, currentColor 60%, transparent);
  }

  /* ---- respondents ---- */
  .patients-note {
    font-size: 0.9rem;
    color: color-mix(in srgb, currentColor 60%, transparent);
    margin: 0 0 10px;
  }

  .patients-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;

    & .patient-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px 12px;
      align-items: center;
      border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
      border-radius: 10px;
      padding: 10px 14px;

      & .patient-ref {
        font: 0.8rem/1.4 ui-monospace, monospace;
        overflow-wrap: anywhere;
      }

      & .patient-count { margin-inline-start: auto; font-size: 0.85rem; }
    }
  }

  .workspace-status {
    display: block;
    min-height: 1.5em;
    font-size: 0.92rem;
  }

  .workspace-status[data-tone="error"] {
    color: #a33327;
  }
