:root,
[data-theme="light"] {
  color-scheme: light;
  --gw-bg: #ffffff;
  --gw-bg-muted: #e7e7e7;
  --gw-bg-elevated: #ffffff;
  --gw-bg-sidebar: #fafafa;
  --gw-fg: #262626;
  --gw-fg-muted: #6d6d6d;
  --gw-fg-subtle: #b0b0b0;
  --gw-border: #efefef;
  --gw-border-strong: #e7e7e7;
  --gw-card: #ffffff;
  --gw-card-border: #efefef;
  --gw-input-bg: #f9fafb;
  --gw-input-border: #e2e8f0;
  --gw-accent: #7c3fff;
  --gw-accent-hover: #6e18ff;
  --gw-accent-soft: #f3f1ff;
  --gw-on-accent: #ffffff;
  --gw-login-canvas: #f7f5ff;
  --gw-login-frame: #ffffff;
  --gw-login-frame-border: #e7e2f5;
  --gw-login-visual: #15111f;
  --gw-login-visual-border: rgba(255, 255, 255, 0.12);
  --gw-login-visual-line: rgba(231, 222, 255, 0.42);
  --gw-login-visual-muted: #bcb1d9;
  --gw-login-visual-chip: rgba(124, 63, 255, 0.22);
  --gw-login-visual-text: #ffffff;
  --gw-success: #16a34a;
  --gw-success-soft: #edf9f2;
  --gw-danger: #dc2626;
  --gw-danger-soft: #fef2f2;
  --gw-warning: #ea670c;
  --gw-warning-soft: #fff7ed;
  --gw-info: #1b6af5;
  --gw-modal-backdrop: rgba(38, 38, 38, 0.48);
  --gw-focus: 0 0 0 2px var(--gw-bg), 0 0 0 4px var(--gw-accent);
  --gw-radius-sm: 6px;
  --gw-radius-md: 8px;
  --gw-radius-lg: 12px;
  --gw-space-1: 4px;
  --gw-space-2: 8px;
  --gw-space-3: 12px;
  --gw-space-4: 16px;
  --gw-space-5: 20px;
  --gw-space-6: 24px;
  --gw-space-8: 32px;
  --gw-sidebar-w: 260px;
  --gw-font: "Geist Sans", "Geist", ui-sans-serif, system-ui, sans-serif;
  --gw-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --gw-bg: #000000;
  --gw-bg-muted: #111111;
  --gw-bg-elevated: #0a0a0a;
  --gw-bg-sidebar: #000000;
  --gw-fg: #ededed;
  --gw-fg-muted: #888888;
  --gw-fg-subtle: #666666;
  --gw-border: #1a1a1a;
  --gw-border-strong: #333333;
  --gw-card: #0a0a0a;
  --gw-card-border: #1a1a1a;
  --gw-input-bg: #0a0a0a;
  --gw-input-border: #333333;
  --gw-accent: #7c3fff;
  --gw-accent-hover: #9a76ff;
  --gw-accent-soft: rgba(124, 63, 255, 0.16);
  --gw-on-accent: #ffffff;
  --gw-login-canvas: #050407;
  --gw-login-frame: #0a0a0a;
  --gw-login-frame-border: #211c2c;
  --gw-login-visual: #120d1d;
  --gw-login-visual-border: rgba(231, 222, 255, 0.16);
  --gw-login-visual-line: rgba(231, 222, 255, 0.3);
  --gw-login-visual-muted: #a99bc8;
  --gw-login-visual-chip: rgba(124, 63, 255, 0.24);
  --gw-login-visual-text: #ffffff;
  --gw-success: #22c55e;
  --gw-success-soft: rgba(34, 197, 94, 0.12);
  --gw-danger: #ef4444;
  --gw-danger-soft: rgba(239, 68, 68, 0.12);
  --gw-warning: #f97316;
  --gw-warning-soft: rgba(249, 115, 22, 0.14);
  --gw-info: #0070f3;
  --gw-modal-backdrop: rgba(0, 0, 0, 0.72);
  --gw-focus: 0 0 0 2px var(--gw-bg), 0 0 0 4px var(--gw-accent);
}

/* Base reset / typography */

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

html {
  min-block-size: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-block-size: 100dvh;
  font-family: var(--gw-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--gw-fg);
  background: var(--gw-bg);
}

a {
  color: var(--gw-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--gw-fg);
}

h1 {
  font-size: 24px;
  line-height: 1.25;
}

h2 {
  font-size: 16px;
  line-height: 1.35;
}

p {
  margin: 0;
}

code,
.mono,
.key-prefix {
  font-family: var(--gw-mono);
  font-size: 0.92em;
}

.muted {
  color: var(--gw-fg-muted);
}

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


button,
.btn,
a.button,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gw-space-2);
  min-height: 36px;
  padding: 0 var(--gw-space-4);
  border: 1px solid transparent;
  border-radius: var(--gw-radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms cubic-bezier(0.23, 1, 0.32, 1),
    border-color 120ms cubic-bezier(0.23, 1, 0.32, 1),
    color 120ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 100ms cubic-bezier(0.23, 1, 0.32, 1);
  background: var(--gw-accent);
  color: var(--gw-on-accent);
}

button:hover,
.btn:hover,
a.button:hover,
a.btn:hover {
  background: var(--gw-accent-hover);
  text-decoration: none;
}

button:active,
.btn:active,
a.button:active {
  transform: scale(0.97);
}

