/* Marlaine v232 Access Control workspace.
   This file is intentionally isolated from the existing Settings and Production UI. */
.access-v232-workspace {
  --access-surface: var(--settings-card, #fff);
  --access-surface-soft: #f7f9fc;
  --access-surface-muted: #eef3f7;
  --access-border: var(--settings-border, #dfe6ee);
  --access-border-strong: #cbd6e2;
  --access-text: var(--settings-text, #17212e);
  --access-muted: var(--settings-muted, #64748b);
  --access-faint: #8997a8;
  --access-accent: #0d8b70;
  --access-accent-hover: #08745e;
  --access-accent-soft: #e8f8f2;
  --access-accent-border: #b9e7d7;
  --access-focus: #0d8b7038;
  --access-danger: #b4233e;
  --access-danger-soft: #fff0f2;
  --access-danger-border: #f3c4cc;
  --access-warning: #9a5a0b;
  --access-warning-soft: #fff7e8;
  --access-warning-border: #f1d49e;
  --access-info: #285a9f;
  --access-info-soft: #edf4ff;
  --access-info-border: #c8d9f3;
  --access-shadow: 0 12px 34px rgba(15, 31, 46, .07);
  --access-shadow-soft: 0 4px 16px rgba(15, 31, 46, .05);
  display: grid;
  gap: 14px;
  min-width: 0;
  color: var(--access-text);
  color-scheme: light;
  container-type: inline-size;
}

.access-v232-workspace,
.access-v232-workspace * {
  box-sizing: border-box;
}

/* v225 broadly pads identity section children; v232 owns its internal spacing. */
.settings-identity-v224.access-v232-workspace section > div {
  padding: 0 !important;
}

.access-v232-workspace :where(button, input, select, textarea) {
  font: inherit;
}

.access-v232-workspace :where(button, input, select, textarea):focus-visible {
  outline: 2px solid var(--access-accent);
  outline-offset: 2px;
}

.access-v232-workspace :where(input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea) {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--access-border-strong);
  border-radius: 9px;
  background: var(--access-surface);
  color: var(--access-text);
  padding: 9px 11px;
  line-height: 1.45;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.access-v232-workspace :where(input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea):focus {
  border-color: var(--access-accent);
  box-shadow: 0 0 0 3px var(--access-focus);
}

.access-v232-workspace :where(input, select, textarea)::placeholder {
  color: var(--access-faint);
  opacity: .86;
}

.access-v232-workspace :where(input, select, textarea):disabled {
  cursor: not-allowed;
  opacity: .65;
  background: var(--access-surface-muted);
}

.access-v232-workspace :where(button) {
  border: 1px solid var(--access-border);
  border-radius: 8px;
  background: var(--access-surface);
  color: var(--access-text);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}

.access-v232-workspace :where(button):hover:not(:disabled) {
  border-color: var(--access-border-strong);
  background: var(--access-surface-soft);
}

.access-v232-workspace :where(button):active:not(:disabled) {
  transform: translateY(1px);
}

.access-v232-workspace :where(button):disabled {
  cursor: not-allowed;
  opacity: .55;
}

.access-v232-workspace > .settings-identity-toolbar-v224 {
  min-height: 42px;
  margin: 0;
  padding: 0 2px;
  align-items: center;
}

.access-v232-workspace > .settings-identity-toolbar-v224 h2 {
  margin: 0 auto 0 0;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -.25px;
}

.access-v232-workspace > .settings-identity-toolbar-v224 button {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--access-muted);
}

.access-v232-workspace.is-embedded > .settings-identity-toolbar-v224 {
  justify-content: flex-end;
  min-height: 34px;
}

/* Shared high-level cards */
.access-v232-master-detail {
  display: grid;
  grid-template-columns: minmax(246px, 292px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.access-v232-library,
.access-v232-editor,
.access-v232-resource-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--access-border);
  border-radius: 14px;
  background: var(--access-surface);
  box-shadow: var(--access-shadow-soft);
}

.access-v232-library {
  position: sticky;
  top: 14px;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 150px);
  padding: 15px;
}

.access-v232-library > header,
.access-v232-editor > header,
.access-v232-resource-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.access-v232-library > header {
  margin-bottom: 13px;
}

.access-v232-library > header h2,
.access-v232-editor > header h2,
.access-v232-resource-card > header h2 {
  margin: 0;
  color: var(--access-text);
  font-size: 17px;
  font-weight: 760;
  line-height: 1.3;
  letter-spacing: -.25px;
}

.access-v232-library > header p,
.access-v232-editor > header p,
.access-v232-resource-card > header p {
  margin: 3px 0 0;
  color: var(--access-muted);
  font-size: 11px;
  line-height: 1.45;
}

.access-v232-library > header button {
  flex: none;
  min-height: 32px;
  padding: 6px 10px;
  border-color: var(--access-accent-border);
  background: var(--access-accent-soft);
  color: var(--access-accent-hover);
  font-size: 11px;
  font-weight: 750;
}

.access-v232-library > header button:hover:not(:disabled) {
  border-color: var(--access-accent);
  background: var(--access-accent);
  color: #fff;
}

.access-v232-library > input[type="search"] {
  flex: none;
  margin-bottom: 11px;
  background: var(--access-surface-soft);
  font-size: 11px;
}

.access-v232-library-list {
  display: grid;
  gap: 7px;
  min-height: 80px;
  overflow: auto;
  padding: 1px 4px 2px 1px;
  scrollbar-gutter: stable;
}

.access-v232-library-list > button {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  box-shadow: none;
}

.access-v232-library-list > button::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}

.access-v232-library-list > button:hover:not(:disabled) {
  border-color: var(--access-accent-border);
  background: var(--access-accent-soft);
}

.access-v232-library-list > button[aria-current="true"] {
  border-color: var(--access-accent-border);
  background: var(--access-accent-soft);
  box-shadow: 0 0 0 1px rgba(13, 139, 112, .05);
}

.access-v232-library-list > button[aria-current="true"]::before {
  background: var(--access-accent);
}

.access-v232-library-list > button > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.access-v232-library-list > button strong {
  min-width: 0;
  overflow: hidden;
  color: var(--access-text);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-v232-library-list > button small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--access-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.access-v232-library-list > button em {
  color: var(--access-faint);
  font-size: 9px;
  font-style: normal;
  font-weight: 650;
  letter-spacing: .01em;
}

.access-v232-editor > header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--access-border);
  background: linear-gradient(135deg, var(--access-surface) 0%, var(--access-surface-soft) 100%);
}

