/* Shared application components: loading indicator, mail-address editor and toggle switch. */
.page-title-with-loader {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.loading-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  vertical-align: middle;
}
.loading-indicator-sm { width: 22px; height: 22px; }
.loading-indicator-md { width: 30px; height: 30px; }
.loading-envelope {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 13px;
  border: 2px solid var(--loading-line);
  border-radius: 3px;
  background: var(--loading-envelope-bg);
  animation: loading-envelope-float .74s ease-in-out infinite alternate;
}
.loading-envelope::before,
.loading-envelope::after {
  content: "";
  position: absolute;
  top: 1px;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--loading-line);
}
.loading-envelope::before {
  left: 1px;
  transform: rotate(36deg);
  transform-origin: top left;
}
.loading-envelope::after {
  right: 1px;
  transform: rotate(-36deg);
  transform-origin: top right;
}
@keyframes loading-envelope-float {
  from { transform: translateY(0) rotate(-3deg); opacity: .62; }
  to { transform: translateY(-2px) rotate(3deg); opacity: 1; }
}

.email-address-input {
  display: grid;
  gap: 10px;
}
.email-chip-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}
.email-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: linear-gradient(var(--control-gradient-start), var(--control-gradient-end));
  box-shadow: var(--shadow-control-strong);
  padding: 5px 8px 5px 11px;
  color: var(--text-strong);
  font-size: 13px;
  line-height: 1.2;
}
.email-chip.invalid {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger-text-deep);
}
.email-chip-main {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.email-chip-address {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}
.email-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: var(--hover-tint);
  color: var(--control-text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.email-chip-remove:hover { background: var(--hover-tint-strong); }
.email-chip-empty {
  color: var(--muted);
  font-size: 13px;
}
.email-address-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.recipient-field-input,
.recipient-attachments-input {
  min-width: 150px;
  font-size: 12px;
}
.recipient-attachments-input {
  min-width: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.card-title-node,
.card-heading-with-loader {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-strong);
  font-weight: 800;
}
.card-heading-with-loader {
  font-size: 18px;
}

.policy-source-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 8px 10px;
  border: var(--border-line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.policy-source-path-label {
  font-weight: 800;
  text-transform: uppercase;
}
.policy-source-path ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.policy-source-path li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-strong);
  font-weight: 700;
}
.policy-source-path li small {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.policy-source-path li small::before {
  content: "(";
}
.policy-source-path li small::after {
  content: ")";
}
.policy-source-path li + li::before {
  content: ">";
  color: var(--muted);
  font-weight: 700;
}

.password-field {
  position: relative;
  width: 100%;
}
.password-field.has-toggle input {
  padding-right: 42px;
}
.password-field.is-saved-empty input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.password-field-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transform: translateY(-50%);
}
.password-field-toggle:hover {
  background: var(--hover-tint-soft);
  color: var(--text-strong);
}
.password-field-toggle:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 1px;
}

.credential-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.credential-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.credential-panel-heading {
  grid-column: 1 / -1;
  margin: 2px 0 -4px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 800;
}

.credential-panel-extra {
  display: grid;
  gap: 10px;
}

.color-picker-field,
.date-field,
.time-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.color-picker-field input {
  width: 100%;
  padding-left: 36px;
  padding-right: 38px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.date-field input,
.time-field input {
  width: 100%;
  padding-right: 38px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.color-picker-preview {
  position: absolute;
  left: 10px;
  z-index: 1;
  width: 18px;
  height: 18px;
  border: var(--border-line-dark);
  border-radius: 4px;
  box-shadow: var(--shadow-inset-highlight);
}

.color-picker-trigger,
.date-field-trigger {
  position: absolute;
  right: 5px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.color-picker-trigger:hover:not(:disabled),
.color-picker-trigger:focus-visible,
.date-field-trigger:hover:not(:disabled),
.date-field-trigger:focus-visible {
  background: var(--hover-tint);
  color: var(--text-strong);
}

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

.color-picker-popover,
.date-field-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  width: max-content;
  min-width: 220px;
  padding: 10px;
  border: var(--border-line-dark);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-menu);
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 28px);
  gap: 8px;
}

.color-picker-grid button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--black-border-soft);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-inset-highlight);
}

.color-picker-grid button.is-selected {
  outline: 2px solid var(--text-strong);
  outline-offset: 2px;
}

.date-field-popover {
  min-width: 268px;
}