button:focus-visible,
.btn:focus-visible,
a.button:focus-visible,
a.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--gw-focus);
}

button.secondary,
.btn.secondary,
a.button.secondary,
a.btn.secondary {
  background: transparent;
  color: var(--gw-fg);
  border-color: var(--gw-border-strong);
}

button.secondary:hover,
.btn.secondary:hover,
a.button.secondary:hover {
  background: var(--gw-bg-muted);
  border-color: var(--gw-border-strong);
}

button.ghost,
.btn.ghost {
  background: transparent;
  color: var(--gw-fg-muted);
  border-color: transparent;
}

button.ghost:hover,
.btn.ghost:hover {
  background: var(--gw-bg-muted);
  color: var(--gw-fg);
}

button.danger,
.btn.danger,
a.button.danger {
  background: transparent;
  color: var(--gw-danger);
  border-color: var(--gw-border-strong);
}

button.danger:hover,
.btn.danger:hover {
  background: var(--gw-danger-soft);
  border-color: var(--gw-danger);
}

button:disabled,
.btn:disabled,
a.button.disabled,
a.disabled {
  opacity: 0.45;
  pointer-events: none;
}

button[aria-busy="true"] {
  opacity: 0.7;
  cursor: wait;
}

label {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-2);
  font-size: 13px;
  font-weight: 500;
  color: var(--gw-fg);
}

label span {
  color: var(--gw-fg-muted);
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 0 var(--gw-space-3);
  border: 1px solid var(--gw-input-border);
  border-radius: var(--gw-radius-sm);
  background: var(--gw-input-bg);
  color: var(--gw-fg);
  font-family: inherit;
  font-size: 14px;
}

input::placeholder,
textarea::placeholder {
  color: var(--gw-fg-subtle);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

legend {
  padding: 0;
  margin-block-end: var(--gw-space-3);
  font-size: 13px;
  font-weight: 600;
  color: var(--gw-fg);
}

.form-row,
.create-key-form,
.inline-form,
.search-form,
.compact-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gw-space-2);
  align-items: flex-end;
}

.create-key-form label,
.search-form label {
  flex: 1 1 220px;
}

.create-key-form input,
.search-form input,
.inline-form input,
.compact-form input {
  min-width: 160px;
}

.inline-form {
  align-items: center;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--gw-sidebar-w) minmax(0, 1fr);
  min-block-size: 100dvh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-4);
  padding: var(--gw-space-4);
  border-inline-end: 1px solid var(--gw-border);
  background: var(--gw-bg-sidebar);
  position: sticky;
  top: 0;
  block-size: 100dvh;
  overflow: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: var(--gw-space-2);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--gw-fg);
  text-decoration: none;
  border-radius: var(--gw-radius-sm);
}

.brand-logo {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 7px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--gw-radius-sm);
  color: var(--gw-fg-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 20px;
  text-decoration: none;
  border: 0;
}

.nav-item .icon {
  width: 16px;
  height: 16px;
  color: currentColor;
  stroke-width: 1.5;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--gw-bg-muted);
  color: var(--gw-fg);
  text-decoration: none;
}

.nav-item.active {
  background: var(--gw-bg-muted);
  color: var(--gw-fg);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-3);
  margin-block-start: auto;
  padding-block-start: var(--gw-space-3);
  border-block-start: 1px solid var(--gw-border);
}

.sidebar-account {
  position: relative;
}

.sidebar-account-bar {
  display: flex;
  align-items: center;
  gap: var(--gw-space-2);
  min-height: 40px;
  padding: var(--gw-space-1);
  border-radius: var(--gw-radius-sm);
}

.sidebar-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gw-bg-muted);
  border: 1px solid var(--gw-border-strong);
  color: var(--gw-fg);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
}

.sidebar-account-label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--gw-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-more {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  color: var(--gw-fg-muted);
}

.sidebar-account-more:hover,
.sidebar-account-more[aria-expanded="true"] {
  background: var(--gw-bg-muted);
  color: var(--gw-fg);
}

.account-menu-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--gw-space-2);
  border: 1px solid var(--gw-border-strong);
  border-radius: var(--gw-radius-md);
  background: var(--gw-bg-elevated);
  box-shadow: none;
}

.account-menu-panel[hidden] {
  display: none;
}

.account-menu-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--gw-space-2) var(--gw-space-3);
}

.account-menu-header strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--gw-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-header span {
  font-size: 12px;
  color: var(--gw-fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-divider {
  height: 1px;
  margin: var(--gw-space-1) 0;
  background: var(--gw-border);
}

.account-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gw-space-3);
  width: 100%;
  min-height: 36px;
  padding: 0 var(--gw-space-3);
  border: 0;
  border-radius: var(--gw-radius-sm);
  background: transparent;
  color: var(--gw-fg);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.account-menu-item:hover {
  background: var(--gw-bg-muted);
  color: var(--gw-fg);
  transform: none;
}

.account-menu-item .icon {
  width: 16px;
  height: 16px;
  color: var(--gw-fg-muted);
}

.account-menu-theme {
  cursor: default;
}

.account-menu-logout {
  margin: 0;
}

.account-menu-logout .account-menu-item {
  color: var(--gw-fg);
}

.sidebar-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--gw-space-2);
  min-width: 0;
  border-radius: var(--gw-radius-sm);
}

