/* Staff access console (example 04). Everything below comes from a small token set: surfaces and
   text, one calm teal accent, three status colors (always paired with an icon and a word), a spacing
   scale and one radius. Dark is the default; the light theme swaps only the color tokens. */
:root {
  /* space */
  --ac-s1: 4px;
  --ac-s2: 8px;
  --ac-s3: 12px;
  --ac-s4: 16px;
  --ac-s5: 24px;
  --ac-s6: 32px;
  /* shape and motion */
  --ac-radius: 2px;
  --ac-row-y: 12px;
  --ac-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ac-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* color: dark (default) */
:root,
html[data-theme="dark"] {
  --ac-bg: #0d1314;
  --ac-side: #0a0f10;
  --ac-panel: #121a1b;
  --ac-panel-2: #172122;
  --ac-hover: #162021;
  --ac-press: #1d2a2b;
  --ac-line: #1f2b2c;
  --ac-line-2: #2b3a3b;
  --ac-line-3: #3e5052;
  --ac-text: #e3eaea;
  --ac-soft: #b6c3c3;
  --ac-muted: #86989a;
  --ac-subtle: #5b6d6f;
  --ac-accent: #4fb3a9;
  --ac-accent-2: #72cbc1;
  --ac-accent-text: #7fd3c9;
  --ac-accent-wash: #11292a;
  --ac-accent-wash-2: #1a3d3b;
  --ac-on-accent: #061514;
  --ac-ok: #6cbf8c;
  --ac-warn: #d9a757;
  --ac-bad: #e57d74;
  --ac-ok-wash: #13241b;
  --ac-ok-line: #2a4a37;
  --ac-warn-wash: #251f15;
  --ac-warn-line: #4e4026;
  --ac-warn-text: #ecca8e;
  --ac-bad-wash: #2a1918;
  --ac-bad-line: #5c3330;
  --ac-bad-text: #f2b5ae;
  --ac-danger: #c9564d;
  --ac-danger-2: #d96a61;
  --ac-on-danger: #ffffff;
  --ac-toast: #1f2c2d;
  --ac-toast-text: #e3eaea;
  --ac-toast-link: #7fd3c9;
  --ac-toast-hover: #29393a;
  --ac-flash: #1a4441;
  --ac-scrim: rgba(5, 9, 10, 0.6);
  color-scheme: dark;
}

/* color: light */
html[data-theme="light"] {
  --ac-bg: #f3f6f6;
  --ac-side: #eaf0f0;
  --ac-panel: #ffffff;
  --ac-panel-2: #eef3f3;
  --ac-hover: #f2f6f6;
  --ac-press: #e3eaea;
  --ac-line: #dce5e5;
  --ac-line-2: #c8d4d4;
  --ac-line-3: #a3b3b3;
  --ac-text: #132021;
  --ac-soft: #354647;
  --ac-muted: #586a6b;
  --ac-subtle: #849394;
  --ac-accent: #1f7a71;
  --ac-accent-2: #17645c;
  --ac-accent-text: #17645c;
  --ac-accent-wash: #e3f2ef;
  --ac-accent-wash-2: #c7e6e1;
  --ac-on-accent: #ffffff;
  --ac-ok: #23784a;
  --ac-warn: #976010;
  --ac-bad: #b73a32;
  --ac-ok-wash: #eaf6ee;
  --ac-ok-line: #b9dcc6;
  --ac-warn-wash: #fbf4e6;
  --ac-warn-line: #e8d0a0;
  --ac-warn-text: #7a4c08;
  --ac-bad-wash: #fcefee;
  --ac-bad-line: #efc6c2;
  --ac-bad-text: #9b2c25;
  --ac-danger: #b73a32;
  --ac-danger-2: #9e2f28;
  --ac-on-danger: #ffffff;
  --ac-toast: #1a2627;
  --ac-toast-text: #eef3f3;
  --ac-toast-link: #8fdcd2;
  --ac-toast-hover: #283637;
  --ac-flash: #c7e6e1;
  --ac-scrim: rgba(19, 32, 33, 0.32);
  color-scheme: light;
}

html {
  background: var(--ac-bg);
}

body {
  background: var(--ac-bg);
}

.ac {
  min-height: calc(100vh - var(--ex-bar));
  background: var(--ac-bg);
  color: var(--ac-text);
  font-size: 0.875rem;
  line-height: 1.45;
}

.ac *,
.ac *::before,
.ac *::after {
  box-sizing: border-box;
}

/* line icons: one stroke style everywhere */
.ac svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* resets with no specificity, so every component's own spacing wins */
:where(.ac) :where(h1, h2, h3, h4, p, ul, ol, dl, dd) {
  margin: 0;
}

:where(.ac) :where(ul, ol) {
  padding: 0;
  list-style: none;
}

.ac button,
.ac input,
.ac select,
.ac textarea {
  font: inherit;
  color: inherit;
}

.ac :focus-visible {
  outline: 1px solid var(--ac-accent-2);
  outline-offset: 2px;
}

.ac table,
.num,
.kpi-value,
.cell-sub,
.countdown {
  font-variant-numeric: tabular-nums;
}

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

.ac kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-bg);
  color: var(--ac-muted);
  font: 500 0.6875rem/1 "Inter", sans-serif;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ac-s2);
  padding: 7px 12px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-panel-2);
  color: var(--ac-text);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s var(--ac-ease), border-color 0.2s var(--ac-ease), color 0.2s var(--ac-ease);
}

.btn:hover {
  border-color: var(--ac-line-3);
  background: var(--ac-press);
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn-sm {
  padding: 5px 10px;
}

.btn-ghost {
  background: transparent;
  border-color: var(--ac-line);
  color: var(--ac-soft);
}

.btn-ghost:hover {
  background: var(--ac-hover);
  color: var(--ac-text);
}

.btn-ghost kbd {
  min-width: 16px;
  height: 16px;
}

.btn-primary {
  border-color: var(--ac-accent);
  background: var(--ac-accent);
  color: var(--ac-on-accent);
}

.btn-primary:hover {
  border-color: var(--ac-accent-2);
  background: var(--ac-accent-2);
}

.btn-danger {
  border-color: var(--ac-danger);
  background: var(--ac-danger);
  color: var(--ac-on-danger);
}

.btn-danger:hover {
  border-color: var(--ac-danger-2);
  background: var(--ac-danger-2);
}

.btn-danger-ghost {
  background: transparent;
  border-color: var(--ac-bad-line);
  color: var(--ac-bad-text);
}

.btn-danger-ghost:hover {
  background: var(--ac-bad-wash);
  border-color: var(--ac-bad);
}

/* Disabled for a reason: still focusable and clickable, and a click says why */
.btn[aria-disabled="true"],
.btn:disabled {
  border-color: var(--ac-line);
  background: transparent;
  color: var(--ac-subtle);
}

.btn[aria-disabled="true"] {
  cursor: help;
}

.btn:disabled {
  cursor: not-allowed;
}

.btn[aria-disabled="true"] svg,
.btn:disabled svg {
  opacity: 0.7;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--ac-radius);
  background: none;
  color: var(--ac-muted);
  cursor: pointer;
  transition: color 0.2s var(--ac-ease), background-color 0.2s var(--ac-ease);
}

.icon-btn:hover {
  background: var(--ac-hover);
  color: var(--ac-text);
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ac-accent-text);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s var(--ac-ease);
}

.link-btn:hover {
  text-decoration-color: currentColor;
}

/* ---------- App layout ---------- */
.app {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: calc(100vh - var(--ex-bar));
}

.side {
  position: sticky;
  top: var(--ex-bar);
  display: flex;
  flex-direction: column;
  gap: var(--ac-s5);
  height: calc(100vh - var(--ex-bar));
  padding: 20px 12px;
  border-right: 1px solid var(--ac-line);
  background: var(--ac-side);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px;
  color: var(--ac-text);
}

.brand .brand-mark {
  width: 26px;
  height: 26px;
  color: var(--ac-accent);
  stroke-width: 1.5;
}