.access-v232-editor > header > div:first-child > p,
.access-v232-resource-card > header > div > p {
  margin: 0 0 4px;
  color: var(--access-accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.access-v232-editor > header > div:first-child > span,
.access-v232-resource-card > header > div > span {
  display: block;
  margin-top: 5px;
  color: var(--access-muted);
  font-size: 11px;
  line-height: 1.45;
}

.access-v232-editor > form {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 19px 20px 0;
}

.access-v232-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr) minmax(120px, .65fr);
  gap: 13px;
}

.access-v232-fields > label,
.access-v232-scope-selectors > label {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  color: var(--access-text);
  font-size: 11px;
  font-weight: 700;
}

.access-v232-fields textarea {
  min-height: 76px;
  resize: vertical;
}

.access-v232-wide {
  grid-column: 1 / -1;
}

.access-v232-counts {
  display: grid;
  grid-template-columns: auto auto;
  flex: none;
  align-items: baseline;
  gap: 1px 6px;
  min-width: 86px;
  padding: 8px 11px;
  border: 1px solid var(--access-border);
  border-radius: 10px;
  background: var(--access-surface);
  text-align: right;
}

.access-v232-counts strong {
  color: var(--access-accent);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.access-v232-counts span {
  color: var(--access-muted);
  font-size: 9px;
  text-transform: uppercase;
}

.access-v232-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-top: 2px;
}

.access-v232-section-heading h3,
.access-v232-user-dialog h3 {
  margin: 0;
  color: var(--access-text);
  font-size: 14px;
  font-weight: 760;
}

.access-v232-section-heading p,
.access-v232-user-dialog section > p {
  margin: 3px 0 0;
  color: var(--access-muted);
  font-size: 10px;
  line-height: 1.5;
}

.access-v232-section-heading > strong {
  flex: none;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--access-accent-soft);
  color: var(--access-accent-hover);
  font-size: 9px;
  font-weight: 750;
}

/* Permission matrix */
.access-v232-permissions {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--access-border);
  border-radius: 12px;
  background: var(--access-surface-soft);
}

.access-v232-permission-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border-bottom: 1px solid var(--access-border);
  background: var(--access-surface);
}