.sidebar-user strong {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user span {
  font-size: 12px;
  color: var(--gw-fg-muted);
}

.theme-switch {
  position: relative;
  width: 44px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--gw-border-strong);
  border-radius: 999px;
  background: var(--gw-bg-muted);
  cursor: pointer;
  flex-shrink: 0;
  min-height: 24px;
  box-shadow: none;
}

.theme-switch:hover {
  background: var(--gw-bg-muted);
  border-color: var(--gw-border-strong);
}

.theme-switch:active {
  transform: none;
}

.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0a0a0a;
  color: #fff;
  transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

.theme-switch-thumb .icon {
  width: 12px;
  height: 12px;
  color: #fff;
}

.theme-switch-thumb .icon-sun {
  display: none;
}

[data-theme="light"] .theme-switch {
  background: var(--gw-bg-muted);
}

[data-theme="light"] .theme-switch-thumb {
  transform: translateX(20px);
  background: #fff;
  color: #0a0a0a;
}

[data-theme="light"] .theme-switch-thumb .icon {
  color: #0a0a0a;
}

[data-theme="light"] .theme-switch-thumb .icon-moon {
  display: none;
}

[data-theme="light"] .theme-switch-thumb .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-switch-thumb .icon-sun {
  display: none;
}

.account-menu-theme .theme-switch,
.account-menu-theme .theme-switch:hover,
[data-theme="light"] .account-menu-theme .theme-switch,
[data-theme="light"] .account-menu-theme .theme-switch:hover {
  background: #d0d0d0;
  border-color: #c4c4c4;
}

[data-theme="dark"] .account-menu-theme .theme-switch,
[data-theme="dark"] .account-menu-theme .theme-switch:hover {
  background: #262626;
  border-color: #333333;
}

.theme-switch-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 var(--gw-space-2);
}

.sidebar-logout button {
  width: 100%;
  gap: var(--gw-space-2);
}

.mobile-nav-toggle {
  display: none;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--gw-bg);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gw-space-4);
  padding: var(--gw-space-6) var(--gw-space-6) var(--gw-space-4);
}

.page-header-text {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-1);
  min-width: 0;
}

.page-header-text .eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--gw-fg-muted);
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gw-space-3);
  align-items: center;
  justify-content: flex-end;
  margin-inline-start: auto;
}

.toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--gw-space-3);
}

.toolbar > .search-field {
  order: 2;
}

.toolbar > button,
.toolbar > .btn,
.toolbar > form:not(.search-field) {
  order: 1;
  flex-shrink: 0;
}

.page-body {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-4);
  padding: 0 var(--gw-space-6) var(--gw-space-8);
  width: 100%;
  max-width: none;
}

.panel {
  border: 1px solid var(--gw-card-border);
  border-radius: var(--gw-radius-md);
  background: var(--gw-card);
  padding: var(--gw-space-5);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gw-space-4);
  margin-block-end: var(--gw-space-4);
}

.panel-header p {
  margin-block-start: var(--gw-space-1);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-3);
}

.stack-sm {
  gap: var(--gw-space-2);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gw-space-2);
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--gw-border);
  background: var(--gw-bg-muted);
  color: var(--gw-fg-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge.success {
  background: var(--gw-success-soft);
  border-color: transparent;
  color: var(--gw-success);
}

.badge.danger {
  background: var(--gw-danger-soft);
  border-color: transparent;
  color: var(--gw-danger);
}

.badge.accent {
  background: var(--gw-accent);
  border-color: transparent;
  color: var(--gw-on-accent);
}

.badge.warning {
  background: var(--gw-warning-soft);
  border-color: transparent;
  color: var(--gw-warning);
}

.notice {
  margin: 0;
  padding: var(--gw-space-3) var(--gw-space-4);
  border: 1px solid var(--gw-border);
  border-radius: var(--gw-radius-sm);
  background: var(--gw-bg-muted);
  color: var(--gw-fg);
  font-size: 13px;
}

.notice.error {
  background: var(--gw-danger-soft);
  border-color: transparent;
  color: var(--gw-danger);
}

.notice.success {
  background: var(--gw-success-soft);
  border-color: transparent;
  color: var(--gw-success);
}

.empty-state,
.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gw-space-2);
  padding: var(--gw-space-8) var(--gw-space-5);
  border: 1px dashed var(--gw-border-strong);
  border-radius: var(--gw-radius-md);
  background: transparent;
  color: var(--gw-fg-muted);
  text-align: left;
}

.empty-state strong,
.empty strong {
  color: var(--gw-fg);
  font-weight: 600;
}

.keys:not(tbody),
.users:not(tbody) {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-3);
}

.key-card,
.user,
.jwt-key {
  border: 1px solid var(--gw-card-border);
  border-radius: var(--gw-radius-md);
  background: var(--gw-card);
  padding: var(--gw-space-4);
}

.key-card.revoked,
.key-card.disabled,
.jwt-key.disabled {
  opacity: 0.72;
}

.key-summary,
.key-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gw-space-2) var(--gw-space-3);
  margin-block-end: var(--gw-space-3);
}

.key-summary .key-prefix,
.key-meta strong {
  font-family: var(--gw-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--gw-fg);
}

.key-summary small,
.key-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gw-space-2) var(--gw-space-3);
  color: var(--gw-fg-muted);
  font-size: 12px;
}

.new-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gw-space-3);
  margin-block-end: var(--gw-space-3);
  padding: var(--gw-space-3);
  border: 1px solid var(--gw-accent);
  border-radius: var(--gw-radius-sm);
  background: var(--gw-accent-soft);
}