.brand-name {
  display: grid;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.brand-name small {
  color: var(--ac-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav {
  display: grid;
  gap: 2px;
}

.nav-item {
  position: relative; /* keeps its screen reader text inside it */
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--ac-radius);
  background: none;
  color: var(--ac-muted);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s var(--ac-ease), background-color 0.2s var(--ac-ease);
}

.nav-item:hover {
  background: var(--ac-hover);
  color: var(--ac-text);
}

.nav-item[aria-current="page"] {
  background: var(--ac-panel-2);
  color: var(--ac-text);
}

.nav-item[aria-current="page"] svg {
  color: var(--ac-accent);
}

.nav-item:focus-visible {
  outline-offset: -1px;
}

.nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-count {
  margin-left: auto;
  color: var(--ac-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.nav-count.is-due {
  padding: 0 5px;
  border-radius: var(--ac-radius);
  background: var(--ac-accent-wash-2);
  color: var(--ac-text);
  font-weight: 600;
}

/* a screen this person can't use: a lock instead of the count */
.nav-lock {
  display: none;
  margin-left: auto;
}

.nav-item.is-locked {
  color: var(--ac-subtle);
}

.nav-item.is-locked .nav-count {
  display: none;
}

.nav-item.is-locked .nav-lock {
  display: block;
  width: 12px;
  height: 12px;
}

.me {
  margin-top: auto;
  padding: 12px 8px 0;
  border-top: 1px solid var(--ac-line);
}

.me-label,
.section-label {
  color: var(--ac-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.me-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px !important;
}

.me-text {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.me-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.me-text small {
  color: var(--ac-muted);
  font-size: 0.75rem;
}

.avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-panel-2);
  color: var(--ac-soft);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.avatar-lg {
  width: 40px;
  height: 40px;
  font-size: 0.875rem;
}

.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--ac-s5);
  min-width: 0;
  max-width: 1280px;
  padding: 28px 32px 72px;
}

/* Each view stacks its sections with the same space between them as the page head above */
.view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--ac-s5);
  min-width: 0;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--ac-s4);
}

.page-head h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.page-head h1:focus {
  outline: none;
}

.page-date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px !important;
  color: var(--ac-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.page-date .dot {
  width: 3px;
  height: 3px;
  background: var(--ac-subtle);
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ac-s2);
}

/* "Viewing as": a select with its label inside the same frame */
.viewing {
  display: inline-flex;
  align-items: center;
  height: 32px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-panel);
  font-size: 0.8125rem;
  transition: border-color 0.2s var(--ac-ease);
}

.viewing:hover {
  border-color: var(--ac-line-3);
}

.viewing:focus-within {
  border-color: var(--ac-accent);
}

.viewing-label {
  padding: 0 4px 0 10px;
  color: var(--ac-muted);
  white-space: nowrap;
}

.viewing-select {
  height: 100%;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: var(--ac-radius);
  background: none;
  color: var(--ac-text);
  font-weight: 500;
  cursor: pointer;
}

.ac .viewing-select:focus-visible {
  outline: none;
}

.viewing-select option,
.ac select option {
  background: var(--ac-panel);
  color: var(--ac-text);
}

.is-viewing-other .viewing {
  border-color: var(--ac-accent);
  background: var(--ac-accent-wash);
}

/* ---------- Notices ---------- */
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-panel);
  font-size: 0.8125rem;
  animation: ac-fade 0.4s var(--ac-ease);
}

.notice p {
  flex: 1;
  min-width: 0;
  color: var(--ac-soft);
}

.notice strong {
  color: var(--ac-text);
  font-weight: 600;
}

.notice > svg {
  color: var(--ac-muted);
}

.notice-info {
  border-color: var(--ac-accent-wash-2);
  background: var(--ac-accent-wash);
}

.notice-info > svg {
  color: var(--ac-accent);
}

.notice-lock {
  margin: 0 20px 14px;
  background: var(--ac-panel-2);
  animation: none;
}

@keyframes ac-fade {
  from {
    opacity: 0;
  }
}

@keyframes ac-rise {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* Read only, or limited: says so in words where the actions would be */
.ro-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.ro-note svg {
  width: 14px;
  height: 14px;
}

.ro-note-block {
  margin: 0 20px 12px !important;
  padding: 8px 12px;
  border: 1px dashed var(--ac-line-2);
  border-radius: var(--ac-radius);
}

.view > .ro-note-block {
  margin: 0 !important;
}

/* ---------- Status, two-step and tags: always an icon and a word ---------- */
.status,
.tf,
.lic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ac-text);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.ac .status svg,
.ac .tf svg,
.ac .lic svg,
.ac .tag svg {
  width: 12px;
  height: 12px;
  stroke-width: 1.6;
}

.st-active svg,
.tf-on svg {
  color: var(--ac-ok);
}

.st-invited svg {
  color: var(--ac-accent);
}

.st-expired svg,
.st-suspended svg {
  color: var(--ac-warn);
}

.st-deactivated {
  color: var(--ac-muted);
}

.st-deactivated svg,
.tf-off svg {
  color: var(--ac-subtle);
}

.tf-off {
  color: var(--ac-muted);
}

.tf-missing {
  color: var(--ac-bad-text);
}

.tf-missing svg {
  color: var(--ac-bad);
}

.lic-soon {
  color: var(--ac-warn-text);
}

.lic-soon svg {
  color: var(--ac-warn);
}

.lic-none {
  color: var(--ac-subtle);
}

.status .fill {
  fill: currentColor;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  color: var(--ac-soft);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: 1px;
}

.tag-sens {
  border-color: var(--ac-warn-line);
  background: var(--ac-warn-wash);
  color: var(--ac-warn-text);
}

.tag-sens svg {
  color: var(--ac-warn);
}

.tag-bad {
  border-color: var(--ac-bad-line);
  background: var(--ac-bad-wash);
  color: var(--ac-bad-text);
}

.tag-ok {
  border-color: var(--ac-ok-line);
  background: var(--ac-ok-wash);
  color: var(--ac-text);
}

.tag-ok svg {
  color: var(--ac-ok);
}

.tag-accent {
  border-color: var(--ac-accent-wash-2);
  background: var(--ac-accent-wash);
  color: var(--ac-text);
}

.tag-you {
  margin-left: 6px;
  border-color: var(--ac-accent-wash-2);
  color: var(--ac-accent-text);
}

/* ---------- Overview ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--ac-s3);
}

.kpi {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ac-line);
  border-radius: var(--ac-radius);
  background: var(--ac-panel);
}

.kpi-label {
  color: var(--ac-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kpi-value small {
  margin-left: 3px;
  color: var(--ac-muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
}

.kpi-sub {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--ac-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.kpi-sub svg {
  width: 12px;
  height: 12px;
  margin-top: 3px;
}

.kpi-sub.is-warn svg {
  color: var(--ac-warn);
}

.kpi-sub.is-bad svg {
  color: var(--ac-bad);
}

.kpi-sub.is-ok svg {
  color: var(--ac-ok);
}

/* a thin meter: the share of people with two-step verification */
.meter {
  display: block;
  height: 4px;
  margin: 2px 0;
  overflow: hidden;
  border-radius: var(--ac-radius);
  background: var(--ac-panel-2);
}

.meter span {
  display: block;
  height: 100%;
  background: var(--ac-accent);
  transform-origin: 0 50%;
  transition: transform 0.6s var(--ac-ease-out);
}

.attention {
  display: grid;
  gap: 10px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.section-note {
  color: var(--ac-subtle);
  font-size: 0.75rem;
}

.attn-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ac-s3);
}

.attn {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 2px 12px;
  width: 100%;
  height: 100%;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--ac-line);
  border-radius: var(--ac-radius);
  background: var(--ac-panel);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s var(--ac-ease), border-color 0.2s var(--ac-ease);
}

/* a 2px edge in the item's tone, next to its icon and words */
.attn::before {
  content: "";
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 2px;
  background: var(--tone, var(--ac-line-2));
}

.attn:hover {
  border-color: var(--ac-line-2);
  background: var(--ac-hover);
}

.attn-icon {
  grid-row: span 2;
  margin-top: 1px;
  color: var(--tone, var(--ac-muted));
}

.attn-title {
  color: var(--ac-text);
  font-weight: 500;
}