.access-v232-permission-tools > input[type="search"] {
  flex: 1 1 300px;
  background: var(--access-surface-soft);
  font-size: 11px;
}

.access-v232-permission-tools > span {
  flex: none;
  color: var(--access-muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.access-v232-permission-groups {
  display: grid;
  gap: 10px;
  max-height: 660px;
  overflow: auto;
  padding: 10px;
  scrollbar-gutter: stable;
}

.access-v232-permission-group {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--access-border);
  border-radius: 10px;
  background: var(--access-surface);
}

.access-v232-permission-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 45px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--access-border);
  background: var(--access-surface-soft);
}

.access-v232-permission-group > header > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.access-v232-permission-group > header h4,
.access-v232-option-block h4,
.access-v232-scope-list h4 {
  margin: 0;
  color: var(--access-text);
  font-size: 11px;
  font-weight: 780;
}

.access-v232-permission-group > header span,
.access-v232-option-block > header span,
.access-v232-scope-list > header span {
  color: var(--access-muted);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.access-v232-permission-group > header > div:last-child,
.access-v232-scope-list > header > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.access-v232-permission-group > header button,
.access-v232-scope-list > header button {
  min-height: 25px;
  padding: 4px 7px;
  color: var(--access-muted);
  font-size: 8px;
  font-weight: 750;
}

.access-v232-permission-list {
  display: grid;
  min-width: 0;
}

.access-v232-permission-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 12px 12px 12px 15px;
  border-top: 1px solid var(--access-border);
  background: var(--access-surface);
  transition: background-color .15s ease;
}

.access-v232-permission-row:first-child {
  border-top: 0;
}

.access-v232-permission-row::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--access-border-strong);
}

.access-v232-permission-row:hover {
  background: var(--access-surface-soft);
}

.access-v232-permission-row.risk-elevated::before {
  background: #df981d;
}

.access-v232-permission-row.risk-critical::before {
  background: var(--access-danger);
}

.access-v232-permission-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.access-v232-permission-copy > div:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.access-v232-permission-copy strong {
  overflow-wrap: anywhere;
  color: var(--access-text);
  font-size: 11px;
  font-weight: 730;
}

.access-v232-permission-copy em {
  flex: none;
  padding: 2px 5px;
  border: 1px solid var(--access-warning-border);
  border-radius: 999px;
  background: var(--access-warning-soft);
  color: var(--access-warning);
  font-size: 7px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.access-v232-permission-row.risk-critical .access-v232-permission-copy em {
  border-color: var(--access-danger-border);
  background: var(--access-danger-soft);
  color: var(--access-danger);
}

.access-v232-permission-copy p {
  margin: 0;
  color: var(--access-muted);
  font-size: 9px;
  line-height: 1.5;
}

.access-v232-permission-copy code {
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--access-faint);
  font: 600 8px/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.access-v232-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  cursor: pointer;
}

.access-v232-switch > input[type="checkbox"] {
  position: relative;
  width: 38px;
  height: 22px;
  margin: 0;
  appearance: none;
  border: 1px solid var(--access-border-strong);
  border-radius: 999px;
  background: #dce4eb;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}

.access-v232-switch > input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(13, 25, 38, .25);
  transition: transform .16s ease;
}

.access-v232-switch > input[type="checkbox"]:checked {
  border-color: var(--access-accent);
  background: var(--access-accent);
}

.access-v232-switch > input[type="checkbox"]:checked::after {
  transform: translateX(16px);
}

.access-v232-switch > input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--access-accent);
  outline-offset: 3px;
}

.access-v232-switch > input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.access-v232-tristate {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  gap: 2px;
  flex: none;
  padding: 3px;
  border: 1px solid var(--access-border);
  border-radius: 9px;
  background: var(--access-surface-muted);
}

.access-v232-tristate > button {
  min-height: 27px;
  padding: 4px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--access-muted);
  font-size: 8px;
  font-weight: 750;
}

.access-v232-tristate > button[aria-pressed="true"] {
  border-color: var(--access-border-strong);
  background: var(--access-surface);
  color: var(--access-text);
  box-shadow: 0 1px 3px rgba(15, 31, 46, .08);
}

.access-v232-tristate > button:nth-child(2)[aria-pressed="true"] {
  border-color: var(--access-accent-border);
  background: var(--access-accent-soft);
  color: var(--access-accent-hover);
}

.access-v232-tristate > button:nth-child(3)[aria-pressed="true"] {
  border-color: var(--access-danger-border);
  background: var(--access-danger-soft);
  color: var(--access-danger);
}