.date-field-monthbar {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.date-field-monthbar strong {
  text-align: center;
}

.date-field-monthbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: var(--border-line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.date-field-weekdays,
.date-field-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.date-field-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.date-field-grid {
  margin-top: 6px;
}

.date-field-grid button {
  min-width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.date-field-grid button:hover:not(:disabled),
.date-field-grid button:focus-visible {
  border-color: var(--line-dark);
  background: var(--surface);
}

.date-field-grid button.is-muted {
  color: var(--muted);
}

.date-field-grid button.is-selected {
  border-color: var(--success-border);
  background: var(--green);
  color: var(--on-accent);
  font-weight: 800;
}

.date-field-grid button:disabled {
  cursor: not-allowed;
  opacity: .35;
}

.date-time-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  width: 100%;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.admin-overview-link {
  border: var(--border-line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.admin-overview-link:hover {
  background: var(--surface);
  border-color: var(--line-dark);
}

.admin-overview-link strong {
  display: block;
  color: var(--text-strong);
  margin-bottom: 5px;
}

.admin-overview-link span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.module-management-list {
  display: grid;
  gap: 10px;
}

.module-management-metrics {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.module-management-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  align-items: center;
  gap: 18px;
  border: var(--border-line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.module-management-row.pending {
  border-color: color-mix(in srgb, var(--amber) 60%, var(--line));
}

.module-management-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.module-management-title,
.module-management-meta,
.module-management-details {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.module-management-title strong {
  color: var(--text-strong);
}

.module-management-title code {
  color: var(--muted);
  font-size: 12px;
}

.module-management-title span,
.module-management-meta span,
.module-management-details span {
  color: var(--muted);
  font-size: 12px;
}

.module-management-toggle {
  display: grid;
  gap: 8px;
  justify-self: end;
  width: 170px;
}

.module-management-notes {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.module-management-notes p {
  margin: 0;
}

.module-install-plan-panel {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.module-package-catalog,
.module-installer-request-panel {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.module-package-catalog-list {
  display: grid;
  gap: 10px;
}

.module-package-catalog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: var(--border-line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.module-package-catalog-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.module-installer-request-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
}

.module-installer-request-grid label {
  display: grid;
  gap: 6px;
}

.module-installer-request-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.module-installer-request-grid textarea {
  min-height: 74px;
  resize: vertical;
}

.module-install-plan-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.module-install-plan-heading h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
}

.module-install-plan-heading p,
.module-install-plan-empty {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.module-install-plan-list {
  display: grid;
  gap: 10px;
}

.module-install-preflight {
  display: grid;
  gap: 10px;
  border: var(--border-line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 12px 14px;
}

.module-install-preflight.is-blocked {
  border-color: color-mix(in srgb, var(--red) 55%, var(--line));
}

.module-install-preflight.is-allowed {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
}

.module-install-preflight-title,
.module-install-preflight-issue {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.module-install-preflight-title strong {
  color: var(--text-strong);
}

.module-install-preflight-title span,
.module-install-preflight-issue span {
  color: var(--muted);
  font-size: 13px;
}

.module-install-preflight-issues {
  display: grid;
  gap: 6px;
}

.module-install-preflight-issue {
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--panel-glass);
}

.module-install-preflight-issue strong {
  min-width: 64px;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 11px;
}

.module-install-preflight-issue.severity-blocker strong {
  color: var(--red);
}

.module-install-preflight-issue.severity-warning strong {
  color: var(--amber);
}

.module-install-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.module-install-checklist-item {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 86px;
  border: var(--border-line);
  border-radius: 6px;
  background: var(--panel-glass);
  padding: 9px 10px;
}

.module-install-checklist-item strong {
  color: var(--text-strong);
  font-size: 13px;
}

.module-install-checklist-item span {
  justify-self: start;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
  text-transform: uppercase;
}

.module-install-checklist-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.module-install-checklist-item.status-blocked {
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
}

.module-install-checklist-item.status-blocked span {
  color: var(--red);
}

.module-install-checklist-item.status-warning,
.module-install-checklist-item.status-pending {
  border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
}

.module-install-checklist-item.status-warning span,
.module-install-checklist-item.status-pending span {
  color: var(--amber);
}

.module-install-checklist-item.status-done span {
  color: var(--green);
}

.module-install-plan-row {
  display: grid;
  grid-template-columns: 130px 150px 170px minmax(260px, 1fr);
  gap: 12px;
  align-items: end;
  border: var(--border-line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.module-install-plan-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.module-install-plan-row-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.module-install-plan-row label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.module-install-plan-row .wide {
  grid-column: span 2;
}

.module-install-plan-actions {
  display: flex;
  justify-content: flex-end;
}

.module-install-plan-commands {
  margin: 0;
}

.module-installer-runs {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.module-installer-runs-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.module-installer-runs-heading h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
}

.module-installer-runs-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.module-installer-run-list {
  display: grid;
  gap: 10px;
}

.module-installer-run-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 34%);
  align-items: center;
  gap: 14px;
  border: var(--border-line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.module-installer-run-main,
.module-installer-run-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.module-installer-run-main {
  display: grid;
}

.module-installer-run-title strong {
  color: var(--text-strong);
  font-size: 13px;
}

.module-installer-run-row code {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-installer-run-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.module-installer-run-actions code {
  flex: 1 1 auto;
  text-align: right;
}

.module-installer-run-error {
  margin: 0;
  color: var(--red);
  font-size: 12px;
}

@media (max-width: 760px) {
  .module-management-row {
    grid-template-columns: 1fr;
  }

  .module-management-toggle {
    justify-self: start;
    width: 170px;
  }

  .module-install-plan-heading {
    display: grid;
  }

  .module-install-plan-row {
    grid-template-columns: 1fr;
  }

  .module-install-plan-row .wide {
    grid-column: auto;
  }

  .module-package-catalog-row,
  .module-installer-request-grid {
    grid-template-columns: 1fr;
  }

  .module-installer-runs-heading,
  .module-installer-run-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .module-installer-run-actions {
    justify-content: flex-start;
  }
}

.admin-section-page {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.admin-section-page > .loading-frame {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.admin-page-heading {
  margin-bottom: 0;
}

.admin-page-actions {
  align-self: start;
}

.icon-button.btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
}

.icon-button.btn svg {
  width: 17px;
  height: 17px;
}

.admin-form-grid {
  display: grid;
  gap: 14px;
}

.admin-form-grid > .wide {
  grid-column: 1 / -1;
}

.admin-form-grid.two-columns,
.admin-assignment-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form-grid.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-assignment-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.admin-selection-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
  padding: 8px;
  border: var(--border-line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.admin-selection-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 7px;
  cursor: pointer;
}

.admin-selection-item:hover {
  background: var(--surface);
}

.admin-selection-item.disabled {
  cursor: not-allowed;
  opacity: .65;
}

.admin-selection-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .admin-form-grid.two-columns,
  .admin-form-grid.three-columns,
  .admin-assignment-grid,
  .admin-permission-groups {
    grid-template-columns: 1fr;
  }
}

.guided-config-dialog.admin-dialog-wide {
  width: min(1120px, calc(100vw - 40px));
  height: min(760px, calc(100vh - 40px));
}

.guided-config-dialog-body {
  display: flex;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.guided-config-shell {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  flex: 1 1 auto;
  width: 100%;
  min-height: min(620px, calc(100vh - 190px));
}

.guided-config-sidebar {
  min-width: 0;
  border-right: var(--border-line);
  background: var(--panel-soft);
}

.guided-config-sidebar .stepper {
  height: 100%;
  border-right: 0;
  background: transparent;
}

.guided-config-content {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  background: var(--panel-soft);
}

.guided-config-intro {
  max-width: 760px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.guided-config-intro p,
.guided-config-step-heading p {
  margin: 0;
}

.guided-config-step-heading {
  display: grid;
  gap: 5px;
}

.guided-config-step-heading h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
}

.guided-config-step-heading p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.guided-config-step-body {
  min-width: 0;
}

.adaptive-config-dialog.admin-dialog-wide {
  width: min(1040px, calc(100vw - 40px));
}

.adaptive-config-dialog-body {
  background: var(--panel-soft);
}

.adaptive-config-form {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.adaptive-config-section {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 15px;
  border: var(--border-line);
  border-radius: 7px;
  background: var(--panel);
}

.adaptive-config-section > header {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.adaptive-config-section > header h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 15px;
}

.adaptive-config-section > header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.advanced-options-panel {
  border: var(--border-line);
  border-radius: 7px;
  background: var(--panel);
}

.advanced-options-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text-strong);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.advanced-options-panel > summary::-webkit-details-marker {
  display: none;
}

.advanced-options-panel > summary svg {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform .16s ease;
}

.advanced-options-panel[open] > summary svg {
  transform: rotate(180deg);
}

.advanced-options-summary {
  margin: -2px 12px 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.advanced-options-body {
  display: grid;
  gap: 14px;
  padding: 0 12px 12px;
}

.action-blocker-hint {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--amber) 12%, var(--panel));
}

.action-blocker-hint.tone-info {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  background: color-mix(in srgb, var(--blue) 10%, var(--panel));
}

.action-blocker-hint.tone-danger {
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
  background: color-mix(in srgb, var(--red) 10%, var(--panel));
}

.action-blocker-icon {
  margin-top: 1px;
  color: var(--amber);
}

.action-blocker-hint.tone-info .action-blocker-icon {
  color: var(--blue);
}

.action-blocker-hint.tone-danger .action-blocker-icon {
  color: var(--red);
}

.action-blocker-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.action-blocker-copy strong {
  color: var(--text-strong);
}

.action-blocker-copy p {
  margin: 0;
  color: var(--muted);
}

.action-blocker-copy dl {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 5px 12px;
  margin: 0;
}

.action-blocker-copy dt {
  color: var(--muted);
  font-weight: 800;
}

.action-blocker-copy dd {
  margin: 0;
  min-width: 0;
}

.action-blocker-technical {
  background: var(--panel-glass);
}

.guided-review-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.guided-review-list.is-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
}

.guided-review-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
  padding: 10px 12px;
  border: var(--border-line);
  border-left-width: 4px;
  border-left-color: var(--line-dark);
  border-radius: 7px;
  background: var(--panel);
}

.guided-review-row.tone-success {
  border-left-color: var(--green);
}

.guided-review-row.tone-warning {
  border-left-color: var(--amber);
}

.guided-review-row.tone-danger {
  border-left-color: var(--red);
}

.guided-review-row dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.guided-review-row dd {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin: 0;
}

.guided-review-row dd strong,
.guided-review-row dd span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.guided-review-row dd strong {
  color: var(--text-strong);
}

.guided-review-row dd span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 840px) {
  .guided-config-shell {
    grid-template-columns: 1fr;
  }

  .guided-config-sidebar {
    border-right: 0;
    border-bottom: var(--border-line);
  }

  .guided-config-sidebar .stepper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    padding: 0;
  }

  .guided-review-row,
  .action-blocker-copy dl {
    grid-template-columns: 1fr;
  }
}

/* Mail-style address editor: textarea surface + pills + add dialog. */
.email-address-editor {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 44px;
  border: var(--border-line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-control-surface);
  padding: 7px 8px;
}
.email-address-editor:focus-within {
  border-color: var(--input-border-focus);
  box-shadow: var(--focus-ring), var(--shadow-inset-highlight-strong);
}
.email-address-editor.has-error {
  border-color: var(--danger-border);
  box-shadow: var(--danger-focus-ring-soft);
}
.email-address-editor .email-chip-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 0;
}
.email-address-textarea {
  flex: 1 1 230px;
  min-width: 190px;
  min-height: 26px;
  max-height: 96px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
  overflow: hidden;
  padding: 4px 2px;
  font: inherit;
  line-height: 1.35;
}
.email-address-textarea:focus {
  outline: none;
  box-shadow: none;
}
.email-address-input.has-add-button .email-address-editor {
  padding-right: 42px;
}
.email-address-plus {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: linear-gradient(var(--control-gradient-start), var(--control-gradient-end-muted));
  color: var(--control-text);
  cursor: pointer;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}
.email-address-plus:hover {
  border-color: var(--control-border-hover);
  background: linear-gradient(var(--control-gradient-start), var(--control-gradient-end-hover));
}
.email-address-popover {
  position: absolute;
  z-index: 12;
  top: calc(100% + 7px);
  right: 0;
  width: min(360px, calc(100vw - 64px));
  display: grid;
  gap: 10px;
  border: var(--border-line-dark);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
  padding: 14px;
}
.email-address-popover h4 {
  margin: 0;
  color: var(--text-strong);
  font-size: 15px;
}
.email-address-popover label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.email-address-popover input {
  font-size: 14px;
}
.email-address-suggestions {
  display: grid;
  gap: 4px;
  max-width: 560px;
  border: var(--border-line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px var(--hover-tint);
  padding: 6px;
}
.email-address-suggestions button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
  padding: 7px 8px;
  text-align: left;
}
.email-address-suggestions button:hover {
  background: var(--panel-soft);
}
.email-address-suggestions small {
  color: var(--muted);
}
.email-address-input.compact {
  min-width: 420px;
}
.email-address-input.compact .email-address-editor {
  min-height: 40px;
}
.email-address-input.compact .email-address-textarea {
  flex-basis: 180px;
  min-width: 150px;
}
.email-address-input.disabled .email-address-editor {
  background: var(--panel-soft);
}
.email-address-input.disabled .email-address-plus,
.email-address-input.disabled .email-address-textarea,
.email-address-input.disabled .email-address-suggestions,
.email-address-input.disabled .email-address-popover {
  display: none;
}

/* Principal-aware account/contact picker with structured external entry. */
.people-picker {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.people-picker-search-field,
.people-picker-selection,
.people-picker-manual {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.people-picker-search-control {
  position: relative;
  display: flex;
  align-items: center;
}
.people-picker-search-control > svg {
  position: absolute;
  left: 12px;
  z-index: 1;
  color: var(--muted);
  pointer-events: none;
}
.people-picker-search-control input {
  padding-left: 38px;
}
.people-picker-search-control:focus-within > svg {
  color: var(--primary);
}

.searchable-select {
  position: relative;
  min-width: 0;
}
.searchable-select-control {
  position: relative;
  display: flex;
  align-items: center;
}
.searchable-select-control > svg {
  position: absolute;
  z-index: 1;
  color: var(--muted);
  pointer-events: none;
}
.searchable-select-control > svg:first-child {
  left: 12px;
}
.searchable-select-control > svg:last-child {
  right: 12px;
}
.searchable-select-control input {
  width: 100%;
  padding-right: 38px;
  padding-left: 38px;
}
.searchable-select-control:focus-within > svg:first-child {
  color: var(--primary);
}
.searchable-select-results {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: var(--z-popover, 50);
  display: grid;
  max-height: 320px;
  overflow: auto;
  padding: 5px;
  border: var(--border-line-dark);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}
.searchable-select-option {
  appearance: none;
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.searchable-select-option:hover:not(:disabled),
.searchable-select-option.is-active:not(:disabled) {
  background: var(--hover-tint-soft);
}
.searchable-select-option.is-selected {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
}
.searchable-select-option:focus-visible {
  outline: var(--focus-outline);
  outline-offset: -2px;
}
.searchable-select-option:disabled {
  cursor: not-allowed;
  opacity: .55;
}
.searchable-select-option strong,
.searchable-select-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.searchable-select-option small,
.searchable-select-message {
  color: var(--muted);
  font-size: 12px;
}
.searchable-select-message {
  margin: 0;
  padding: 10px;
}

.reference-multi-select {
  display: grid;
  min-width: 0;
  gap: 7px;
}
.reference-multi-select-values {
  display: grid;
  min-width: 0;
  max-height: 190px;
  gap: 4px;
  overflow: auto;
}
.reference-multi-select-value {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: var(--border-line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  padding: 5px 6px 5px 9px;
}
.reference-multi-select-value.is-inactive,
.reference-multi-select-value.is-unavailable {
  border-color: color-mix(in srgb, var(--warning) 45%, transparent);
  background: var(--warning-soft);
}
.reference-multi-select-value.is-custom {
  border-style: dashed;
}
.reference-multi-select-value-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.reference-multi-select-value-copy strong,
.reference-multi-select-value-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reference-multi-select-value-copy strong {
  color: var(--text-strong);
  font-size: 13px;
}
.reference-multi-select-value-copy small {
  color: var(--muted);
  font-size: 11px;
}

.people-picker-results {
  display: grid;
  max-height: 360px;
  overflow: auto;
  border: var(--border-line-dark);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
  padding: 5px;
}
.people-picker-result-group {
  display: grid;
  gap: 2px;
}
.people-picker-result-group + .people-picker-result-group {
  margin-top: 5px;
  border-top: var(--border-line);
  padding-top: 5px;
}
.people-picker-result-group-label {
  color: var(--text-label);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 5px 9px 3px;
  text-transform: uppercase;
}
.people-picker-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 16px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 8px 9px;
  text-align: left;
}
.people-picker-result:hover:not(:disabled),
.people-picker-result.is-active:not(:disabled),
.people-picker-result:focus-visible:not(:disabled) {
  background: var(--primary-soft);
  box-shadow: var(--primary-inset-ring);
  outline: none;
}
.people-picker-result:disabled {
  background: var(--control-disabled-bg);
  color: var(--control-disabled-text);
  cursor: not-allowed;
}
.people-picker-result-main,
.people-picker-result-context,
.people-picker-selected-person {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.people-picker-result-main strong,
.people-picker-result-main small,
.people-picker-result-context small,
.people-picker-selected-person strong,
.people-picker-selected-person small {
  overflow-wrap: anywhere;
}
.people-picker-result-main small,
.people-picker-result-context,
.people-picker-selected-person small {
  color: var(--muted);
  font-size: 12px;
}
.people-picker-result-context {
  justify-items: end;
  text-align: right;
}
.people-picker-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}
.people-picker-manual {
  justify-items: start;
}
.people-picker-manual-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  width: 100%;
  border: var(--border-line);
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 12px;
}
.people-picker-manual-form > label {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.people-picker-manual-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.people-picker-manual-form > .form-help {
  grid-column: 1 / -1;
  margin: 0;
}
.people-picker-selection > .field-label,
.people-picker-selection > span > .field-label {
  width: fit-content;
}

@media (max-width: 760px) {
  .people-picker-result {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .people-picker-result-context {
    justify-items: start;
    text-align: left;
  }
  .people-picker-manual-form {
    grid-template-columns: 1fr;
  }
}

/* Bootstrap-like switch controls without importing Bootstrap. */
.toggle-switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}
.toggle-switch-row.disabled {
  cursor: default;
  opacity: .72;
}
.toggle-switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.toggle-switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border: 1px solid var(--toggle-track-border);
  border-radius: 999px;
  background: var(--toggle-track-bg);
  box-shadow: var(--shadow-control-inset-strong);
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.toggle-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-thumb);
  transition: transform .16s ease;
}
.toggle-switch-input:checked ~ .toggle-switch-track {
  border-color: var(--primary);
  background: var(--primary);
}
.toggle-switch-input:checked ~ .toggle-switch-track .toggle-switch-thumb {
  transform: translateX(18px);
}
.toggle-switch-input:focus-visible ~ .toggle-switch-track {
  box-shadow: var(--primary-focus-ring-soft), var(--shadow-control-inset-strong);
}
.toggle-switch-input:disabled ~ .toggle-switch-track {
  filter: grayscale(.15);
  opacity: .7;
}
.toggle-switch-state-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}
.toggle-switch-state-label[data-selected="true"] {
  color: var(--text-strong);
  font-weight: 800;
}
.toggle-switch-copy {
  display: grid;
  gap: 2px;
}
.toggle-switch-label {
  color: var(--text-strong);
}
.toggle-switch-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

@media (max-width: 900px) {
  .email-address-input.compact { min-width: 260px; }
  .email-address-input.has-add-button .email-address-editor { padding-right: 39px; }
  .email-address-popover {
    left: 0;
    right: auto;
    width: min(340px, calc(100vw - 48px));
  }
}

/* Reusable inline help markers for form labels and compact contextual hints. */
.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.field-label-text {
  min-width: 0;
}
.inline-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  outline: none;
}
.ui-hide-help-hints .inline-help {
  display: none;
}
.inline-help-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  color: var(--text-subtle);
  background: var(--line-dark);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: context-menu;
}
.inline-help:focus-visible .inline-help-mark {
  box-shadow: var(--focus-ring);
}
.policy-path-help {
  display: grid;
  gap: 3px;
}
.policy-path-help-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

/* Shared policy table structure. Feature styles keep only layout-specific grid tracks. */
.policy-table {
  display: grid;
  gap: 0;
  border: var(--border-line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.policy-section {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}
.policy-section h3 {
  margin: 0;
  color: var(--text-strong);
}
.policy-row {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border-top: var(--border-line);
}
.policy-row:first-child {
  border-top: 0;
}
.policy-row-header {
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.policy-field-label {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.policy-field-label strong,
.policy-field-title {
  color: var(--text-strong);
  font-weight: 800;
}
.policy-field-label small,
.policy-effective-note {
  color: var(--muted);
}
.policy-control select,
.policy-control input,
.policy-row textarea {
  width: 100%;
}
.policy-effective-cell,
.policy-lower-cell {
  min-width: 0;
}
.policy-effective-value {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 800;
}
.policy-effective-value.policy-effective-note {
  color: var(--muted);
  font-weight: 600;
}
.policy-effective-note {
  margin: 0;
}
@media (max-width: 900px) {
  .policy-row,
  .policy-table.with-effective-column .policy-row,
  .policy-table.with-allow-column .policy-row,
  .policy-table.with-effective-column.with-allow-column .policy-row {
    grid-template-columns: 1fr;
  }
  .policy-row-header {
    display: none;
  }
}
.inline-help-bubble {
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: calc(100% + 9px);
  width: max-content;
  max-width: min(320px, calc(100vw - 48px));
  transform: translate(-50%, 3px);
  border: var(--border-line-dark);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  padding: 9px 10px;
  white-space: normal;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease .35s, transform .14s ease .35s, visibility 0s linear .49s;
}
.inline-help-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 9px;
  height: 9px;
  border-right: var(--border-line-dark);
  border-bottom: var(--border-line-dark);
  background: var(--surface);
  transform: translate(-50%, -5px) rotate(45deg);
}
.inline-help:hover .inline-help-bubble,
.inline-help:focus-within .inline-help-bubble {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: .35s, .35s, .35s;
}
.field-with-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.field-with-action input,
.field-with-action select,
.field-with-action textarea {
  flex: 1 1 auto;
  min-width: 0;
}

.field-with-action button,
.field-with-action .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.split-field-action {
  gap: 0;
}

.split-field-action > input,
.split-field-action > select,
.split-field-action > textarea {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.split-field-action > button,
.split-field-action > .button,
.split-field-action > .btn {
  align-self: stretch;
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: none;
}

.field-input-missing {
  border-color: var(--danger-border-deep) !important;
  box-shadow: var(--danger-focus-ring) !important;
}

.disabled-action-tooltip {
  position: relative;
  display: inline-flex;
}

.disabled-action-tooltip:focus-visible {
  outline: none;
}

.disabled-action-tooltip:focus-visible > .btn {
  box-shadow: var(--focus-ring);
}

.disabled-action-tooltip[data-tooltip]:not([data-tooltip=""]):hover::after,
.disabled-action-tooltip[data-tooltip]:not([data-tooltip=""]):focus-within::after {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 20000;
  width: min(280px, 72vw);
  padding: 9px 11px;
  border: 1px solid var(--border-danger-soft);
  border-radius: var(--radius-sm, 8px);
  color: var(--danger-text-tooltip);
  background: var(--danger-muted-bg);
  box-shadow: var(--shadow-popover);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  pointer-events: none;
}
.loading-frame {
  position: relative;
}

.loading-frame.is-loading {
  min-height: 120px;
}

.loading-frame.is-loading > :not(.loading-frame-overlay) {
  pointer-events: none;
  user-select: none;
}

.loading-frame-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 1.25rem;
  border-radius: var(--radius-lg, 18px);
  background: var(--transparent-surface);
  backdrop-filter: blur(1.5px);
  margin: -10px;
}

.loading-frame-panel {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel-glass-strong);
  box-shadow: var(--shadow-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

.module-load-progress {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
}

.module-load-error .alert {
  max-width: 640px;
}

.module-load-error .alert-message {
  display: grid;
  justify-items: start;
  gap: 12px;
}

.module-load-error .alert-message p {
  margin: 0;
}


/* Collapsible cards */
.card-collapsible .card-header {
  gap: 12px;
}
.card-collapsible .card-actions {
  align-items: center;
}
.card-collapse-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: linear-gradient(var(--control-gradient-start), var(--control-gradient-end-muted));
  color: var(--control-text);
  cursor: pointer;
  box-shadow: var(--shadow-control);
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card-collapse-toggle:hover {
  border-color: var(--control-border-pressed);
  background: linear-gradient(var(--control-gradient-start), var(--control-gradient-end-pressed));
  box-shadow: var(--shadow-control-hover);
}
.card-collapse-toggle:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}
.card-collapse-toggle svg {
  transform: rotate(-180deg);
  transition: transform .22s ease;
}
.card-collapsible.is-collapsed .card-collapse-toggle svg {
  transform: none;
}
.card-collapsible.is-collapsed {
  align-self: start;
}
.card-collapse-region {
  display: block;
  width: 100%;
  min-width: 0;
}
.card-collapsible.is-collapsed .card-collapse-region {
  display: none;
}
.card-collapse-region > .card-body {
  width: 100%;
  min-width: 0;
}
@media (prefers-reduced-motion: reduce) {
  .card-collapse-toggle,
  .card-collapse-toggle svg,
  .card-collapse-region {
    transition: none;
  }
}

/* Reusable dismissible page alerts */
.alert-dismissible {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  box-shadow: var(--shadow-dismissible);
}

.alert-dismissible .alert-message {
  min-width: 0;
  flex: 1 1 auto;
}

.compact-alert {
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.compact-alert .alert-message > :first-child {
  margin-top: 0;
}

.compact-alert .alert-message > :last-child {
  margin-bottom: 0;
}

.alert-floating-stack {
  position: fixed;
  top: 131px;
  left: 50%;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: min(640px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.alert-floating {
  position: relative;
  top: auto;
  width: 100%;
  margin: 0;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: var(--shadow-floating);
  pointer-events: auto;
}

.alert-dismiss {
  border: 0;
  background: transparent;
  color: currentColor;
  opacity: 0.78;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.alert-dismiss:hover,
.alert-dismiss:focus-visible {
  opacity: 1;
  background: var(--panel-glass-muted);
}


/* Shared explorer/list work surfaces. Modules own their column definitions and domain interactions. */
.file-manager-page.file-manager-fullscreen {
  position: relative;
  display: grid;
  grid-template-rows: 1fr;
  height: calc(100vh - 115px);
  padding: 0;
  overflow: hidden;
}

.file-manager-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: var(--border-line);
  background: var(--panel-header);
}

.file-manager-shell {
  display: grid;
  min-height: 0;
  height: 100%;
  border: var(--border-line);
  border-radius: 0;
  overflow: hidden;
  background: var(--panel);
}

.file-list-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--panel);
}

.file-list-sticky {
  flex: 0 0 auto;
  z-index: 2;
  border-bottom: var(--border-line);
  background: var(--panel-soft);
}

.file-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  padding: 10px 14px 6px;
}

.file-breadcrumb,
.file-breadcrumb-segment {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.file-breadcrumb {
  border: 0;
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
  font-weight: 800;
  padding: 4px 6px;
  border-radius: 7px;
}

.file-breadcrumb:hover:not(:disabled),
.file-breadcrumb:focus-visible {
  background: var(--panel);
  outline: none;
}

.file-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-top: var(--border-line);
  color: var(--muted);
  font-size: 12px;
}

.file-list-drop-target {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  transition: background-color .16s ease, box-shadow .16s ease;
}

.file-list-table-head,
.file-list-row {
  display: grid;
  gap: 12px;
  align-items: center;
}

.file-list-table-head {
  padding: 10px 14px;
  border-top: var(--border-line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.file-list-row {
  min-height: 58px;
  padding: 9px 14px;
  border-bottom: var(--border-line);
  cursor: default;
  user-select: none;
}

.file-list-row:focus-visible {
  outline: 2px solid var(--line-dark);
  outline-offset: -2px;
}

.file-list-row:hover,
.file-list-row.is-selected {
  background: var(--line);
}

.file-list-name-cell {
  min-width: 0;
}

.file-list-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: default;
  font: inherit;
  text-align: left;
  padding: 0;
}

.file-list-name > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.file-list-name strong,
.file-list-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list-name small {
  color: var(--muted);
  font-size: 12px;
}

.file-row-icon {
  color: var(--muted);
  flex: 0 0 auto;
}

.file-row-tail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.file-list-empty {
  padding: 36px 20px;
  color: var(--muted);
  text-align: center;
}

.file-manager-shell.is-loading .file-tree-panel,
.file-manager-shell.is-loading .file-list-panel {
  filter: blur(1.5px);
  pointer-events: none;
  user-select: none;
}

.file-manager-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  background: var(--panel-glass);
  backdrop-filter: blur(1px);
}

/* Shared explorer tree and message display surfaces. */
.explorer-tree-children {
  display: grid;
  gap: 1px;
}

.explorer-tree-node-wrap {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 2px;
  border-radius: 9px;
}

.explorer-tree-node-wrap.has-actions {
  grid-template-columns: 26px minmax(0, 1fr) auto;
}

.explorer-tree-node,
.explorer-tree-toggle {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.explorer-tree-toggle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 32px;
  border-radius: 9px;
  color: var(--muted);
}

.explorer-tree-toggle:disabled {
  cursor: default;
  opacity: .55;
}

.explorer-tree-toggle.explorer-tree-toggle-static {
  cursor: default;
  pointer-events: none;
}

.explorer-tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  padding: 8px 9px;
  border-radius: 9px;
  font: inherit;
  text-align: left;
  user-select: none;
}

.explorer-tree-node span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-tree-node-content {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.explorer-tree-node-content strong,
.explorer-tree-node-content small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-tree-node-content small {
  color: var(--muted);
  font-size: 12px;
}

.explorer-tree-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding-right: 4px;
}

.explorer-tree-toolbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.explorer-tree-scroll-region {
  max-height: 640px;
  overflow: auto;
}

.explorer-tree-node-wrap:hover,
.explorer-tree-node-wrap:focus-within,
.explorer-tree-node-wrap.is-active {
  background: var(--primary-soft);
  outline: none;
}

.explorer-tree-node:focus-visible,
.explorer-tree-toggle:focus-visible {
  outline: none;
}

.file-tree-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: var(--border-line);
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
}

.file-tree-heading {
  flex: 0 0 auto;
  padding: 13px 14px;
  border-bottom: var(--border-line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.file-tree-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 0 16px;
}

.file-tree-space + .file-tree-space {
  margin-top: 10px;
  padding-top: 10px;
  border-top: var(--border-line);
}

.file-tree-node-wrap {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 2px;
  border-radius: 0;
}

.file-tree-node,
.file-tree-select,
.file-tree-toggle {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.file-tree-toggle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 32px;
  border-radius: 0;
  color: var(--muted);
}

.file-tree-toggle:disabled {
  cursor: default;
  opacity: .55;
}

.file-tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  padding: 8px 9px;
  border-radius: 0;
  font: inherit;
  text-align: left;
  user-select: none;
}

.file-tree-node span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-tree-root {
  font-weight: 800;
}

.file-tree-select {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--text-strong);
  font-weight: 900;
  line-height: 1;
}

.file-tree-node-wrap:hover,
.file-tree-node-wrap:focus-within,
.file-tree-node-wrap.is-active,
.file-tree-root:hover:not(:disabled),
.file-tree-root:focus-visible,
.file-tree-root.is-active {
  background: var(--line);
  outline: none;
}

.file-tree-node:focus-visible,
.file-tree-toggle:focus-visible,
.file-tree-select:focus-visible {
  outline: none;
}

.file-tree-node-wrap.is-drop-target,
.file-tree-root.is-drop-target {
  background: var(--line);
  box-shadow: inset 0 0 0 2px var(--line-dark);
}

.file-tree-node-wrap.is-selected .file-tree-select {
  background: var(--primary);
  color: var(--on-accent);
}

.file-tree-children {
  display: grid;
  gap: 1px;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, auto);
  justify-content: start;
  max-width: 100%;
  overflow: hidden;
  border: var(--border-line-dark);
  border-radius: 8px;
  background: var(--line-dark);
  box-shadow: var(--shadow-control);
}

.segmented-control-size-content {
  grid-auto-columns: auto;
}

.segmented-control-size-equal {
  grid-auto-columns: minmax(0, 1fr);
}

.segmented-control-width-inline {
  width: fit-content;
}

.segmented-control-width-fill {
  width: 100%;
}

.segmented-control-option {
  min-width: 0;
  min-height: 32px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(var(--surface), var(--panel));
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-control);
  transition: background .18s ease, box-shadow .18s ease, color .18s ease;
}

.segmented-control-option + .segmented-control-option {
  border-left: var(--border-line-dark);
}

.segmented-control-option:first-child {
  border-radius: 7px 0 0 7px;
}

.segmented-control-option:last-child {
  border-radius: 0 7px 7px 0;
}

.segmented-control-option:hover,
.segmented-control-option:focus-visible {
  background: linear-gradient(var(--surface), var(--bar));
  color: var(--text-strong);
  box-shadow: var(--shadow-control-hover);
}

.segmented-control-option:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: -1px;
}

.segmented-control-option.is-active,
.segmented-control-option.active {
  background: var(--line);
  color: var(--text-strong);
  box-shadow: inset 0 2px 5px rgba(var(--shadow-color-rgb), .12), var(--shadow-inset-highlight);
}

.segmented-control-option.is-active:hover,
.segmented-control-option.is-active:focus-visible,
.segmented-control-option.active:hover,
.segmented-control-option.active:focus-visible {
  background: var(--line);
  box-shadow: inset 0 2px 5px rgba(var(--shadow-color-rgb), .14), var(--shadow-inset-highlight);
}

.segmented-control-option:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.selection-list {
  display: grid;
  min-width: 0;
}

:where(.selection-list-item) {
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 8px 10px;
  text-align: left;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

:where(.selection-list-item):hover:not(:disabled) {
  background: var(--hover-tint-soft);
}

:where(.selection-list-item).is-selected {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
}

:where(.selection-list-item):focus-visible {
  outline: var(--focus-outline);
  outline-offset: -2px;
}

:where(.selection-list-item)[draggable="true"] {
  cursor: grab;
}

:where(.selection-list-item)[draggable="true"]:active {
  cursor: grabbing;
}

:where(.selection-list-item):disabled,
:where(.selection-list-item).is-disabled {
  cursor: not-allowed;
  opacity: .55;
}

.theme-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.theme-preview {
  --preview-bg: var(--theme-preview-light-bg);
  --preview-bar: var(--theme-preview-light-bar);
  --preview-surface: var(--theme-preview-light-surface);
  --preview-line: var(--theme-preview-light-line);
  --preview-text: var(--theme-preview-light-text);
  --preview-muted: var(--theme-preview-light-muted);
  display: grid;
  gap: 0;
  min-height: 112px;
  overflow: hidden;
  border: var(--border-line);
  border-radius: var(--radius-sm);
  background: var(--preview-bg);
}

.theme-preview[data-preview-theme="dark"] {
  --preview-bg: var(--theme-preview-dark-bg);
  --preview-bar: var(--theme-preview-dark-bar);
  --preview-surface: var(--theme-preview-dark-surface);
  --preview-line: var(--theme-preview-dark-line);
  --preview-text: var(--theme-preview-dark-text);
  --preview-muted: var(--theme-preview-dark-muted);
}

.theme-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--preview-line);
  background: var(--preview-bar);
  color: var(--preview-text);
  font-size: 12px;
  font-weight: 800;
}

.theme-preview-header i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.theme-preview-body {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  background: var(--preview-surface);
  color: var(--preview-text);
}

.theme-preview-body strong {
  font-size: 13px;
}

.theme-preview-body span {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--preview-line);
}

.theme-preview-body span:last-child {
  width: 68%;
  background: var(--preview-muted);
  opacity: .45;
}

.message-display-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.message-display-header {
  display: grid;
  gap: 10px;
}

.message-display-header h3 {
  margin: 0;
  color: var(--text-strong);
  overflow-wrap: anywhere;
}

.message-display-fields {
  display: table;
  width: 100%;
  margin: 0;
  background: transparent;
  overflow: hidden;
}

.message-display-fields div,
.message-display-headers dl div {
  display: table-row;
}

.message-display-fields dt,
.message-display-fields dd,
.message-display-headers dt,
.message-display-headers dd {
  display: table-cell;
  padding: 7px 0px;
  vertical-align: baseline;
}

.message-display-fields div:last-child dt,
.message-display-fields div:last-child dd,
.message-display-headers dl div:last-child dt,
.message-display-headers dl div:last-child dd {
  border-bottom: 0;
}

.message-display-fields dt,
.message-display-headers dt {
  width: 96px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.message-display-fields dd,
.message-display-headers dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.message-display-body-section {
  display: grid;
  gap: 8px;
}

.message-display-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-display-section-heading h4,
.message-display-attachments h4 {
  margin: 0;
}

.message-display-body,
.message-display-html-frame {
  width: 100%;
  min-height: 220px;
  max-height: 420px;
  margin: 0;
  overflow: auto;
  border: var(--border-line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text);
}

.message-display-body {
  padding: 12px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-display-html-frame {
  height: 420px;
  background: var(--white);
}

.message-display-attachments {
  display: grid;
  gap: 9px;
  min-height: 0;
}

.message-display-attachments-scroll {
  display: grid;
  gap: 9px;
  max-height: min(360px, 38vh);
  min-height: 0;
  overflow: auto;
  padding: 0 6px;
  scrollbar-gutter: stable;
}

.message-display-attachment-list {
  display: grid;
  gap: 7px;
}

.message-display-attachment-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border: var(--border-line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.message-display-attachment-row > svg {
  margin-top: 1px;
}

.message-display-attachment-row.is-linked > svg {
  color: var(--green);
}

.message-display-attachment-row.is-unlinked > svg {
  color: var(--red);
}

.message-display-attachment-row > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.message-display-attachment-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-display-attachment-row small,
.message-display-attachment-archive header span,
.message-display-attachment-archive header small {
  color: var(--muted);
}

.message-display-attachment-detail {
  overflow-wrap: anywhere;
}

.message-display-attachment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.message-display-attachment-meta span + span::before {
  content: "";
}

.message-display-attachment-archive {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: var(--border-line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.message-display-attachment-archive header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.message-display-attachment-archive header div {
  display: grid;
  gap: 2px;
}

.message-display-attachment-archive header strong,
.message-display-attachment-archive header small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.message-display-attachment-protection {
  justify-items: end;
  text-align: right;
}
.message-display-attachment-protection-note {
  display: block;
  max-width: 240px;
  overflow-wrap: anywhere;
}

.message-display-headers summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text-strong);
}

.message-display-headers dl {
  display: table;
  width: 100%;
  max-height: 280px;
  margin: 8px 0 0;
  overflow: auto;
}


/* Shared SMTP/IMAP server settings panel. */
.mail-server-settings-panel {
  display: grid;
  gap: 12px;
}
.mail-server-segmented-control {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-self: center;
  width: min(320px, 100%);
}
.mail-server-settings-view {
  min-width: 0;
}
.mail-server-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 22px;
}
.mail-server-subsection {
  display: grid;
  align-content: start;
  gap: 12px;
}
.mail-server-section-heading.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mail-server-section-heading h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 14px;
  letter-spacing: .01em;
}
.form-grid.compact.mail-server-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.mail-server-form-grid {
  align-items: start;
}
.mail-server-field-heading {
  grid-column: 1 / -1;
  margin: 2px 0 -4px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 800;
}
.mail-server-field-span {
  grid-column: 1 / -1;
}
.mail-server-toggle-row {
  border: var(--border-line);
  border-radius: 8px;
  background: var(--panel-soft);
}
.mail-server-plain-toggle-row {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.mail-server-actions {
  justify-content: flex-end;
  margin-top: 12px;
}
.mail-server-folder-field {
  align-items: stretch;
}
.mail-server-folder-field .btn,
.mail-server-folder-field .button {
  min-height: 36px;
}
.mail-server-folder-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.mail-server-folder-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: var(--border-line);
  border-radius: 99px;
  background: var(--panel-soft);
  padding: 3px 9px;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 700;
}
@media (max-width: 1000px) {
  .mail-server-settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .mail-server-segmented-control { width: min(320px, 100%); }
}
@media (max-width: 720px) {
  .credential-panel-grid { grid-template-columns: 1fr; }
  .form-grid.compact.mail-server-form-grid { grid-template-columns: 1fr; }
  .mail-server-section-heading.split { align-items: flex-start; flex-direction: column; }
  .mail-server-segmented-control { width: 100%; }
}

.unsaved-changes-dialog {
  max-width: 520px;
}

.unsaved-changes-actions {
  justify-content: flex-end;
}

.file-drop-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 170px;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.file-drop-zone:hover,
.file-drop-zone:focus-visible,
.file-drop-zone.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.file-drop-zone:focus-visible {
  outline: none;
  box-shadow: var(--primary-focus-ring);
}
.file-drop-zone[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .65;
}
.file-drop-zone.is-busy {
  border-color: var(--primary);
  background: var(--primary-soft);
  cursor: progress;
  opacity: 1;
}
.file-drop-progress {
  --file-drop-progress: 0%;
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--file-drop-progress), var(--primary-soft-strong) 0);
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.file-drop-progress::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--panel-soft);
  box-shadow: var(--primary-inset-ring);
}
.file-drop-progress > span {
  position: relative;
  z-index: 1;
}
.file-drop-progress.is-indeterminate {
  background: conic-gradient(var(--primary) 0 32%, var(--primary-soft-strong) 32% 100%);
  animation: file-drop-progress-spin .85s linear infinite;
}
@keyframes file-drop-progress-spin {
  to { transform: rotate(360deg); }
}

/* Shared settings, placeholder, and administration layout contracts. */
.placeholder-stack {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.placeholder-stack span {
  display: block;
  border: 1px dashed var(--line-dark);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 700;
}
.compact-detail-list {
  gap: 8px;
}
.settings-dashboard-grid {
  align-items: start;
}
.settings-list {
  display: grid;
  gap: 12px;
}
.settings-target-row {
  max-width: 520px;
}
.admin-secret {
  display: block;
  padding: 14px;
  margin: 12px 0;
  overflow-wrap: anywhere;
  border: var(--border-line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  font-size: 14px;
  user-select: all;
}
.admin-json-preview {
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border: var(--border-line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.admin-audit-grid .data-grid-scroll-region {
  max-height: min(68vh, 720px);
}
.admin-audit-grid .data-grid-header-cell {
  top: 0;
}
.admin-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}
.admin-details-grid > div {
  min-width: 0;
  padding: 10px 0;
  border-bottom: var(--border-line);
}
.admin-details-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.admin-details-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.admin-governance-mode {
  display: grid;
  gap: 8px;
}
.admin-tenant-assignment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: center;
  gap: 10px;
}
.admin-settings-form {
  display: grid;
  gap: 18px;
}
.admin-settings-form .card {
  margin: 0;
}
.admin-managed-notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--info-muted-border);
  border-radius: var(--radius-sm);
  background: var(--info-bg);
  color: var(--info-text-deep);
  line-height: 1.45;
}
.admin-permission-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.admin-permission-group {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: var(--border-line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.admin-permission-group legend {
  padding: 0 6px;
  color: var(--text-strong);
  font-weight: 700;
}
.admin-protection-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--warning-border-soft);
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning-text-strong);
}
.admin-scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-scope-list code {
  max-width: 100%;
  padding: 4px 7px;
  border: var(--border-line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  overflow-wrap: anywhere;
}
.admin-overview-section-label {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.admin-permission-details {
  display: grid;
  gap: 12px;
}
.admin-permission-details section {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.admin-permission-details ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}
.module-license-status {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.dashboard-contribution-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dashboard-contribution-list > li + li {
  border-top: var(--border-line);
}
.dashboard-contribution-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 2px;
  color: inherit;
  text-decoration: none;
}
a.dashboard-contribution-row:hover {
  background: var(--hover-tint-soft);
}
.dashboard-contribution-leading,
.dashboard-contribution-trailing {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}
.dashboard-contribution-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.dashboard-contribution-title,
.dashboard-contribution-detail,
.dashboard-contribution-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-contribution-title {
  font-weight: 700;
}
.dashboard-contribution-detail,
.dashboard-contribution-meta {
  color: var(--muted);
  font-size: 12px;
}
.dashboard-contribution-empty {
  margin: 0;
  padding: 18px 2px;
}
.dashboard-contribution-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
@media (max-width: 900px) {
  .admin-details-grid,
  .admin-tenant-assignment-row {
    grid-template-columns: 1fr;
  }
}
.stage-rail {
  max-width: 100%;
  overflow-x: auto;
}

.stage-rail-track {
  display: flex;
  align-items: flex-start;
  width: max-content;
  min-width: max-content;
  margin: 0 auto;
}

.stage-rail-group {
  display: flex;
  align-items: flex-start;
}

.stage-rail-item {
  display: grid;
  min-width: 96px;
  justify-items: center;
  gap: 6px;
  padding: 3px 5px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: center;
}

button.stage-rail-item {
  cursor: pointer;
}

button.stage-rail-item:hover .stage-rail-icon,
button.stage-rail-item:focus-visible .stage-rail-icon,
.stage-rail-group[data-current="true"] .stage-rail-icon {
  background: color-mix(in srgb, var(--stage-rail-color) 15%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-rail-color) 12%, transparent);
}

button.stage-rail-item:focus-visible {
  outline: none;
}

.stage-rail-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--stage-rail-color);
  border-radius: 50%;
  background: color-mix(in srgb, var(--stage-rail-color) 8%, var(--surface));
  color: color-mix(in srgb, var(--stage-rail-color) 82%, var(--text));
  transition: background .16s ease, box-shadow .16s ease;
}