.attn-title b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.attn-text {
  grid-column: 2;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.attn-go {
  grid-row: span 2;
  align-self: center;
  color: var(--ac-subtle);
  font-size: 0.75rem;
  white-space: nowrap;
  transition: color 0.2s var(--ac-ease), transform 0.3s var(--ac-ease-out);
}

.attn:hover .attn-go {
  color: var(--ac-soft);
  transform: translateX(2px);
}

.tone-bad {
  --tone: var(--ac-bad);
}

.tone-warn {
  --tone: var(--ac-warn);
}

.tone-info {
  --tone: var(--ac-accent);
}

.attn-clear {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
  padding: 12px 16px;
  border: 1px dashed var(--ac-line-2);
  border-radius: var(--ac-radius);
  color: var(--ac-muted);
}

.attn-clear svg {
  color: var(--ac-ok);
}

.ov-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--ac-s3);
  align-items: start;
}

/* ---------- Cards ---------- */
.card {
  min-width: 0;
  border: 1px solid var(--ac-line);
  border-radius: var(--ac-radius);
  background: var(--ac-panel);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ac-s4);
  padding: 16px 20px 12px;
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.card-title:focus {
  outline: none;
}

.card-sub {
  margin-top: 2px !important;
  color: var(--ac-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ac-s2);
}

.card-foot {
  padding: 12px 20px 14px;
  border-top: 1px solid var(--ac-line);
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.head-note {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.head-note svg {
  width: 14px;
  height: 14px;
}

.feed {
  display: grid;
  padding: 0 20px 8px;
}

.feed li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 2px 12px;
  padding: 11px 0;
  border-top: 1px solid var(--ac-line);
}

.feed .feed-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  color: var(--ac-soft);
}

.feed .feed-icon svg {
  width: 13px;
  height: 13px;
}

.feed-text {
  min-width: 0;
  color: var(--ac-soft);
}

.feed-text b {
  color: var(--ac-text);
  font-weight: 500;
}

.feed-when {
  color: var(--ac-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.feed-meta {
  grid-column: 2 / -1;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.loc-bars {
  display: grid;
  gap: 2px;
  padding: 0 10px 12px;
}

.loc-btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--ac-radius);
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s var(--ac-ease);
}

.loc-btn:hover {
  background: var(--ac-hover);
}

.loc-name {
  font-weight: 500;
}

.loc-num {
  color: var(--ac-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.loc-btn .meter {
  grid-column: 1 / -1;
  margin: 0;
}

.loc-btn .meter.is-low span {
  background: var(--ac-warn);
}

/* ---------- Toolbars and filters ---------- */
.toolbar-wrap {
  position: sticky;
  top: var(--ex-bar);
  z-index: 6;
  overflow: hidden;
  border-top: 1px solid var(--ac-line);
  border-bottom: 1px solid var(--ac-line);
  background: var(--ac-panel);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ac-s2) var(--ac-s3);
  padding: 10px 20px;
}

.toolbar-plain {
  border-top: 1px solid var(--ac-line);
  border-bottom: 1px solid var(--ac-line);
}

.search {
  display: flex;
  flex: 1 1 240px;
  min-width: 0;
  align-items: center;
  gap: 8px;
  max-width: 460px;
  height: 34px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-bg);
  color: var(--ac-muted);
  cursor: text;
  transition: border-color 0.2s var(--ac-ease);
}

.search:hover {
  border-color: var(--ac-line-3);
}

.search:focus-within {
  border-color: var(--ac-accent);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ac-text);
  outline: none;
}

.ac .search input:focus-visible,
.ac .pick select:focus-visible {
  outline: none;
}

.search input::placeholder {
  color: var(--ac-subtle);
}

.search input::-webkit-search-cancel-button {
  opacity: 0.5;
  cursor: pointer;
}

.search:focus-within kbd {
  visibility: hidden;
}

/* a select with its label inside the frame */
.pick {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  height: 34px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-bg);
  font-size: 0.8125rem;
  transition: border-color 0.2s var(--ac-ease);
}

.pick:hover {
  border-color: var(--ac-line-3);
}

.pick:focus-within {
  border-color: var(--ac-accent);
}

.pick-label {
  padding: 0 2px 0 10px;
  color: var(--ac-muted);
  white-space: nowrap;
}

.pick select {
  min-width: 0;
  max-width: 220px;
  height: 100%;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--ac-text);
  cursor: pointer;
}

.pick.is-set {
  border-color: var(--ac-accent);
}

.bulkbar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ac-s3);
  padding: 0 20px;
  background: var(--ac-accent-wash);
  transform: translateY(-100%);
  transition: transform 0.35s var(--ac-ease-out);
}

.bulkbar.is-on {
  transform: none;
}

.bulk-count {
  color: var(--ac-text);
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bulk-actions {
  display: flex;
  gap: var(--ac-s2);
  min-width: 0;
}

.filters {
  display: flex;
  align-items: center;
  gap: var(--ac-s3);
  min-width: 0;
  padding: 12px 20px;
}

.chips {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--ac-line);
  border-radius: var(--ac-radius);
  background: transparent;
  color: var(--ac-soft);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s var(--ac-ease), background-color 0.2s var(--ac-ease), color 0.2s var(--ac-ease);
}

.chip:hover {
  border-color: var(--ac-line-2);
  color: var(--ac-text);
}

.chip[aria-pressed="true"] {
  border-color: var(--ac-accent);
  background: var(--ac-accent-wash);
  color: var(--ac-text);
}

.chip:focus-visible {
  outline-offset: -2px;
}

.chip-count {
  color: var(--ac-muted);
  font-variant-numeric: tabular-nums;
}

.chip svg {
  width: 12px;
  height: 12px;
}

.active-filter {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px 4px 3px 10px;
  border: 1px solid var(--ac-accent);
  border-radius: var(--ac-radius);
  background: var(--ac-accent-wash);
  color: var(--ac-text);
  font-size: 0.8125rem;
}

.chip-x {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: var(--ac-radius);
  background: none;
  color: var(--ac-muted);
  cursor: pointer;
}

.chip-x:hover {
  background: var(--ac-hover);
  color: var(--ac-text);
}

.chip-x svg {
  width: 12px;
  height: 12px;
}

/* ---------- Tables ---------- */
.table-wrap {
  position: relative; /* keeps screen reader text in headers inside the scroll box */
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 8px 12px;
  border-bottom: 1px solid var(--ac-line);
  color: var(--ac-muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 20px;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 20px;
}

.col-check {
  width: 48px;
}

.no-select .col-check,
.no-select .c-check {
  display: none;
}

.no-select .data-table th:nth-child(2),
.no-select .data-table td:nth-child(2) {
  padding-left: 20px;
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -4px -6px;
  padding: 4px 6px;
  border: 0;
  border-radius: var(--ac-radius);
  background: none;
  color: inherit;
  font-weight: inherit;
  cursor: pointer;
  transition: color 0.2s var(--ac-ease), background-color 0.2s var(--ac-ease);
}

.sort:hover {
  background: var(--ac-hover);
  color: var(--ac-text);
}

/* sort indicator: a small chevron, faint until the column is sorted */
.sort-ind {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.25s var(--ac-ease), opacity 0.2s var(--ac-ease);
}

.sort:hover .sort-ind {
  opacity: 0.4;
}

[aria-sort="ascending"] .sort,
[aria-sort="descending"] .sort {
  color: var(--ac-text);
}

[aria-sort="descending"] .sort-ind {
  opacity: 1;
}

[aria-sort="ascending"] .sort-ind {
  opacity: 1;
  transform: translateY(2px) rotate(-135deg);
}

.data-table td {
  padding: var(--ac-row-y) 12px;
  border-bottom: 1px solid var(--ac-line);
  vertical-align: middle;
  white-space: nowrap;
}

.people-table tbody tr,
.audit-table tbody tr.a-row {
  cursor: pointer;
  transition: background-color 0.15s var(--ac-ease);
  scroll-margin-top: calc(var(--ex-bar) + 72px);
  scroll-margin-bottom: 72px;
}

.people-table tbody tr:hover,
.audit-table tbody tr.a-row:hover {
  background: var(--ac-hover);
}

.people-table tbody tr.is-selected {
  background: var(--ac-accent-wash);
}

.people-table tbody tr:focus,
.audit-table tbody tr:focus {
  outline: none;
}

.people-table tbody tr:focus-visible,
.audit-table tbody tr.a-row:focus-visible {
  outline: 1px solid var(--ac-accent);
  outline-offset: -1px;
}

.people-table tbody tr.is-flash {
  animation: ac-flash 1.6s var(--ac-ease);
}

@keyframes ac-flash {
  from {
    background-color: var(--ac-flash);
  }
}

.people-table .sk-row,
.people-table .sk-row:hover {
  cursor: default;
  background: none;
}

.check {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--ac-accent);
  cursor: pointer;
  vertical-align: middle;
}