/* Team membership and scoped resources */
.access-v232-teams {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.access-v232-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.access-v232-option-block,
.access-v232-scope-list {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--access-border);
  border-radius: 11px;
  background: var(--access-surface-soft);
}

.access-v232-option-block {
  grid-template-rows: auto minmax(0, 1fr);
}

.access-v232-option-block > header,
.access-v232-scope-list > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 41px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--access-border);
  background: var(--access-surface);
}

.access-v232-option-block > header > div,
.access-v232-scope-list > header > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.access-v232-check-scroll {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 92px;
  max-height: 210px;
  overflow: auto;
  padding: 7px;
  scrollbar-gutter: stable;
}

.settings-identity-v224.access-v232-workspace .access-v232-option-block > .access-v232-check-scroll {
  padding: 7px !important;
}

.access-v232-check-scroll > label,
.access-v232-role-checks > label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--access-text);
  cursor: pointer;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.45;
  transition: border-color .14s ease, background-color .14s ease;
}

.access-v232-check-scroll > label:hover,
.access-v232-role-checks > label:hover {
  border-color: var(--access-border);
  background: var(--access-surface);
}

.access-v232-check-scroll input[type="checkbox"],
.access-v232-role-checks input[type="checkbox"] {
  flex: none;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--access-accent);
}

.access-v232-check-scroll > label > span,
.access-v232-role-checks > label > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.access-v232-check-scroll > p {
  margin: 12px 6px;
  color: var(--access-muted);
  font-size: 9px;
}

.access-v232-resource-card {
  padding: 19px 20px 0;
}

.access-v232-resource-card > header {
  margin: -19px -20px 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--access-border);
  background: linear-gradient(135deg, var(--access-surface) 0%, var(--access-surface-soft) 100%);
}

.access-v232-resource-card > header > strong {
  flex: none;
  align-self: center;
  padding: 6px 9px;
  border: 1px solid var(--access-info-border);
  border-radius: 999px;
  background: var(--access-info-soft);
  color: var(--access-info);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.access-v232-scope-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  max-width: 720px;
  margin-bottom: 16px;
}

.access-v232-scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.access-v232-scope-list > input[type="search"] {
  width: calc(100% - 14px);
  margin: 7px;
  background: var(--access-surface);
  font-size: 10px;
}

.access-v232-scope-list .access-v232-check-scroll {
  max-height: 230px;
  padding-top: 0;
}

.settings-identity-v224.access-v232-workspace .access-v232-scope-list > .access-v232-check-scroll {
  padding: 0 7px 7px !important;
}

/* Users and access dialog */
.access-v232-users .settings-users-table-v224 tbody tr {
  transition: background-color .14s ease;
}

.access-v232-users .settings-users-table-v224 tbody tr:hover {
  background: var(--access-surface-soft);
}

.access-v232-users .settings-users-table-v224 td:last-child,
.access-v232-users .settings-users-table-v224 th:last-child {
  text-align: right;
}

.access-v232-users .settings-row-actions-v224 {
  justify-content: flex-end;
}

.access-v232-action {
  border-color: var(--access-accent-border) !important;
  background: var(--access-accent-soft) !important;
  color: var(--access-accent-hover) !important;
}

.access-v232-action:hover:not(:disabled) {
  border-color: var(--access-accent) !important;
  background: var(--access-accent) !important;
  color: #fff !important;
}

.access-v232-master {
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  margin: 0 !important;
  padding: 4px 7px;
  border: 1px solid #c8d9f3;
  border-radius: 999px;
  background: var(--access-info-soft);
  color: var(--access-info) !important;
  font-size: 9px !important;
  font-weight: 760;
  white-space: nowrap;
}

.access-v232-access-summary {
  display: grid;
  gap: 3px;
  min-width: 140px;
}

.access-v232-access-summary strong {
  color: var(--access-text);
  font-size: 10px;
}

.access-v232-access-summary span {
  margin: 0 !important;
  color: var(--access-muted) !important;
  font-size: 9px !important;
  line-height: 1.4;
}

.settings-dialog-v224:has(.access-v232-user-dialog) {
  width: min(980px, 100%);
}

.access-v232-user-dialog {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin-top: 17px;
}

.access-v232-user-dialog > section {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--access-border);
  border-radius: 11px;
  background: var(--access-surface-soft);
}