.stage-rail-copy {
  display: grid;
  min-width: 0;
  justify-items: center;
}

.stage-rail-copy strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text-strong);
  font-size: 12px;
  white-space: nowrap;
}

.stage-rail-copy small {
  display: inline-flex;
  min-height: 14px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.stage-rail-status {
  color: color-mix(in srgb, var(--stage-rail-color) 72%, var(--text)) !important;
}

.stage-rail-line {
  width: 42px;
  height: 2px;
  flex: 0 0 auto;
  margin: 21px 2px 0;
  background: linear-gradient(
    to right,
    var(--stage-rail-line-color, var(--stage-rail-color)),
    var(--stage-rail-line-next-color, var(--stage-rail-color))
  );
  opacity: .82;
}

.wysiwyg-editor {
  min-width: 0;
  overflow: hidden;
  border: var(--border-line);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow-control-inset);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.wysiwyg-editor:focus-within {
  border-color: var(--input-border-focus);
  box-shadow: var(--focus-ring), var(--shadow-control-inset);
}

.wysiwyg-editor-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 6px;
  border-bottom: var(--border-line);
  background: var(--surface-muted);
}

.wysiwyg-editor-toolbar {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.wysiwyg-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
  border-right: var(--border-line);
}

.wysiwyg-toolbar-group:last-child {
  padding-right: 0;
  border-right: 0;
}