.check:disabled {
  cursor: not-allowed;
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.name-text {
  display: grid;
  min-width: 0;
}

.name-btn {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ac-text);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.name-btn:hover {
  color: var(--ac-accent-text);
}

.cell-sub {
  display: block;
  margin-top: 1px;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.cell-muted {
  color: var(--ac-muted);
}

/* The people table's text may wrap, so the columns share the width and it never scrolls sideways */
.people-table td,
.people-table .tf,
.people-table .lic {
  white-space: normal;
}

.c-role .cell-main,
.c-role .cell-sub,
.c-name .cell-sub {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}


.status-stack {
  display: grid;
  justify-items: start;
  gap: 3px;
}

.status-stack .tf {
  font-size: 0.75rem;
}

.audit-table td.c-what,
.audit-table td.c-target {
  white-space: normal;
}

.audit-table td.c-what {
  min-width: 220px;
}

.audit-table .a-what > span:last-child {
  min-width: 0;
}

/* ---------- Loading, empty ---------- */
.sk {
  display: block;
  height: 10px;
  border-radius: var(--ac-radius);
  background: var(--ac-line);
  animation: ac-pulse 1s var(--ac-ease) infinite alternate;
}

.sk + .sk {
  margin-top: 7px;
  height: 8px;
  opacity: 0.6;
}

.kpi.is-sk {
  min-height: 102px;
}

.kpi.is-sk .sk:first-child {
  width: 60%;
}

.kpi.is-sk .sk:nth-child(2) {
  width: 40%;
  height: 22px;
  margin-top: 10px;
}

@keyframes ac-pulse {
  from {
    opacity: 0.45;
  }
}

.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 56px 20px 60px;
  text-align: center;
  animation: ac-rise 0.4s var(--ac-ease-out);
}

.empty-sm {
  padding: 32px 20px 36px;
}

.empty svg {
  width: 32px;
  height: 32px;
  margin-bottom: 6px;
  color: var(--ac-subtle);
  stroke-width: 1.2;
}

.empty-title {
  font-weight: 600;
}

.empty-text {
  max-width: 360px;
  margin-bottom: 10px !important;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.list-empty {
  padding: 4px 20px 18px;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ac-s3);
  padding: 12px 20px;
}

.foot-count {
  color: var(--ac-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Roles and permissions ---------- */
.key-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 0 20px 12px;
  color: var(--ac-muted);
  font-size: 0.75rem;
}

.key-row li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.key-needs {
  color: var(--ac-soft);
  font-weight: 500;
}

.ac .key-lock {
  width: 13px;
  height: 13px;
  color: var(--ac-soft);
}

.matrix-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 20px 12px;
  padding: 10px 8px 10px 12px;
  border: 1px solid var(--ac-accent-wash-2);
  border-radius: var(--ac-radius);
  background: var(--ac-accent-wash);
  color: var(--ac-soft);
  font-size: 0.8125rem;
  animation: ac-rise 0.35s var(--ac-ease-out);
}

.matrix-note > svg {
  margin-top: 1px;
  color: var(--ac-accent);
}

.matrix-note p {
  flex: 1;
}

.matrix-note strong {
  color: var(--ac-text);
  font-weight: 600;
}

.matrix-note .chip-x {
  margin: -2px 0;
}

/* The matrix scrolls sideways inside its own box; the permission names stay put */
.matrix-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--ac-line);
  overscroll-behavior-x: contain;
}

.matrix-wrap:focus-visible {
  outline-offset: -1px;
}

.matrix {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
}

.matrix th,
.matrix td {
  padding: 0;
  border-bottom: 1px solid var(--ac-line);
  text-align: center;
  vertical-align: middle;
}

.matrix .m-perm {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 310px;
  min-width: 240px;
  padding: 10px 16px 10px 20px;
  border-right: 1px solid var(--ac-line);
  background: var(--ac-panel);
  text-align: left;
}

.matrix thead th {
  padding: 10px 6px;
  vertical-align: bottom;
}

.matrix thead .m-perm {
  color: var(--ac-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.role-head {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 100%;
  min-width: 84px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: var(--ac-radius);
  background: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ac-ease), border-color 0.2s var(--ac-ease);
}

.role-head:hover {
  border-color: var(--ac-line-2);
  background: var(--ac-hover);
}

.role-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ac-text);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}

.ac .role-name svg {
  width: 12px;
  height: 12px;
  color: var(--ac-muted);
}

.role-count {
  color: var(--ac-muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.role-new {
  animation: ac-flash 1.6s var(--ac-ease);
}

.m-grp th,
.m-grp td {
  background: var(--ac-panel-2);
}

.m-grp .m-perm {
  padding: 0;
  background: var(--ac-panel-2);
}

.grp-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 16px 9px 20px;
  border: 0;
  background: none;
  color: var(--ac-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.grp-btn:hover {
  color: var(--ac-accent-text);
}

.grp-btn:focus-visible {
  outline-offset: -2px;
}

.grp-btn .chev {
  width: 12px;
  height: 12px;
  transition: transform 0.25s var(--ac-ease-out);
}

.grp-btn[aria-expanded="false"] .chev {
  transform: rotate(-90deg);
}

.grp-btn small {
  margin-left: auto;
  padding-left: 8px;
  white-space: nowrap;
  color: var(--ac-muted);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.grp-sum {
  color: var(--ac-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.perm-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--ac-text);
  font-weight: 500;
}

.perm-desc {
  display: block;
  margin-top: 2px;
  color: var(--ac-muted);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
}

.perm-needs {
  display: block;
  margin-top: 2px;
  color: var(--ac-subtle);
  font-size: 0.75rem;
  font-weight: 400;
}

.perm-needs b {
  color: var(--ac-soft);
  font-weight: 500;
}

.m-cell {
  position: relative;
  min-width: 92px;
}

.m-cell.is-staged {
  background: var(--ac-accent-wash);
}

/* the switch: a small track with a square knob */
.sw {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 16px;
  margin: 10px 0;
  padding: 0;
  border: 1px solid var(--ac-line-3);
  border-radius: var(--ac-radius);
  background: var(--ac-bg);
  cursor: pointer;
  vertical-align: middle;
  transition: background-color 0.2s var(--ac-ease), border-color 0.2s var(--ac-ease);
}

.sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 1px;
  background: var(--ac-muted);
  transition: transform 0.25s var(--ac-ease-out), background-color 0.2s var(--ac-ease);
}

.sw:hover {
  border-color: var(--ac-accent);
}

.sw[aria-checked="true"] {
  border-color: var(--ac-accent);
  background: var(--ac-accent);
}

.sw[aria-checked="true"]::after {
  background: var(--ac-on-accent);
  transform: translateX(14px);
}

.sw[aria-disabled="true"] {
  cursor: help;
  opacity: 0.55;
}

.sw[aria-disabled="true"]:hover {
  border-color: var(--ac-line-3);
}

.sw[aria-disabled="true"][aria-checked="true"]:hover {
  border-color: var(--ac-accent);
}

.sw-lock {
  opacity: 0.7;
}

.staged-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  background: var(--ac-accent);
}

.m-col-admin {
  background: var(--ac-panel-2);
}

/* the sticky bar with staged changes */
.change-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--ac-accent);
  background: var(--ac-accent-wash);
  animation: ac-up 0.35s var(--ac-ease-out);
}

@keyframes ac-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.change-text {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--ac-soft);
}

.change-text strong {
  color: var(--ac-text);
  font-weight: 600;
}

.change-actions {
  display: flex;
  gap: var(--ac-s2);
}

.compare {
  scroll-margin-top: calc(var(--ex-bar) + 16px);
}

.compare-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 0 20px 16px;
}

.field-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.compare-out {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ac-line);
}