.new-key code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 500;
}

.key-actions {
  margin-block-start: var(--gw-space-2);
}

.user-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--gw-space-4);
  margin-block-end: var(--gw-space-4);
}

.user-identity {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-1);
  min-width: 0;
}

.user-identity h2 {
  font-size: 15px;
}

.user-identity code {
  color: var(--gw-fg-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gw-space-2);
  align-items: flex-start;
}

.user-key-toolbar {
  margin-block-end: var(--gw-space-3);
  padding-block-end: var(--gw-space-3);
  border-block-end: 1px solid var(--gw-border);
}

.key-drawer {
  border: 1px solid var(--gw-border);
  border-radius: var(--gw-radius-sm);
  background: var(--gw-bg-elevated);
}

.key-drawer > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gw-space-2) var(--gw-space-3);
  padding: var(--gw-space-3) var(--gw-space-4);
  cursor: pointer;
  list-style: none;
  font-weight: 500;
}

.key-drawer > summary::-webkit-details-marker {
  display: none;
}

.key-drawer[open] > summary {
  border-block-end: 1px solid var(--gw-border);
}

.key-drawer .keys {
  padding: var(--gw-space-3);
}

.keys-compact .key-card {
  background: var(--gw-bg);
}

.jwk-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--gw-space-2) var(--gw-space-4);
  margin: 0;
  padding: var(--gw-space-3);
  border: 1px solid var(--gw-border);
  border-radius: var(--gw-radius-sm);
  background: var(--gw-input-bg);
}

.jwk-details dt {
  color: var(--gw-fg-muted);
  font-size: 12px;
  font-weight: 500;
  padding-block: 2px;
}

.jwk-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.jwk-details code {
  font-size: 12px;
  font-family: var(--gw-mono);
}

.jwk-details .jwk-modulus {
  display: block;
  max-height: 12rem;
  overflow: auto;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
}

.jwk-trigger {
  gap: var(--gw-space-2);
  color: var(--gw-fg);
  border-color: var(--gw-border-strong);
}

.jwk-trigger .icon {
  color: var(--gw-accent);
}

.jwk-trigger:hover {
  border-color: var(--gw-accent);
  color: var(--gw-fg);
}

.jwk-trigger:active {
  transform: scale(0.97);
}

.jwk-modal {
  width: min(100vw - 2rem, 640px);
}

.jwk-modal-kid {
  margin: var(--gw-space-1) 0 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.cell-jwk {
  white-space: nowrap;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: min(100%, 240px);
}

.search-field .icon {
  position: absolute;
  right: 12px;
  color: var(--gw-fg-muted);
  pointer-events: none;
}

.search-field input {
  padding-inline-end: 40px;
}

.list-tools {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-3);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gw-space-3);
  padding: var(--gw-space-4) 0 0;
  color: var(--gw-fg-muted);
  font-size: 13px;
}

.pager-summary {
  font-variant-numeric: tabular-nums;
}

.pager .pager-links {
  display: flex;
  gap: 2px;
  align-items: center;
}

.pager-nav,
.pager-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--gw-radius-sm);
  background: transparent;
  color: var(--gw-fg);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  cursor: pointer;
}

.pager-nav:hover,
.pager-page:hover {
  background: var(--gw-bg-muted);
}

.pager-page.is-current {
  background: var(--gw-accent);
  color: var(--gw-on-accent);
  font-weight: 600;
}

.pager-page.is-current:hover {
  background: var(--gw-accent);
}

.pager-nav.disabled,
.pager-nav[aria-disabled="true"] {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

.pager-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 32px;
  color: var(--gw-fg-muted);
}

.pager-limit {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.pager-limit select {
  appearance: none;
  min-width: 56px;
  height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--gw-border);
  border-radius: var(--gw-radius-sm);
  background: var(--gw-input-bg);
  color: var(--gw-fg);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.pager-limit .icon {
  position: absolute;
  right: 8px;
  width: 14px;
  height: 14px;
  color: var(--gw-fg-muted);
  pointer-events: none;
}

.table-shell {
  position: relative;
  width: 100%;
  overflow-x: auto;
}

.table-shell.is-empty {
  overflow: visible;
}

.table-shell.is-empty > .data-table {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.table-empty-slot {
  width: 100%;
}

.table-shell:not(.is-empty) > .table-empty-slot {
  display: none;
}

.data-table .empty-row td {
  padding: 0;
  border-block-end: 0;
}

.table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gw-space-6);
  width: 100%;
  min-height: 320px;
  padding: var(--gw-space-8) var(--gw-space-6);
  text-align: center;
}

.drawer-section .table-empty {
  min-height: 180px;
  padding: var(--gw-space-6) var(--gw-space-4);
}

.table-empty-icon {
  width: 120px;
  height: 120px;
  color: var(--gw-fg-subtle);
  opacity: 0.85;
}

.drawer-section .table-empty-icon {
  width: 72px;
  height: 72px;
}

.table-empty p {
  margin: 0;
  max-width: 420px;
  color: var(--gw-fg-muted);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: auto;
}