.wysiwyg-toolbar-button.icon-button.btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-color: transparent;
  box-shadow: none;
}

.wysiwyg-toolbar-button.icon-button.btn:hover:not(:disabled),
.wysiwyg-toolbar-button.icon-button.btn:focus-visible,
.wysiwyg-toolbar-button.icon-button.btn.is-active {
  border-color: var(--line-dark);
  background: var(--line);
  color: var(--text-strong);
}

.wysiwyg-toolbar-button.icon-button.btn.is-active {
  box-shadow: inset 0 1px 3px rgba(var(--shadow-color-rgb), .12);
}

.wysiwyg-block-style {
  flex: 0 0 auto;
}

.wysiwyg-block-style select {
  width: 126px;
  min-height: 32px;
  padding: 5px 28px 5px 8px;
  font-size: 13px;
}

.wysiwyg-editor-mode {
  flex: 0 0 auto;
}

.wysiwyg-editor-mode .segmented-control-option {
  min-height: 32px;
  padding: 5px 9px;
}

.wysiwyg-editor-content {
  min-height: var(--wysiwyg-editor-min-height);
  background: var(--surface);
  cursor: text;
}

.wysiwyg-prosemirror {
  box-sizing: border-box;
  min-height: var(--wysiwyg-editor-min-height);
  padding: 12px 14px;
  color: var(--text);
  line-height: 1.5;
  outline: none;
  overflow-wrap: anywhere;
}