.cmp-col {
  min-width: 0;
  padding: 16px 20px 20px;
}

.cmp-col + .cmp-col {
  border-left: 1px solid var(--ac-line);
}

.cmp-col h3 {
  margin-bottom: 10px !important;
  color: var(--ac-text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.cmp-col h3 small {
  display: block;
  color: var(--ac-muted);
  font-size: 0.75rem;
  font-weight: 400;
}

/* plain-word lists: "can" with a check, "can't" with a dash */
.can-list {
  display: grid;
  gap: 7px;
  font-size: 0.8125rem;
}

.can-list li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
  color: var(--ac-soft);
}

.can-list svg {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

.can-list .is-can svg {
  color: var(--ac-ok);
}

.can-list .is-cant {
  color: var(--ac-muted);
}

.can-list .is-cant svg {
  color: var(--ac-subtle);
}

.can-list .tag {
  margin-left: 6px;
}

.can-none {
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

/* ---------- Access requests ---------- */
.req-list {
  display: grid;
}

.req {
  display: grid;
  /* a fixed first column, so every row's request text starts at the same place */
  grid-template-columns: 220px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px 20px;
  padding: 16px 20px;
  border-top: 1px solid var(--ac-line);
}

.req.is-new {
  animation: ac-rise 0.4s var(--ac-ease-out);
}

.req-who {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.req-name {
  font-weight: 500;
}

.req-meta {
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.req-what {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.req-ask {
  color: var(--ac-soft);
}

.req-ask strong {
  color: var(--ac-text);
  font-weight: 600;
}

.req-reason {
  padding-left: 10px;
  border-left: 2px solid var(--ac-line-2);
  color: var(--ac-soft);
}

.req-act {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.dur {
  display: inline-flex;
  align-items: center;
  height: 30px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-bg);
  font-size: 0.8125rem;
}

.dur:focus-within {
  border-color: var(--ac-accent);
}

.dur span {
  padding: 0 2px 0 8px;
  color: var(--ac-muted);
}

.dur select {
  height: 100%;
  padding: 0 4px;
  border: 0;
  background: none;
  cursor: pointer;
}

.ac .dur select:focus-visible {
  outline: none;
}

.dur.is-disabled {
  opacity: 0.55;
}

.why {
  grid-column: 2 / -1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--ac-line-2);
  border-radius: var(--ac-radius);
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.why svg {
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

.why strong {
  color: var(--ac-text);
  font-weight: 500;
}

.deny-form {
  grid-column: 2 / -1;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-panel-2);
  animation: ac-rise 0.3s var(--ac-ease-out);
}

.deny-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* time left: a countdown and a bar that empties */
.left {
  display: grid;
  gap: 6px;
  min-width: 170px;
}

.left-text {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.countdown {
  color: var(--ac-text);
  font-size: 0.9375rem;
  font-weight: 600;
}

.left .meter span {
  transition: transform 1s linear;
}

.due {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
}

.due svg {
  width: 12px;
  height: 12px;
}

.due-soon svg {
  color: var(--ac-warn);
}

.due-over {
  color: var(--ac-bad-text);
}

.due-over svg {
  color: var(--ac-bad);
}

.req-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ac-soft);
  font-size: 0.8125rem;
}

.req-state svg {
  width: 12px;
  height: 12px;
}

.req-state.is-ok svg {
  color: var(--ac-ok);
}

.req-state.is-flag svg {
  color: var(--ac-bad);
}

.req.is-done {
  background: var(--ac-panel-2);
}

.done-list {
  display: grid;
  padding: 0 20px 8px;
}

.done-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  padding: 11px 0;
  border-top: 1px solid var(--ac-line);
  font-size: 0.8125rem;
}

.done-list .done-what {
  color: var(--ac-soft);
}

.done-list .done-what b {
  color: var(--ac-text);
  font-weight: 500;
}

.done-list .done-when {
  color: var(--ac-muted);
  white-space: nowrap;
}

.done-list .done-why {
  grid-column: 1 / -1;
  color: var(--ac-muted);
}

/* ---------- Audit log ---------- */
.audit-tools .search {
  max-width: 300px;
}

.col-more {
  width: 56px;
}

.a-what {
  display: flex;
  align-items: center;
  gap: 8px;
}

.a-type {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  color: var(--ac-soft);
}

.ac .a-type svg {
  width: 12px;
  height: 12px;
}

.a-target {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.a-toggle .chev {
  width: 14px;
  height: 14px;
  transition: transform 0.25s var(--ac-ease-out);
}

.a-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.a-row.is-open td {
  border-bottom-color: transparent;
}

.a-row.is-new {
  animation: ac-flash 1.6s var(--ac-ease);
}

.a-detail td {
  padding: 0 20px 16px !important;
  white-space: normal;
  cursor: default;
}

.a-detail-box {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-panel-2);
  animation: ac-rise 0.3s var(--ac-ease-out);
}

.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 16px;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.kv dt {
  color: var(--ac-muted);
}

.kv dd {
  min-width: 0;
  color: var(--ac-soft);
  overflow-wrap: anywhere;
}

.diff {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.diff th,
.diff td {
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--ac-line);
  text-align: left;
  white-space: normal;
}

.diff th {
  color: var(--ac-muted);
  font-weight: 500;
}

.diff tr:last-child td {
  border-bottom: 0;
}

.diff .was {
  color: var(--ac-muted);
}

.diff .now {
  color: var(--ac-text);
  font-weight: 500;
}

.a-seal {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ac-muted);
  font-size: 0.75rem;
}

.a-seal svg {
  width: 12px;
  height: 12px;
}

/* ---------- Security policy ---------- */
.settings {
  margin: 0;
}

/* Full width like the other views' cards; the description column keeps a readable width */
.set-row {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  align-items: start;
  gap: 8px 24px;
  min-width: 0;
  margin: 0;
  padding: 16px 20px;
  border: 0;
  border-top: 1px solid var(--ac-line);
}

fieldset.set-row > legend {
  float: left;
  padding: 0;
}

.set-label {
  display: grid;
  gap: 2px;
  color: var(--ac-text);
  font-weight: 500;
}

.set-label span {
  color: var(--ac-muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.select {
  justify-self: start;
  min-width: 200px;
  max-width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-bg);
  color: var(--ac-text);
  cursor: pointer;
}

.select:hover {
  border-color: var(--ac-line-3);
}

.select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.select-sm {
  min-width: 0;
  height: 30px;
}

.radio-group {
  display: inline-flex;
  justify-self: start;
  max-width: 100%;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
}

.radio {
  position: relative;
  cursor: pointer;
}

.radio + .radio {
  border-left: 1px solid var(--ac-line-2);
}

.radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio span {
  display: block;
  padding: 6px 12px;
  color: var(--ac-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s var(--ac-ease), background-color 0.2s var(--ac-ease);
}

.radio:hover span {
  color: var(--ac-text);
}

.radio input:checked + span {
  background: var(--ac-accent-wash);
  color: var(--ac-text);
}

.radio input:focus-visible + span {
  outline: 1px solid var(--ac-accent-2);
  outline-offset: -2px;
}

.radio input:disabled + span {
  cursor: not-allowed;
  opacity: 0.6;
}

.check-group {
  display: grid;
  gap: 9px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  color: var(--ac-soft);
  cursor: pointer;
}

.check-row:hover {
  color: var(--ac-text);
}

.check-row small {
  color: var(--ac-muted);
  font-size: 0.75rem;
}

.check-row.is-locked {
  cursor: default;
}

.check-row.is-locked:hover {
  color: var(--ac-soft);
}

.inline-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  color: var(--ac-soft);
}

.settings.is-readonly .check-row,
.settings.is-readonly .radio {
  cursor: not-allowed;
}

.settings .is-saved {
  color: var(--ac-ok);
}

/* ---------- Locked screen ---------- */
.locked {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 56px 24px 60px;
  text-align: center;
  animation: ac-rise 0.4s var(--ac-ease-out);
}

.locked-icon {
  width: 32px !important;
  height: 32px !important;
  margin-bottom: 6px;
  color: var(--ac-muted);
  stroke-width: 1.2 !important;
}

.locked-title {
  font-size: 1.0625rem;
  font-weight: 600;
}

.locked-text,
.locked-who {
  max-width: 460px;
  color: var(--ac-soft);
}

.locked-who {
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.locked-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

/* ---------- Person details panel ---------- */
.panel-scrim {
  position: fixed;
  inset: var(--ex-bar) 0 0;
  z-index: 70; /* above the custom scrollbar (example.css) */
  background: var(--ac-scrim);
  opacity: 0;
  transition: opacity 0.3s var(--ac-ease);
}

.panel {
  position: fixed;
  inset: var(--ex-bar) 0 0 auto;
  z-index: 71;
  display: flex;
  flex-direction: column;
  width: min(480px, 100%);
  border-left: 1px solid var(--ac-line-2);
  background: var(--ac-panel);
  transform: translateX(100%);
  transition: transform 0.4s var(--ac-ease-out);
}

.is-panel-open .panel {
  transform: none;
}

.is-panel-open .panel-scrim {
  opacity: 1;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ac-s3);
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--ac-line);
}

.panel-who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.panel-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-title:focus {
  outline: none;
}

.panel-sub {
  margin-top: 2px !important;
  color: var(--ac-muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.panel-head .icon-btn {
  margin: -4px -8px 0 0;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 20px 24px;
}

.panel-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--ac-line);
}

.panel-section:last-child {
  border-bottom: 0;
}

.panel-section h3 {
  margin-bottom: 10px !important;
  color: var(--ac-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-section fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.panel-section legend {
  margin-bottom: 10px;
  padding: 0;
  color: var(--ac-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.panel-notice {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-panel-2);
  color: var(--ac-soft);
  font-size: 0.8125rem;
}

.panel-notice strong {
  display: block;
  color: var(--ac-text);
  font-weight: 600;
}

.panel-notice.is-warn {
  border-color: var(--ac-warn-line);
  background: var(--ac-warn-wash);
}

.panel-notice.is-bad {
  border-color: var(--ac-bad-line);
  background: var(--ac-bad-wash);
}

.notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-field {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-bg);
  color: var(--ac-text);
  font-size: 0.75rem;
}

.pill-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-check {
  position: relative;
  cursor: pointer;
}

.pill-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill-check span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  color: var(--ac-soft);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: border-color 0.2s var(--ac-ease), background-color 0.2s var(--ac-ease), color 0.2s var(--ac-ease);
}

/* the box inside each pill: empty, or filled with a check */
.pill-check span::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1px solid var(--ac-line-3);
  border-radius: 1px;
}

.pill-check:hover span {
  border-color: var(--ac-line-3);
  color: var(--ac-text);
}

.pill-check input:checked + span {
  border-color: var(--ac-accent);
  background: var(--ac-accent-wash);
  color: var(--ac-text);
}

.pill-check input:checked + span::before {
  border-color: var(--ac-accent);
  background: var(--ac-accent);
}

/* the check mark, drawn with two borders */
.pill-check input:checked + span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 14px;
  width: 3px;
  height: 6px;
  border-right: 1.5px solid var(--ac-on-accent);
  border-bottom: 1.5px solid var(--ac-on-accent);
  transform: translateY(-62%) rotate(45deg);
}

.pill-check input:focus-visible + span {
  outline: 1px solid var(--ac-accent-2);
  outline-offset: 2px;
}

.pill-check input:disabled + span {
  cursor: not-allowed;
  opacity: 0.55;
}

.pill-check:has(input:disabled):hover span {
  border-color: var(--ac-line-2);
  color: var(--ac-soft);
}

.pill-check:has(input:disabled:checked):hover span {
  border-color: var(--ac-accent);
}

.pill-check:has(input:disabled) {
  cursor: not-allowed;
}

.field-note {
  margin-top: 8px !important;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.panel .field-error {
  margin-top: 8px !important;
}

.sessions {
  display: grid;
  gap: 10px;
  margin-bottom: 12px !important;
}

.sessions li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1px 10px;
  font-size: 0.8125rem;
}

.sessions svg {
  grid-row: span 2;
  margin-top: 2px;
  color: var(--ac-muted);
}

.sessions .s-where {
  color: var(--ac-muted);
}

.mini-feed {
  display: grid;
  gap: 10px;
  font-size: 0.8125rem;
}

.mini-feed li {
  display: grid;
  gap: 1px;
  padding-left: 12px;
  border-left: 1px solid var(--ac-line-2);
}

.mini-feed .mf-when {
  color: var(--ac-muted);
  font-variant-numeric: tabular-nums;
}

.lic-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.lic-form .field {
  flex: 1 1 160px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ac-s2);
  padding: 14px 20px;
  border-top: 1px solid var(--ac-line);
}

.panel-actions .ro-note {
  flex: 1 1 100%;
}

.panel-actions .push {
  margin-left: auto;
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  z-index: 80; /* above the side panel */
  display: grid;
  justify-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--ac-toast);
  border-radius: var(--ac-radius);
  background: var(--ac-toast);
  color: var(--ac-toast-text);
  font-size: 0.8125rem;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ac-ease), transform 0.4s var(--ac-ease-out);
}