.data-table th {
  padding: var(--gw-space-2) var(--gw-space-3);
  border-block-end: 1px solid var(--gw-border);
  color: var(--gw-fg-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.data-table td {
  padding: var(--gw-space-2) var(--gw-space-3);
  border-block-end: 1px solid var(--gw-border);
  vertical-align: middle;
  font-size: 13px;
}

.data-table tbody tr:hover td {
  background: rgba(127, 127, 127, 0.04);
}

.data-table .cell-mono {
  font-family: var(--gw-mono);
  font-size: 12px;
  color: var(--gw-fg-muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table .cell-actions {
  width: 48px;
  text-align: right;
}

.data-table .status-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gw-space-2);
}

/* Row action menu */
.action-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.action-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  padding: var(--gw-space-2);
  border: 1px solid var(--gw-border);
  border-radius: var(--gw-radius-md);
  background-color: var(--gw-card);
}

.action-menu-panel.is-ported {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  z-index: 80;
}

.action-menu-panel[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.action-menu-panel [id^="user-ops-"] {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}

.action-menu-panel form.inline-form {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  min-height: 0;
  background: transparent;
}

.action-menu-panel .menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--gw-space-2);
  width: 100%;
  min-height: 36px;
  padding: 0 var(--gw-space-3);
  border: 0;
  border-radius: var(--gw-radius-sm);
  background: transparent;
  color: var(--gw-fg);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}

.action-menu-panel .menu-item .icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--gw-fg-muted);
  pointer-events: none;
}

.action-menu-panel .menu-item:hover,
.action-menu-panel .menu-item:focus-visible {
  background: var(--gw-bg-muted);
  color: var(--gw-fg);
  box-shadow: none;
  transform: none;
}

.action-menu-panel .menu-item:active {
  background: var(--gw-bg-muted);
  transform: none;
}

.action-menu-panel .menu-item.danger-item {
  color: var(--gw-danger);
}

.action-menu-panel .menu-item.danger-item:hover,
.action-menu-panel .menu-item.danger-item:focus-visible {
  background: var(--gw-danger-soft);
  color: var(--gw-danger);
}

.data-table .key-reveal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gw-space-2);
  margin-block-start: var(--gw-space-2);
  padding: var(--gw-space-2) var(--gw-space-3);
  border: 1px solid var(--gw-accent);
  border-radius: var(--gw-radius-sm);
  background: var(--gw-accent-soft);
}

.data-table .inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gw-space-2);
  align-items: center;
}

.data-table .inline-actions input {
  min-width: 120px;
  width: auto;
}

.help-line {
  color: var(--gw-fg-muted);
  font-size: 13px;
  margin-block-end: var(--gw-space-2);
}

.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

.icon-lg {
  width: 18px;
  height: 18px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--gw-radius-sm);
  background: transparent;
  color: var(--gw-fg-muted);
  box-shadow: none;
}

.icon-btn:hover {
  background: var(--gw-bg-muted);
  color: var(--gw-fg);
}

.icon-btn.copy-link {
  color: var(--gw-info);
}

.icon-btn.copy-link.is-copied {
  color: var(--gw-success);
}

.icon-btn.copy-link.is-copied:hover {
  color: var(--gw-success);
}

.cell-with-copy {
  display: inline-flex;
  align-items: center;
  gap: var(--gw-space-2);
  max-width: 100%;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(100vw, 560px);
  height: 100%;
  background: var(--gw-card);
  border-inline-start: 1px solid var(--gw-border);
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1), visibility 220ms;
  overflow: auto;
}

.drawer-panel.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gw-space-3);
  padding: var(--gw-space-5);
  border-block-end: 1px solid var(--gw-border);
}

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-5);
  padding: var(--gw-space-5);
  flex: 1;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-3);
}

.drawer-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gw-fg-muted);
}

.drawer-meta {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-1);
}

.drawer-meta code {
  font-size: 12px;
  color: var(--gw-fg-muted);
  overflow-wrap: anywhere;
}

.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-2);
}

.drawer-actions .inline-form,
.drawer-actions form {
  width: 100%;
}

.drawer-actions button {
  width: 100%;
}

.nested-keys {
  width: 100%;
}

.nested-keys .data-table th,
.nested-keys .data-table td {
  padding: 6px var(--gw-space-2);
  font-size: 12px;
}

#user-drawers {
  /* Keep a real box; display:contents caused hit-testing issues in some browsers. */
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--gw-modal-backdrop);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.drawer-backdrop[hidden] {
  display: none !important;
  pointer-events: none !important;
}

body.drawer-open {
  overflow: hidden;
}

.login-page {
  position: relative;
  display: grid;
  place-items: center;
  min-block-size: 100dvh;
  padding: clamp(72px, 8vh, 96px) clamp(16px, 4vw, 64px) clamp(24px, 5vh, 64px);
  overflow: hidden;
  background: var(--gw-login-canvas);
}

.login-page::before,
.login-page::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--gw-login-frame-border);
  transform: rotate(-14deg);
}

.login-page::before {
  inset: 8% auto auto -6%;
  width: 30vw;
  max-width: 360px;
  aspect-ratio: 1;
  border-radius: 28%;
}

.login-page::after {
  inset: auto -8% 7% auto;
  width: 24vw;
  max-width: 280px;
  aspect-ratio: 1;
  border-radius: 34%;
  opacity: 0.7;
}

.login-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  width: min(100%, 1080px);
  min-block-size: min(680px, calc(100dvh - 128px));
  overflow: hidden;
  border: 1px solid var(--gw-login-frame-border);
  border-radius: var(--gw-radius-lg);
  background: var(--gw-login-frame);
}

.login-content {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-6);
  min-inline-size: 0;
  padding: clamp(28px, 5vw, 64px);
}

.login-brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--gw-space-3);
  color: var(--gw-fg);
  text-decoration: none;
}