.wysiwyg-prosemirror > :first-child {
  margin-top: 0;
}

.wysiwyg-prosemirror > :last-child {
  margin-bottom: 0;
}

.wysiwyg-prosemirror p,
.wysiwyg-prosemirror blockquote,
.wysiwyg-prosemirror pre,
.wysiwyg-prosemirror ul,
.wysiwyg-prosemirror ol {
  margin: 0 0 10px;
}

.wysiwyg-prosemirror h1,
.wysiwyg-prosemirror h2,
.wysiwyg-prosemirror h3 {
  margin: 14px 0 8px;
  letter-spacing: 0;
}

.wysiwyg-prosemirror h1 {
  font-size: 24px;
}

.wysiwyg-prosemirror h2 {
  font-size: 20px;
}

.wysiwyg-prosemirror h3 {
  font-size: 17px;
}

.wysiwyg-prosemirror blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--line-dark);
  color: var(--text-subtle);
}

.wysiwyg-prosemirror pre {
  overflow: auto;
  padding: 10px 12px;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--code-text);
}

.wysiwyg-prosemirror a {
  color: var(--primary);
  text-decoration: underline;
}

.wysiwyg-prosemirror img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px 0;
}

.wysiwyg-prosemirror img.ProseMirror-selectednode {
  outline: 2px solid var(--primary-border);
  outline-offset: 2px;
}