.has-changes .toasts {
  bottom: 84px; /* above the bar of unsaved permission changes */
}

.toast.is-on {
  opacity: 1;
  transform: none;
}

.toast > svg {
  width: 14px;
  height: 14px;
  color: var(--ac-toast-link);
}

.toast-btn {
  flex: none;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--ac-radius);
  background: none;
  color: var(--ac-toast-link);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.toast-btn:hover {
  background: var(--ac-toast-hover);
}

.ac .toast-btn:focus-visible {
  outline-color: var(--ac-toast-link);
}

/* ---------- Dialogs ---------- */
.dialog {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-panel);
  color: var(--ac-text);
  overflow: hidden;
}

.dialog[open] {
  display: flex;
  flex-direction: column;
  animation: ac-pop 0.3s var(--ac-ease-out);
}

.dialog-mid {
  width: min(600px, calc(100% - 32px));
}

.dialog-wide {
  width: min(920px, calc(100% - 32px));
}

.dialog::backdrop {
  background: var(--ac-scrim);
}

@keyframes ac-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.dialog-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.dialog-head {
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 12px 12px 20px;
  border-bottom: 1px solid var(--ac-line);
}

.dialog-head h2 {
  margin: 4px 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.dialog-sub {
  margin-top: 2px !important;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.dialog-body {
  display: grid;
  gap: 14px;
  padding: 16px 20px 18px;
  overflow-y: auto;
}

.dialog-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-text {
  color: var(--ac-soft);
}

.dialog-text p + p {
  margin-top: 8px;
}

.dialog-text strong {
  color: var(--ac-text);
  font-weight: 600;
}

.dialog-foot {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--ac-line);
}

.foot-note {
  margin-right: auto !important;
  color: var(--ac-muted);
  font-size: 0.75rem;
}

.dialog-note {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.keys {
  display: grid;
  padding: 8px 20px;
  overflow-y: auto;
}

.keys div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ac-line);
}

.keys div:last-child {
  border-bottom: 0;
}

.keys dt {
  display: flex;
  gap: 4px;
  order: 2;
}

.keys dd {
  color: var(--ac-soft);
}

/* ---------- Form fields ---------- */
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field > label,
.field > legend {
  padding: 0;
  color: var(--ac-text);
  font-size: 0.8125rem;
  font-weight: 500;
}

.field > legend {
  margin-bottom: 6px;
}

.input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-bg);
  color: var(--ac-text);
  transition: border-color 0.2s var(--ac-ease);
}

.input:hover {
  border-color: var(--ac-line-3);
}

.ac .input:focus-visible,
.ac .input:focus {
  border-color: var(--ac-accent);
  outline: none;
}

.input::placeholder {
  color: var(--ac-subtle);
}

.input[aria-invalid="true"] {
  border-color: var(--ac-bad);
}

.textarea {
  height: auto;
  min-height: 76px;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.45;
}

.field-hint {
  color: var(--ac-muted);
  font-size: 0.75rem;
}

.field-error,
.field-warn {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.8125rem;
}

.field-error {
  color: var(--ac-bad-text);
}

.field-warn {
  color: var(--ac-warn-text);
}

.field-error svg,
.field-warn svg {
  width: 13px !important;
  height: 13px !important;
  margin-top: 2px;
}