.login-brand:hover {
  color: var(--gw-fg);
  text-decoration: none;
}

.login-brand .brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.login-wordmark {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-copy {
  max-inline-size: 390px;
  margin-block: auto;
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-4);
}

.login-eyebrow,
.login-visual-eyebrow,
.login-visual-label {
  margin: 0;
  font-family: var(--gw-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.3;
}

.login-eyebrow {
  color: var(--gw-accent);
}

.login-card h1 {
  max-inline-size: 9ch;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.login-description {
  max-inline-size: 36ch;
  color: var(--gw-fg-muted);
  font-size: 15px;
  line-height: 1.6;
  text-wrap: pretty;
}

.login-notice {
  max-inline-size: 390px;
}

.login-action {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-3);
  max-inline-size: 390px;
}

.login-card .login-cta {
  width: 100%;
  min-height: 48px;
  justify-content: space-between;
  padding-inline: var(--gw-space-5);
  border-radius: var(--gw-radius-md);
  font-size: 14px;
}

.login-card .login-cta .icon {
  margin-inline-start: auto;
}

.login-helper,
.login-footer {
  color: var(--gw-fg-muted);
  font-size: 12px;
  line-height: 1.5;
}

.login-helper {
  text-align: center;
}

.login-footer {
  margin-block-start: auto;
  color: var(--gw-fg-subtle);
  font-family: var(--gw-mono);
  font-size: 10px;
}

.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  min-block-size: 100%;
  overflow: hidden;
  padding: clamp(24px, 4vw, 40px);
  isolation: isolate;
  border-inline-start: 1px solid var(--gw-login-visual-border);
  background: var(--gw-login-visual);
  color: var(--gw-login-visual-text);
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 20px;
  z-index: -1;
  border: 1px solid var(--gw-login-visual-border);
  border-radius: var(--gw-radius-lg);
}

.login-visual-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gw-space-4);
}

.login-visual-label {
  color: var(--gw-login-visual-muted);
}

.login-visual-status {
  display: inline-flex;
  align-items: center;
  gap: var(--gw-space-2);
  min-height: 28px;
  padding: 0 var(--gw-space-3);
  border: 1px solid var(--gw-login-visual-border);
  border-radius: 999px;
  color: var(--gw-login-visual-muted);
  font-size: 11px;
  white-space: nowrap;
}

.login-visual-status span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gw-accent);
  outline: 3px solid var(--gw-login-visual-chip);
}

.login-network {
  position: absolute;
  inset: 18% 5% auto;
  z-index: -1;
  width: 90%;
  height: 52%;
  color: var(--gw-login-visual-line);
  overflow: visible;
}

.login-network-lines {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.25;
}

.login-network-nodes circle {
  fill: var(--gw-login-visual);
  stroke: currentColor;
  stroke-width: 1.5;
}

.login-network-nodes circle.is-active {
  fill: var(--gw-accent);
  stroke: var(--gw-accent);
}

.login-visual-mark {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 1px solid var(--gw-login-visual-border);
  border-radius: 50%;
  background: var(--gw-login-visual);
  transform: translate(-50%, -50%);
}

.login-visual-mark::before,
.login-visual-mark::after {
  content: "";
  position: absolute;
  inset: -13px;
  border: 1px solid var(--gw-login-visual-border);
  border-radius: 50%;
}

.login-visual-mark::after {
  inset: -26px;
  opacity: 0.55;
}

.login-visual-mark .brand-logo {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  border-radius: 16px;
}

.login-visual-copy {
  position: relative;
  z-index: 2;
  max-inline-size: 370px;
  margin-block-start: auto;
}

.login-visual-eyebrow {
  margin-block-end: var(--gw-space-3);
  color: var(--gw-accent);
}

.login-visual-copy h2 {
  max-inline-size: 14ch;
  margin-block-end: var(--gw-space-3);
  color: var(--gw-login-visual-text);
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.login-visual-copy p:last-child {
  max-inline-size: 32ch;
  color: var(--gw-login-visual-muted);
  font-size: 13px;
  line-height: 1.55;
}

.login-theme {
  position: fixed;
  top: var(--gw-space-4);
  right: var(--gw-space-4);
  z-index: 2;
  width: auto;
  min-width: 0;
  padding: var(--gw-space-2) var(--gw-space-3);
  border: 1px solid var(--gw-border);
  border-radius: var(--gw-radius-md);
  background: var(--gw-card);
}

@media (max-width: 840px) {
  .login-page {
    place-items: start center;
    padding-block-start: 72px;
  }

  .login-card {
    grid-template-columns: 1fr;
    width: min(100%, 640px);
    min-block-size: 0;
  }

  .login-content {
    min-block-size: 560px;
    padding: clamp(24px, 6vw, 40px);
  }

  .login-copy {
    margin-block: 48px 24px;
  }

  .login-visual {
    min-block-size: 300px;
    border-inline-start: 0;
    border-block-start: 1px solid var(--gw-login-visual-border);
  }

  .login-network {
    inset-block-start: 8%;
    height: 62%;
  }

  .login-visual-mark {
    width: 88px;
    height: 88px;
  }

  .login-visual-mark .brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 13px;
  }

  .login-visual-copy h2 {
    font-size: 25px;
  }
}