.wysiwyg-inline-token {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  margin: 0 2px;
  padding: 1px 6px;
  border: 1px solid var(--primary-border);
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--info-text-deep);
  font-family: var(--font-mono, monospace);
  font-size: .88em;
  line-height: 1.35;
  vertical-align: baseline;
  white-space: nowrap;
}

.wysiwyg-inline-token.ProseMirror-selectednode {
  background: var(--primary-soft-strong);
  box-shadow: var(--primary-focus-ring);
}

.wysiwyg-editor.is-disabled .wysiwyg-editor-content {
  background: var(--control-disabled-bg);
  cursor: default;
}

.wysiwyg-editor.is-disabled .wysiwyg-prosemirror {
  color: var(--control-disabled-text);
}

.wysiwyg-editor-source {
  display: block;
  min-height: var(--wysiwyg-editor-min-height);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  line-height: 1.5;
}

.wysiwyg-editor-source:focus {
  outline: none;
  box-shadow: none;
}

.wysiwyg-editor-source-note {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--warning-border-soft);
  background: var(--warning-muted-bg);
  color: var(--warning-text);
  font-size: 12px;
}

.dialog-panel.wysiwyg-editor-dialog {
  width: min(520px, calc(100vw - 32px));
}

.wysiwyg-editor-dialog-error {
  margin: 0;
  color: var(--danger-text-strong);
  font-size: 13px;
}

@media (max-width: 760px) {
  .wysiwyg-editor-header {
    display: grid;
  }

  .wysiwyg-editor-mode {
    justify-self: end;
  }
}