.field-error svg {
  color: var(--ac-bad);
}

.field-warn svg {
  color: var(--ac-warn);
}

.error-summary {
  padding: 10px 12px;
  border: 1px solid var(--ac-bad-line);
  border-radius: var(--ac-radius);
  background: var(--ac-bad-wash);
  color: var(--ac-bad-text);
  font-size: 0.8125rem;
}

.error-summary:focus {
  outline: none;
}

.error-summary strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ac-text);
  font-weight: 600;
}

.error-summary ul {
  display: grid;
  gap: 2px;
  padding-left: 0;
}

.error-summary button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ac-bad-text);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.invite-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  min-height: 100%;
}

/* wide screens: the form and the summary scroll on their own, so the summary stays in view */
@media (min-width: 961px) {
  .dialog-wide .dialog-scroll {
    display: flex;
    overflow: hidden;
  }

  .invite-grid {
    flex: 1;
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
  }

  .invite-fields,
  .invite-summary {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.invite-fields {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px 20px 22px;
}

.invite-summary {
  padding: 18px 20px 22px;
  border-left: 1px solid var(--ac-line);
  background: var(--ac-panel-2);
}

.sum-title {
  margin-bottom: 12px !important;
  color: var(--ac-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sum-lead {
  margin-bottom: 12px !important;
  color: var(--ac-soft);
}

.sum-lead strong {
  color: var(--ac-text);
  font-weight: 600;
}

.sum-block + .sum-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--ac-line-2);
}

.sum-block h4 {
  margin: 0 0 8px;
  color: var(--ac-text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.sum-facts {
  display: grid;
  gap: 8px;
  color: var(--ac-soft);
  font-size: 0.8125rem;
}

.sum-facts li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
}

.sum-facts svg {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--ac-muted);
}

.sum-empty {
  display: grid;
  gap: 8px;
  justify-items: start;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

.role-pick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.option-list {
  display: grid;
  gap: 6px;
}

.role-opt,
.option {
  position: relative;
  display: block;
  cursor: pointer;
}

.role-opt input,
.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-opt > span,
.option > span {
  display: grid;
  gap: 2px;
  height: 100%;
  padding: 8px 10px 8px 30px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  font-size: 0.8125rem;
  transition: border-color 0.2s var(--ac-ease), background-color 0.2s var(--ac-ease);
}

/* the radio dot */
.role-opt > span::before,
.option > span::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 10px;
  width: 12px;
  height: 12px;
  border: 1px solid var(--ac-line-3);
  border-radius: 50%;
  background: var(--ac-bg);
  transition: border-color 0.2s var(--ac-ease), background-color 0.2s var(--ac-ease);
}

.role-opt strong,
.option strong {
  color: var(--ac-text);
  font-weight: 500;
}

.role-opt small,
.option small {
  color: var(--ac-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.role-opt:hover > span,
.option:hover > span {
  border-color: var(--ac-line-3);
}

.role-opt input:checked + span,
.option input:checked + span {
  border-color: var(--ac-accent);
  background: var(--ac-accent-wash);
}

.role-opt input:checked + span::before,
.option input:checked + span::before {
  border: 4px solid var(--ac-accent);
}

.role-opt input:focus-visible + span,
.option input:focus-visible + span {
  outline: 1px solid var(--ac-accent-2);
  outline-offset: 2px;
}

.role-opt input:disabled + span,
.option input:disabled + span {
  cursor: not-allowed;
  opacity: 0.5;
}

.role-opt:has(input:disabled),
.option:has(input:disabled) {
  cursor: not-allowed;
}

.role-opt:has(input:disabled):hover > span,
.option:has(input:disabled):hover > span {
  border-color: var(--ac-line-2);
}

.fieldset-error .role-opt > span,
.fieldset-error .pill-check span {
  border-color: var(--ac-bad-line);
}

.loc-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.license-field {
  padding: 12px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  background: var(--ac-panel-2);
  animation: ac-rise 0.35s var(--ac-ease-out);
}

.license-field > legend {
  float: left;
  width: 100%;
  margin-bottom: 4px;
}

.create-copy {
  margin-top: 6px;
}

/* review of staged changes */
.review-list {
  display: grid;
  padding: 4px 20px 12px;
}

.rv-role {
  padding: 14px 0;
  border-bottom: 1px solid var(--ac-line);
}

.rv-role:last-child {
  border-bottom: 0;
}

.rv-role h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 10px !important;
  font-size: 0.875rem;
  font-weight: 600;
}

.rv-role h3 small {
  color: var(--ac-muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.rv-changes {
  display: grid;
  gap: 8px;
  font-size: 0.8125rem;
}

.rv-changes li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  color: var(--ac-soft);
}

.rv-changes svg {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

.rv-on svg {
  color: var(--ac-ok);
}

.rv-off svg {
  color: var(--ac-bad);
}

.rv-changes .tag {
  margin-left: 6px;
}

.rv-changes b {
  color: var(--ac-text);
  font-weight: 600;
}

.rv-reason {
  display: block;
  margin-top: 2px;
  color: var(--ac-muted);
}

.rv-who {
  margin-top: 10px !important;
  color: var(--ac-muted);
  font-size: 0.8125rem;
}

/* one role */
.role-sec {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ac-line);
}

.role-sec:last-child {
  border-bottom: 0;
}

.role-sec h3 {
  margin-bottom: 8px !important;
  color: var(--ac-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-sec p {
  color: var(--ac-soft);
  font-size: 0.8125rem;
}

.role-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.role-row .field {
  flex: 1 1 200px;
}

.role-people {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px !important;
}

.role-people li {
  padding: 2px 8px;
  border: 1px solid var(--ac-line-2);
  border-radius: var(--ac-radius);
  color: var(--ac-soft);
  font-size: 0.75rem;
}

/* ---------- Medium screens ---------- */
@media (max-width: 1240px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .attn-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .ov-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .req {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .req-what {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .why,
  .deny-form {
    grid-column: 1 / -1;
  }
}

/* The sidebar shrinks to icons before the people table runs out of room */
@media (max-width: 1180px) {
  .app {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .side {
    padding: 16px 10px;
  }

  .brand {
    padding: 2px;
    justify-content: center;
  }

  .brand-name,
  .me {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 9px 0;
  }

  .nav-count,
  .nav-item.is-locked .nav-lock {
    display: none;
  }

  .main {
    padding: 24px 24px 64px;
  }

  /* hidden labels keep naming the icon-only nav items for screen readers */
  .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

}

@media (max-width: 960px) {
  .compare-out {
    grid-template-columns: minmax(0, 1fr);
  }

  .cmp-col + .cmp-col {
    border-left: 0;
    border-top: 1px solid var(--ac-line);
  }

  .invite-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .invite-summary {
    border-left: 0;
    border-top: 1px solid var(--ac-line);
  }
}

/* ---------- Phones: the sidebar becomes a top bar, tables become cards ---------- */
@media (max-width: 760px) {
  .app {
    display: block;
  }

  .side {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    height: auto;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--ac-line);
  }

  .brand {
    padding: 0;
  }

  .brand .brand-mark {
    width: 24px;
    height: 24px;
  }

  .nav {
    display: flex;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    gap: 6px;
    padding: 7px 10px;
    font-size: 0.8125rem;
  }

  .nav-item svg {
    display: none;
  }

  .nav-label {
    position: static;
    display: block;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }

  .nav-item.is-locked .nav-lock {
    display: block;
  }

  .main {
    gap: 20px;
    padding: 20px 16px 56px;
  }

  .page-head {
    align-items: flex-start;
  }

  .page-head h1 {
    font-size: 1.375rem;
  }

  .head-actions {
    width: 100%;
  }

  /* "Viewing as" on its own row; Invite person and the shortcuts below it */
  .viewing {
    flex: 1 1 100%;
    min-width: 0;
  }

  #invite-btn {
    flex: 1;
  }

  .viewing-select {
    flex: 1;
    min-width: 0;
  }

  .head-actions .btn-ghost .btn-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .head-actions .btn {
    height: 32px;
    padding: 0 10px;
  }

  .notice {
    flex-wrap: wrap;
  }

  .notice p {
    flex: 1 1 200px;
  }

  .notice-lock {
    margin: 0 16px 12px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .kpi {
    padding: 14px;
  }

  /* an odd tile out takes the whole row */
  .kpi:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .kpi-value {
    font-size: 1.5rem;
  }

  .attn-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .attn {
    padding: 12px 12px 12px 14px;
  }

  .card-head {
    flex-wrap: wrap;
    padding: 14px 16px 10px;
  }

  .card-foot {
    padding: 12px 16px 14px;
  }

  .feed,
  .done-list {
    padding: 0 16px 8px;
  }

  .loc-bars {
    padding: 0 6px 10px;
  }

  .toolbar {
    gap: 8px;
    padding: 10px 16px;
  }

  .search {
    flex: 1 1 100%;
    max-width: none !important;
  }

  .search kbd {
    display: none;
  }

  .pick {
    flex: 1 1 140px;
  }

  .pick select {
    flex: 1;
    max-width: none;
  }

  .toolbar-wrap {
    position: static;
  }

  .bulkbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    padding: 10px 16px;
    border-top: 1px solid var(--ac-accent);
    transform: translateY(100%);
  }

  .bulk-actions {
    gap: 6px;
  }

  .bulk-actions .btn {
    padding: 6px 8px;
  }

  .bulk-actions .btn-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .is-bulk .toasts {
    bottom: 72px;
  }

  .filters {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .chips {
    flex: 1 1 100%;
    margin: 0 -16px;
    padding: 0 16px;
  }

  .active-filter {
    margin-left: 0;
  }

  .ro-note-block {
    margin: 0 16px 12px !important;
  }

  /* people: each person as a card */
  .table-wrap {
    overflow: visible;
  }

  .people-table thead {
    display: none;
  }

  .people-table,
  .people-table tbody {
    display: block;
  }

  .people-table tbody tr {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    grid-template-areas:
      "check name name"
      ". role role"
      ". status status"
      ". last lic";
    align-items: center;
    gap: 8px 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ac-line);
  }

  .no-select .people-table tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name name"
      "role role"
      "status status"
      "last lic";
  }

  .people-table td,
  .people-table td:first-child,
  .people-table td:last-child,
  .no-select .people-table td:nth-child(2) {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .people-table td.c-check {
    grid-area: check;
    align-self: start;
    padding-top: 7px;
  }

  .no-select .people-table td.c-check {
    display: none;
  }

  .people-table td.c-name {
    grid-area: name;
  }

  .people-table td.c-status {
    grid-area: status;
  }

  .people-table td.c-role {
    grid-area: role;
    color: var(--ac-soft);
    font-size: 0.8125rem;
  }

  .people-table td.c-role .cell-main,
  .people-table td.c-role .cell-sub {
    display: inline;
    max-width: none;
  }

  .people-table td.c-role .cell-sub::before {
    content: ", ";
  }

  .people-table .status-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
  }

  .people-table .status-stack .tf {
    font-size: 0.8125rem;
  }

  .people-table td.c-last {
    grid-area: last;
    color: var(--ac-muted);
    font-size: 0.8125rem;
  }

  .people-table td.c-lic {
    grid-area: lic;
    justify-self: end;
  }

  .people-table td.c-lic.is-none {
    display: none;
  }

  .people-table td.c-name .cell-sub {
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .people-table .sk-row td:nth-child(n + 4) {
    display: none;
  }

  /* audit: each entry as a card */
  .audit-table thead {
    display: none;
  }

  .audit-table,
  .audit-table tbody {
    display: block;
  }

  .audit-table tbody tr.a-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "what more"
      "who more"
      "target target"
      "when where";
    gap: 4px 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ac-line);
  }

  .audit-table tbody tr.a-row.is-open {
    border-bottom-color: transparent;
  }

  .audit-table td,
  .audit-table td:first-child,
  .audit-table td:last-child {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .audit-table .c-what {
    grid-area: what;
  }

  .audit-table .c-who {
    grid-area: who;
    color: var(--ac-soft);
    font-size: 0.8125rem;
  }

  .audit-table .c-who .cell-sub {
    display: inline;
  }

  .audit-table .c-who .cell-sub::before {
    content: ", ";
  }

  .audit-table .c-target {
    grid-area: target;
    font-size: 0.8125rem;
  }

  .audit-table .c-target::before {
    content: "Target: ";
    color: var(--ac-muted);
  }

  .audit-table .a-target {
    display: inline;
    max-width: none;
  }

  .audit-table .c-when {
    grid-area: when;
    color: var(--ac-muted);
    font-size: 0.75rem;
  }

  .audit-table .c-when .cell-sub,
  .audit-table .c-where .cell-sub {
    display: none;
  }

  .audit-table .c-where {
    grid-area: where;
    justify-self: end;
    color: var(--ac-muted);
    font-size: 0.75rem;
  }

  .audit-table .c-more {
    grid-area: more;
    align-self: start;
  }

  .audit-table .a-detail {
    display: block;
    border-bottom: 1px solid var(--ac-line);
  }

  .audit-table .a-detail[hidden] {
    display: none !important;
  }

  .audit-table .a-detail td {
    padding: 0 16px 14px !important;
  }

  .kv {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .kv dd + dt {
    margin-top: 8px;
  }

  .table-foot {
    padding: 12px 16px;
  }

  /* roles: the permission column narrows, the rest scrolls inside the box */
  .key-row {
    padding: 0 16px 12px;
  }

  .matrix-note {
    margin: 0 16px 12px;
  }

  .matrix {
    min-width: 0;
  }

  .matrix .m-perm {
    width: 170px;
    min-width: 170px;
    max-width: 170px;
    padding: 10px 10px 10px 16px;
  }

  .matrix .m-perm .perm-desc,
  .matrix .m-perm .perm-needs {
    display: none;
  }

  .grp-btn {
    padding: 9px 10px 9px 16px;
  }

  .grp-btn small {
    display: none;
  }

  .m-cell {
    min-width: 84px;
  }

  .change-bar {
    padding: 12px 16px;
  }

  .change-actions {
    width: 100%;
  }

  .change-actions .btn {
    flex: 1;
  }

  .compare-pick {
    padding: 0 16px 14px;
  }

  .field-inline {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .field-inline .select {
    flex: 1;
    min-width: 0;
  }

  .cmp-col {
    padding: 14px 16px 18px;
  }

  /* access requests */
  .req {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 16px;
  }

  .req-what {
    grid-row: auto;
  }

  .req-act {
    justify-content: flex-start;
  }

  .left {
    min-width: 0;
  }

  .head-note {
    font-size: 0.75rem;
  }

  /* settings */
  .set-row {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 16px;
  }

  fieldset.set-row > legend {
    width: 100%;
    margin-bottom: 8px;
  }

  .select {
    width: 100%;
    min-width: 0;
  }

  .select-sm {
    width: auto;
  }

  .settings .card-head {
    flex-wrap: wrap;
  }

  /* panel and dialogs */
  .panel {
    width: 100%;
    border-left: 0;
  }

  .panel-body {
    padding: 0 16px 20px;
  }

  .panel-actions {
    padding: 12px 16px;
  }

  .toasts {
    bottom: 16px;
  }

  .is-panel-open .toasts {
    bottom: 76px;
  }

  .dialog {
    max-height: calc(100dvh - 24px);
  }

  .dialog-wide,
  .dialog-mid,
  .dialog {
    width: calc(100% - 24px);
  }

  .role-pick,
  .field-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .invite-fields,
  .invite-summary {
    padding: 16px;
  }

  .dialog-foot {
    padding: 12px 16px;
  }

  .foot-note {
    flex: 1 1 100%;
  }

  .dialog-body {
    padding: 14px 16px 16px;
  }

  .review-list {
    padding: 4px 16px 12px;
  }

  .role-sec {
    padding: 14px 16px;
  }
}

/* words that only show when a row becomes a card on phones */
.m-only {
  display: none;
}

@media (max-width: 760px) {
  .m-only {
    display: inline;
  }
}

/* the people table fits a 1280px screen without scrolling sideways */
@media (min-width: 761px) {
  .people-table th,
  .people-table td {
    padding-right: 10px;
    padding-left: 10px;
  }

  .c-role .cell-main,
  .c-role .cell-sub {
    max-width: 200px;
  }
}