.access-v232-role-assignment > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.access-v232-role-assignment > header > span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--access-accent-soft);
  color: var(--access-accent-hover);
  font-size: 8px;
  font-weight: 750;
}

.access-v232-role-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  margin-top: 11px;
  padding: 2px;
}

.settings-identity-v224.access-v232-workspace .access-v232-role-checks {
  padding: 2px !important;
}

.access-v232-role-checks > label {
  border-color: var(--access-border);
  background: var(--access-surface);
}

.access-v232-role-checks strong,
.access-v232-role-checks small {
  display: block;
}

.access-v232-role-checks strong {
  color: var(--access-text);
  font-size: 10px;
}

.access-v232-role-checks small {
  margin-top: 2px;
  color: var(--access-muted);
  font-size: 8px;
}

.access-v232-role-checks > p {
  grid-column: 1 / -1;
  margin: 8px;
  color: var(--access-muted);
  font-size: 10px;
}

.access-v232-effective {
  border-color: var(--access-info-border) !important;
  background: var(--access-info-soft) !important;
}

.access-v232-effective > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.access-v232-effective > div > span {
  padding: 4px 7px;
  border: 1px solid var(--access-info-border);
  border-radius: 999px;
  background: var(--access-surface);
  color: var(--access-info);
  font-size: 8px;
  font-weight: 650;
}

.access-v232-effective > small {
  display: block;
  margin-top: 9px;
  color: var(--access-muted);
  font-size: 9px;
}

/* Save bars and state messaging */
.access-v232-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 -20px;
  padding: 13px 20px !important;
  border-top: 1px solid var(--access-border);
  background: color-mix(in srgb, var(--access-surface) 92%, transparent);
  box-shadow: 0 -10px 22px rgba(15, 31, 46, .04);
  backdrop-filter: blur(9px);
}

.access-v232-user-dialog > .access-v232-sticky-actions {
  margin: 0 -24px -24px;
  padding-inline: 24px !important;
}

.access-v232-resource-card > .access-v232-sticky-actions {
  margin-top: 16px;
}

.settings-identity-v224.access-v232-workspace .access-v232-resource-card > .access-v232-sticky-actions {
  padding: 13px 20px !important;
}

.access-v232-sticky-actions > button {
  min-height: 35px;
  padding: 7px 13px;
  font-size: 10px;
  font-weight: 720;
}

.access-v232-readonly,
.access-v232-denied {
  border: 1px solid var(--access-warning-border);
  border-radius: 11px;
  background: var(--access-warning-soft);
  color: var(--access-warning);
}

.access-v232-readonly {
  margin: 0 0 19px;
  padding: 11px 13px;
  font-size: 10px;
  line-height: 1.5;
}

.access-v232-denied {
  display: grid;
  gap: 4px;
  min-height: 150px;
  place-content: center;
  padding: 28px;
  text-align: center;
}

.access-v232-denied strong {
  font-size: 14px;
}

.access-v232-denied p {
  margin: 0;
  color: var(--access-muted);
  font-size: 10px;
}