@media (max-width: 480px) {
  .login-page {
    padding-inline: var(--gw-space-3);
  }

  .login-card {
    border-radius: var(--gw-radius-md);
  }

  .login-content {
    min-block-size: 520px;
  }

  .login-card h1 {
    font-size: 34px;
  }

  .login-visual {
    min-block-size: 270px;
    padding: var(--gw-space-5);
  }

  .login-visual::before {
    inset: 12px;
  }

  .login-visual-status {
    padding-inline: var(--gw-space-2);
    font-size: 10px;
  }

  .login-visual-copy h2 {
    font-size: 22px;
  }
}

@media (max-width: 767px) {
  .login-visual {
    display: none;
  }
}

.error-page {
  display: grid;
  place-items: center;
  min-block-size: 100dvh;
  padding: var(--gw-space-6);
}

.error-card {
  width: min(100%, 480px);
}

.modal {
  width: min(100vw - 2rem, 520px);
  padding: 0;
  border: 1px solid var(--gw-card-border);
  border-radius: var(--gw-radius-lg);
  background: var(--gw-card);
  color: var(--gw-fg);
  box-shadow: none;
}

dialog.modal:not([open]) {
  display: none !important;
  pointer-events: none !important;
}

.modal::backdrop {
  background: var(--gw-modal-backdrop);
}

.confirm-dialog {
  width: min(100vw - 2rem, 420px);
}

.confirm-dialog-body {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-4);
  padding: var(--gw-space-5);
}

.confirm-dialog-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--gw-radius-md);
  background: var(--gw-bg-muted);
  color: var(--gw-fg-muted);
}

.confirm-dialog.is-danger .confirm-dialog-icon {
  background: var(--gw-danger-soft);
  color: var(--gw-danger);
}

.confirm-dialog-copy h2 {
  margin: 0 0 var(--gw-space-2);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.confirm-dialog-copy p {
  margin: 0;
  color: var(--gw-fg-muted);
  font-size: 14px;
  line-height: 1.5;
  text-wrap: pretty;
}

.wizard-form {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-4);
  padding: var(--gw-space-5);
}

.create-user-modal {
  width: min(calc(100vw - 2rem), 680px);
  max-block-size: none;
  overflow: visible;
}

.create-user-modal .wizard-form {
  max-block-size: none;
  overflow: visible;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--gw-space-3);
}

.modal-close {
  min-width: 36px;
  padding-inline: 0;
  font-size: 18px;
  line-height: 1;
}

.wizard-heading {
  min-width: 0;
}

