.user-scopes {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.user-scopes-header {
  .crumbs {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
  }
  .title {
    margin: 0 0 0.5rem;
  }
  .intro {
    margin: 0;
    color: var(--color-text-secondary, #555);
  }
}

.status-bar {
  min-height: 1.5rem;
}

.status-line--error {
  color: var(--color-danger, #b00020);
}

.section-heading {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
}

.empty {
  font-style: italic;
  color: var(--color-text-secondary, #555);
}

.table-wrap {
  overflow-x: auto;
}

.scopes-table {
  width: 100%;
  border-collapse: collapse;

  th,
  td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border, #ddd);
  }

  .cell-scope code {
    font-family: var(--font-mono, monospace);
  }

  .cell-actions {
    text-align: right;
  }
}

.grant-section {
  background: var(--color-bg-surface, #fafafa);
  padding: 1rem;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 0.5rem;
}

.grant-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;

  &.field--hidden {
    visibility: hidden;
  }

  .field-label {
    font-weight: 600;
    font-size: 0.875rem;
  }

  .field-hint {
    font-size: 0.75rem;
    color: var(--color-text-secondary, #555);
  }

  input,
  select {
    padding: 0.5rem;
    border: 1px solid var(--color-border, #ccc);
    border-radius: 0.25rem;
    min-height: 44px; /* WCAG 2.2 AA touch target (2.5.5 / 2.5.8). */
  }
}

.submit-error {
  color: var(--color-danger, #b00020);
  margin: 0 0 0.75rem;
}

.grant-actions {
  display: flex;
  justify-content: flex-end;
}

.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

.btn--primary {
  background: var(--color-brand-accent-500, #de9415);
  color: white;
}

.btn--danger {
  background: transparent;
  color: var(--color-danger, #b00020);
  border-color: currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