.access-v232-empty {
  display: grid;
  min-height: 86px;
  margin: 0;
  place-items: center;
  padding: 18px;
  color: var(--access-muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

/* Dark theme follows Marlaine's html theme selectors. */
html[data-theme="dark"] .access-v232-workspace,
html.dark .access-v232-workspace,
html[data-theme="dark"] .settings-dialog-v224:has(.access-v232-user-dialog),
html.dark .settings-dialog-v224:has(.access-v232-user-dialog) {
  --access-surface: #131c27;
  --access-surface-soft: #101923;
  --access-surface-muted: #1a2633;
  --access-border: #293442;
  --access-border-strong: #3a495b;
  --access-text: #e6edf5;
  --access-muted: #97a7b9;
  --access-faint: #74869a;
  --access-accent: #37b995;
  --access-accent-hover: #73d6bc;
  --access-accent-soft: #12342f;
  --access-accent-border: #245c50;
  --access-focus: #39c39b38;
  --access-danger: #ff7f91;
  --access-danger-soft: #381b24;
  --access-danger-border: #69303e;
  --access-warning: #f2bc66;
  --access-warning-soft: #30271a;
  --access-warning-border: #66502b;
  --access-info: #8db9f2;
  --access-info-soft: #17283c;
  --access-info-border: #314d6c;
  --access-shadow: none;
  --access-shadow-soft: none;
  color-scheme: dark;
}

html[data-theme="dark"] .access-v232-switch > input[type="checkbox"],
html.dark .access-v232-switch > input[type="checkbox"] {
  background: #344252;
}

html[data-theme="dark"] .access-v232-switch > input[type="checkbox"]:checked,
html.dark .access-v232-switch > input[type="checkbox"]:checked {
  background: var(--access-accent);
}

html[data-theme="dark"] .access-v232-sticky-actions,
html.dark .access-v232-sticky-actions {
  box-shadow: 0 -10px 22px rgba(0, 0, 0, .14);
}

/* Adaptive layouts */
@container (max-width: 920px) {
  .access-v232-master-detail {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .access-v232-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .access-v232-fields > label:nth-child(3) {
    grid-column: 1 / -1;
  }

  .access-v232-team-grid,
  .access-v232-scope-grid {
    grid-template-columns: 1fr;
  }
}

@container (max-width: 700px) {
  .access-v232-master-detail {
    grid-template-columns: 1fr;
  }

  .access-v232-library {
    position: static;
    max-height: none;
  }

  .access-v232-library-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 270px;
  }

  .access-v232-editor > header,
  .access-v232-resource-card > header {
    flex-wrap: wrap;
  }

  .access-v232-permission-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .access-v232-switch,
  .access-v232-tristate {
    justify-self: start;
  }

  .access-v232-permission-copy p {
    font-size: 10px;
  }
}

@container (max-width: 520px) {
  .access-v232-fields,
  .access-v232-scope-selectors,
  .access-v232-role-checks {
    grid-template-columns: 1fr;
  }

  .access-v232-fields > label:nth-child(3) {
    grid-column: auto;
  }

  .access-v232-wide {
    grid-column: auto;
  }

  .access-v232-library-list {
    grid-template-columns: 1fr;
  }

  .access-v232-permission-tools,
  .access-v232-permission-group > header,
  .access-v232-scope-list > header {
    align-items: stretch;
    flex-direction: column;
  }

  .access-v232-permission-group > header > div:last-child,
  .access-v232-scope-list > header > div:last-child {
    justify-content: flex-start;
  }

  .access-v232-permission-tools > span {
    white-space: normal;
  }

  .access-v232-tristate {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .access-v232-sticky-actions {
    flex-wrap: wrap;
  }

  .access-v232-sticky-actions > button {
    flex: 1 1 120px;
  }

  .access-v232-user-dialog > .access-v232-sticky-actions {
    margin-inline: -18px;
    margin-bottom: -18px;
    padding-inline: 18px !important;
  }
}

@media (max-width: 720px) {
  .settings-dialog-v224:has(.access-v232-user-dialog) {
    padding-inline: 18px;
  }

  .access-v232-resource-card,
  .access-v232-editor > form {
    padding-inline: 15px;
  }

  .access-v232-resource-card > header {
    margin-inline: -15px;
    padding-inline: 15px;
  }

  .access-v232-editor .access-v232-sticky-actions,
  .access-v232-resource-card > .access-v232-sticky-actions {
    margin-inline: -15px;
    padding-inline: 15px !important;
  }

  .settings-identity-v224.access-v232-workspace .access-v232-resource-card > .access-v232-sticky-actions {
    padding-inline: 15px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .access-v232-workspace *,
  .access-v232-workspace *::before,
  .access-v232-workspace *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media (forced-colors: active) {
  .access-v232-permission-row::before,
  .access-v232-library-list > button::before {
    background: CanvasText;
  }

  .access-v232-switch > input[type="checkbox"]:checked {
    outline: 2px solid Highlight;
  }
}

/* Route-level guard for bookmarked or manually entered pages. */
.access-v232-page-denied {
  width: min(680px, calc(100% - 40px));
  margin: clamp(42px, 8vh, 96px) auto;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid #dfe6ee;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 31, 46, .09);
  color: #17212e;
}

.access-v232-page-denied > span {
  display: block;
  margin-bottom: 10px;
  color: #b4233e;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .16em;
}

.access-v232-page-denied > h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.access-v232-page-denied > p {
  max-width: 58ch;
  margin: 16px 0 0;
  color: #64748b;
  line-height: 1.65;
}

.dark .access-v232-page-denied {
  border-color: rgba(255, 255, 255, .1);
  background: #111114;
  color: #f4f7fb;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.dark .access-v232-page-denied > p {
  color: #9aa7b6;
}