.wizard-kicker {
  margin: 0 0 var(--gw-space-1);
  color: var(--gw-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.wizard-description,
.wizard-section-heading p {
  margin-block-start: var(--gw-space-2);
  color: var(--gw-fg-muted);
  font-size: 13px;
  line-height: 1.45;
  text-wrap: pretty;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gw-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.wizard-steps li {
  display: flex;
  align-items: center;
  gap: var(--gw-space-2);
  min-width: 0;
  min-block-size: 52px;
  padding: var(--gw-space-2) var(--gw-space-3);
  border: 1px solid var(--gw-border);
  border-radius: var(--gw-radius-md);
  color: var(--gw-fg-muted);
}

.wizard-steps li.active {
  border-color: var(--gw-accent);
  color: var(--gw-fg);
  background: var(--gw-accent-soft);
}

.wizard-steps li.complete {
  color: var(--gw-success);
}

.wizard-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  inline-size: 24px;
  block-size: 24px;
  border: 1px solid var(--gw-border-strong);
  border-radius: 50%;
  color: var(--gw-fg-muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.wizard-steps li.active .wizard-step-number {
  border-color: var(--gw-accent);
  background: var(--gw-accent);
  color: var(--gw-on-accent);
}

.wizard-steps li.complete .wizard-step-number {
  border-color: var(--gw-success);
  color: var(--gw-success);
}

.wizard-step-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.wizard-step-label {
  color: var(--gw-fg);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.wizard-step-hint {
  overflow: hidden;
  color: var(--gw-fg-muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-4);
}

.wizard-step[hidden] {
  display: none !important;
}

.wizard-section {
  padding: var(--gw-space-4);
  border: 1px solid var(--gw-border);
  border-radius: var(--gw-radius-md);
  background: var(--gw-bg-muted);
}

.wizard-section-heading h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.wizard-section-heading p {
  margin-block-start: var(--gw-space-1);
}

.wizard-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gw-space-4);
  margin-block-start: var(--gw-space-4);
}

.wizard-field-wide {
  grid-column: 1 / -1;
}

.wizard-field .field-label {
  color: var(--gw-fg);
  font-weight: 500;
}

.wizard-field .field-required {
  color: var(--gw-danger);
}

.wizard-field .field-optional {
  margin-inline-start: var(--gw-space-1);
  color: var(--gw-fg-subtle);
  font-size: 11px;
  font-weight: 400;
}

.wizard-field input {
  min-block-size: 44px;
}

.wizard-field input[aria-invalid="true"] {
  border-color: var(--gw-danger);
}

.wizard-field input[aria-invalid="true"]:focus-visible {
  border-color: var(--gw-danger);
}

.wizard-field .field-error {
  color: var(--gw-danger);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--gw-space-2);
  padding-block-start: var(--gw-space-2);
  border-block-start: 1px solid var(--gw-border);
}

.create-user-modal .wizard-actions {
  justify-content: space-between;
}

.wizard-action-end {
  display: flex;
  justify-content: flex-end;
  gap: var(--gw-space-2);
  margin-inline-start: auto;
}

.create-user-modal .wizard-actions button {
  min-block-size: 44px;
}

.create-user-modal [data-wizard-primary][aria-busy="true"] {
  cursor: wait;
  opacity: 0.78;
  pointer-events: none;
}

.create-user-modal [data-wizard-primary][aria-busy="true"]::before {
  inline-size: 14px;
  block-size: 14px;
  border: 2px solid currentColor;
  border-block-start-color: transparent;
  border-radius: 50%;
  content: "";
  animation: wizard-spinner 700ms linear infinite;
}

.create-user-modal [data-wizard-primary][aria-busy="true"] .icon {
  display: none;
}

@keyframes wizard-spinner {
  to {
    transform: rotate(360deg);
  }
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gw-space-3);
}

.review-card {
  min-width: 0;
  padding: var(--gw-space-4);
  border: 1px solid var(--gw-border);
  border-radius: var(--gw-radius-md);
  background: var(--gw-bg-muted);
}

.review-card h4 {
  margin: 0 0 var(--gw-space-3);
  color: var(--gw-fg-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

.create-user-modal .review-list > div {
  display: grid;
  grid-template-columns: minmax(0, 96px) minmax(0, 1fr);
  gap: var(--gw-space-2);
  padding-block: var(--gw-space-2);
  border-block-end: 1px solid var(--gw-border);
}

.create-user-modal .review-list > div:first-child {
  padding-block-start: 0;
}

.create-user-modal .review-list > div:last-child {
  padding-block-end: 0;
  border-block-end: 0;
}

.review-list dt {
  color: var(--gw-fg-muted);
  font-size: 12px;
  font-weight: 500;
}

.review-list dd {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.review-secret {
  color: var(--gw-success);
  font-weight: 500;
}

.create-user-modal > .toast-region {
  position: fixed;
  inset-block-start: max(var(--gw-space-4), env(safe-area-inset-top));
  inset-inline-start: 50%;
  z-index: 2;
  width: min(calc(100vw - 2rem), 520px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--gw-space-3);
  padding: var(--gw-space-3) var(--gw-space-4);
  border: 1px solid var(--gw-border-strong);
  border-radius: var(--gw-radius-md);
  background: var(--gw-card);
  color: var(--gw-fg);
  pointer-events: auto;
}

.toast.error {
  border-color: var(--gw-danger);
  background: var(--gw-danger-soft);
}

.toast-icon {
  display: inline-flex;
  flex: 0 0 auto;
  margin-block-start: 1px;
  color: var(--gw-danger);
}

.toast-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
  font-size: 13px;
  line-height: 1.4;
}

.toast-copy strong {
  color: var(--gw-danger);
  font-weight: 600;
}

.toast-close {
  flex: 0 0 auto;
  min-width: 36px;
  min-height: 36px;
  margin: -6px -8px -6px 0;
  padding-inline: 0;
  background: transparent;
  color: var(--gw-fg-muted);
}

.toast-close:hover {
  background: var(--gw-bg-muted);
  color: var(--gw-fg);
}

@media (max-width: 640px) {
  .create-user-modal {
    width: min(calc(100vw - 1rem), 680px);
    max-block-size: none;
  }

  .create-user-modal .wizard-form {
    max-block-size: none;
    overflow: visible;
    padding: var(--gw-space-4);
  }

  .wizard-fields,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .wizard-step-hint {
    display: none;
  }
}

@media (max-height: 760px) {
  .create-user-modal .wizard-form {
    gap: var(--gw-space-3);
    padding-block: var(--gw-space-4);
  }

  .create-user-modal .wizard-step {
    gap: var(--gw-space-3);
  }

  .create-user-modal .wizard-section {
    padding: var(--gw-space-3);
  }

  .create-user-modal .wizard-fields {
    gap: var(--gw-space-3);
    margin-block-start: var(--gw-space-3);
  }
}

@media (max-width: 480px) {
  .create-user-modal .wizard-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .create-user-modal .wizard-action-end,
  .create-user-modal .wizard-actions button {
    width: 100%;
  }

  .create-user-modal .wizard-action-end {
    margin-inline-start: 0;
  }
}

.key-reveal-modal {
  width: min(100vw - 2rem, 560px);
}

.key-reveal-block {
  display: flex;
  flex-direction: column;
  gap: var(--gw-space-2);
}

.key-reveal-label {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--gw-fg-muted);
}

.key-reveal-modal .key-reveal {
  display: flex;
  align-items: flex-start;
  gap: var(--gw-space-2);
  margin: 0;
  padding: var(--gw-space-3);
  border: 1px solid var(--gw-accent);
  border-radius: var(--gw-radius-sm);
  background: var(--gw-accent-soft);
}

.key-reveal-modal .key-reveal code {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.key-reveal-modal [data-close-after-copy]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, var(--gw-sidebar-w));
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: none;
  }

  .app-shell.nav-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--gw-modal-backdrop);
    z-index: 30;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .page-header,
  .page-body {
    padding-inline: var(--gw-space-4);
  }

  .page-header {
    padding-block-start: var(--gw-space-4);
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-actions {
    justify-content: stretch;
    margin-inline-start: 0;
  }

  .page-header-actions .search-field {
    flex: 1;
  }

  .pager {
    flex-direction: column;
    align-items: stretch;
  }

  .pager .pager-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .pager-limit {
    align-self: flex-end;
  }

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

  .review-list > div {
    grid-template-columns: 1fr;
    gap: var(--gw-space-1);
  }

  .drawer-panel {
    width: min(100vw, 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

