:root {
  --sidebar-width: 191px;
  --toolbox-handle-width: 24px;
  --bg: #edf3fa;
  --panel: rgba(247, 251, 255, 0.88);
  --panel-strong: #f7fbff;
  --line: rgba(25, 42, 63, 0.12);
  --text: #142235;
  --muted: #5c6f86;
  --primary: #2463c8;
  --primary-strong: #17469a;
  --danger: #cf4343;
  --danger-strong: #a53030;
  --success: #1f8f66;
  --info: #2b6db2;
  --error: #a53030;
  --shadow: 0 20px 50px rgba(15, 30, 47, 0.16);
  --table-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
  --table-head-bg: linear-gradient(180deg, rgba(235, 244, 252, 0.98), rgba(226, 238, 249, 0.98));
  --table-head-border: rgba(25, 42, 63, 0.14);
  --table-border: rgba(25, 42, 63, 0.1);
  --table-border-strong: rgba(25, 42, 63, 0.14);
  --table-stripe: rgba(244, 248, 253, 0.82);
  --table-hover: rgba(228, 242, 251, 0.94);
  --table-shadow: 0 12px 30px rgba(15, 30, 47, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 13px;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(36, 99, 200, 0.28), transparent 28%),
    radial-gradient(circle at bottom right, rgba(29, 128, 191, 0.22), transparent 30%),
    linear-gradient(135deg, #edf2f9 0%, #f7fbff 52%, #e5eef9 100%);
}

button,
input {
  font: inherit;
}

button {
  font-family: "Manrope", "Segoe UI", sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(196px, var(--sidebar-width)) var(--toolbox-handle-width) 1fr;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}

.app-shell.is-toolbox-collapsed {
  grid-template-columns: var(--toolbox-handle-width) 1fr;
}

.app-shell.is-toolbox-collapsed .toolbox-sidebar {
  display: none;
}

.app-shell.is-auth-overlay-open {
  pointer-events: none;
  user-select: none;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(14, 27, 41, 0.42);
  backdrop-filter: blur(4px);
}

.auth-overlay[hidden] {
  display: none;
}

.auth-modal {
  width: min(440px, calc(100vw - 28px));
  border-radius: 16px;
  border: 1px solid rgba(25, 42, 63, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 251, 255, 0.96)),
    linear-gradient(135deg, rgba(36, 99, 200, 0.06), rgba(58, 104, 176, 0.08));
  box-shadow: 0 26px 70px rgba(15, 30, 47, 0.28);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-modal-title,
.database-modal-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.auth-close-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
}

.auth-modal-description {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.auth-inline-status {
  margin: 0;
  min-height: 24px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(247, 251, 255, 0.92);
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
}

.auth-inline-status.is-success {
  border-color: rgba(47, 111, 80, 0.24);
  background: rgba(231, 248, 243, 0.96);
  color: var(--success);
}

.auth-inline-status.is-error {
  border-color: rgba(207, 67, 67, 0.22);
  background: rgba(255, 235, 235, 0.96);
  color: var(--danger-strong);
}

.auth-inline-status.is-warning {
  border-color: rgba(176, 116, 28, 0.26);
  background: rgba(255, 244, 224, 0.96);
  color: #7a4b0d;
}

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

.auth-mode-button {
  min-height: 30px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: none;
}

.auth-mode-button.is-active {
  color: #fff7ef;
  background: linear-gradient(135deg, var(--primary) 0%, #14a3c1 100%);
}

.auth-form {
  display: grid;
  gap: 6px;
}

.auth-form-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-form-actions-row .auth-submit-button {
  margin-top: 0;
  flex: 1 1 180px;
}

.auth-inline-link-button {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  box-shadow: none;
}

.auth-inline-link-button:hover {
  color: #0d6b84;
}

.auth-inline-link-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-form-choice {
  display: grid;
  gap: 6px;
}

.auth-form-label {
  font-size: 11px;
  font-weight: 700;
}

.auth-form-input {
  width: 100%;
  border: 1px solid rgba(25, 42, 63, 0.15);
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.auth-submit-button {
  margin-top: 4px;
  min-height: 30px;
}

.auth-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  cursor: pointer;
}

.auth-consent-checkbox {
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

.auth-consent-label a {
  color: var(--primary);
  text-decoration: underline;
}

/* Company panel: inline name input + save button */
.company-name-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.company-name-input {
  flex: 1 1 auto;
  min-width: 0;
}

.company-name-save-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Token display + copy button */
.company-token-row,
.company-invite-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.company-invite-value,
#companyInviteTokenValue {
  font-family: monospace;
  background: rgba(0,0,0,0.03);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(25, 42, 63, 0.06);
  white-space: nowrap;
}

.token-copy-button,
.company-invite-row .secondary-button {
  flex: 0 0 auto;
}

.password-overlay {
  z-index: 92;
}

.password-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.password-close-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
}

.password-form-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.database-overlay {
  z-index: 93;
}

.database-overlay#databaseOverlay {
  align-items: flex-start;
  padding-top: 12px;
}

.database-modal {
  width: min(920px, calc(100vw - 28px));
  height: min(820px, calc(100vh - 24px));
  max-height: min(820px, calc(100vh - 24px));
  border-radius: 16px;
  border: 1px solid rgba(25, 42, 63, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 251, 255, 0.96)),
    linear-gradient(135deg, rgba(36, 99, 200, 0.06), rgba(58, 104, 176, 0.08));
  box-shadow: 0 26px 70px rgba(15, 30, 47, 0.28);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.database-overlay#databaseOverlay .database-modal {
  max-width: calc(100vw - 28px);
}

.database-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.database-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.database-close-button {
  min-height: 0;
}

.repository-search-row {
  margin-bottom: 10px;
}

.repository-search-row input {
  width: 100%;
  box-sizing: border-box;
}

.repository-list {
  max-height: 400px;
  overflow-y: auto;
}

.repository-diagram-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(255, 255, 255, 0.88);
  margin-bottom: 4px;
}

.repository-versions-panel {
  width: 100%;
  flex: 0 0 100%;
  margin-top: 6px;
  border-top: 1px solid rgba(25, 42, 63, 0.1);
  padding-top: 6px;
}

.repository-versions-loading,
.repository-versions-empty,
.repository-versions-error {
  font-size: 0.85em;
  color: #777;
  padding: 4px 0;
}

.repository-versions-error { color: #c62828; }

.repository-version-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(25, 42, 63, 0.06);
  flex-wrap: wrap;
}

.repository-version-row:last-child { border-bottom: none; }

.repo-ver-name {
  font-size: 0.85em;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-ver-meta {
  font-size: 0.78em;
  color: #888;
  white-space: nowrap;
}

.repo-ver-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.repo-ver-actions button {
  font-size: inherit;
  padding: inherit;
}

.danger-button-soft {
  color: #c62828;
  border-color: rgba(198, 40, 40, 0.35);
}

.danger-button-soft:hover {
  background: rgba(198, 40, 40, 0.08);
}

.repository-archive-section {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(123, 31, 162, 0.3);
}

.repository-archive-toggle-row {
  margin-top: 6px;
  display: flex;
}

.repository-archive-toggle-button {
  min-height: 0;
}

.repository-archive-header {
  font-size: 0.78em;
  font-weight: 700;
  color: #7b1fa2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.repo-ver-edit-form {
  width: 100%;
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  padding: 8px;
  background: rgba(25, 118, 210, 0.04);
  border: 1px solid rgba(25, 118, 210, 0.18);
  border-radius: 6px;
}

.repo-ver-edit-label {
  font-size: 0.8em;
  color: #555;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.repo-ver-edit-label .auth-form-input {
  font-size: 1em;
  padding: 4px 7px;
}

.repo-ver-edit-label textarea.auth-form-input {
  resize: vertical;
  min-height: 48px;
}

.repo-ver-edit-actions {
  display: flex;
  gap: 6px;
}

.repo-ver-desc-panel,
.repo-ver-note-panel {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--text-secondary, #555);
  white-space: pre-wrap;
  word-break: break-word;
}

.repo-ver-desc-panel { border-left: 3px solid var(--accent, #1976d2); }
.repo-ver-note-panel { border-left: 3px solid #43a047; }


.repo-full-archive-content {
  padding: 12px 0;
  overflow-y: auto;
  max-height: calc(80vh - 100px);
}

.repo-full-archive-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.repo-full-archive-repo {
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  overflow: hidden;
}

.repo-full-archive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary, #f5f5f5);
  border-bottom: 1px solid var(--border-color, #ddd);
}

.repo-full-archive-name {
  font-weight: 600;
  font-size: 0.95em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-full-archive-actions {
  flex-shrink: 0;
}

.repo-full-archive-versions {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Permanent delete confirmation overlay */
.repo-perm-del-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.repo-perm-del-overlay[hidden] {
  display: none;
}

.repo-upload-desc-modal {
  max-width: 480px !important;
}

.repo-upload-desc-textarea {
  width: 100%;
  resize: vertical;
  min-height: 80px;
  font-size: 0.9em;
  box-sizing: border-box;
}

.repo-upload-desc-counter {
  font-size: 0.78em;
  color: var(--text-secondary, #777);
  text-align: right;
  margin-top: -8px;
}

.repo-perm-del-modal {
  background: var(--bg-primary, #fff);
  border-radius: 8px;
  padding: 24px 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.repo-perm-del-modal h3 {
  margin: 0;
  font-size: 1.05em;
  color: var(--danger, #c62828);
}

.repo-perm-del-desc {
  margin: 0;
  font-size: 0.9em;
  color: var(--text-secondary, #555);
}

.repo-perm-del-code-row {
  margin: 0;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.repo-perm-del-code {
  font-family: monospace;
  font-size: 1.4em;
  letter-spacing: 0.15em;
  color: var(--danger, #c62828);
  padding: 2px 8px;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 4px;
}

.repo-perm-del-input {
  font-family: monospace;
  font-size: 1.2em;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
}

.repo-perm-del-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.repo-perm-del-confirm-btn {
  background: var(--danger, #c62828);
  color: #fff;
  border: none;
}

.repo-perm-del-confirm-btn:not(:disabled):hover {
  background: #b71c1c;
}

.repo-upload-confirm-modal {
  max-width: 480px;
}

.repo-upload-confirm-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(25, 42, 63, 0.04);
  border: 1px solid rgba(25, 42, 63, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
}

.company-member-permissions-modal h3 {
  color: var(--text);
}

.company-member-permissions-option {
  width: fit-content;
}

.company-member-permissions-hint {
  margin: 0;
}

.repo-upload-confirm-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.repo-upload-confirm-info-label {
  font-size: 0.8em;
  color: var(--text-secondary, #666);
  min-width: 100px;
  flex-shrink: 0;
}

#repoUploadConfirmBtn {
  background: var(--primary, #0d7aad);
  color: #fff;
  border: none;
}

#repoUploadConfirmBtn:not(:disabled):hover {
  background: var(--primary-dark, #0a5f87);
}

.repository-diagram-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.repository-diagram-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.repository-diagram-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repository-diagram-meta {
  font-size: 0.85em;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.repository-diagram-version {
  font-weight: 600;
  color: #1976d2;
  white-space: nowrap;
}

.repository-diagram-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.repository-diagram-actions .secondary-button {
  padding: 7px 9px;
  min-height: 0;
  font-size: inherit;
}

/* Global table baseline: every table in the app should size columns from content first. */
.table-default,
table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto !important;
  font-size: 11px;
  color: var(--text);
  background: var(--table-surface);
  border: 1px solid var(--table-border-strong);
  border-radius: 14px;
  box-shadow: var(--table-shadow);
  overflow: hidden;
}

.table-default th,
.table-default td,
table th,
table td {
  min-width: 0;
  padding: 10px 12px;
}

.table-default caption,
table caption {
  caption-side: top;
  padding: 0 0 10px;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.table-default thead th,
table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--table-head-bg);
  color: #4d6279;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--table-head-border);
  font-size: 9px;
  line-height: 1.25;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.table-default thead th:first-child,
table thead th:first-child {
  border-top-left-radius: 14px;
}

.table-default thead th:last-child,
table thead th:last-child {
  border-top-right-radius: 14px;
}

.table-default tbody td,
table tbody td {
  font-size: 11px;
  line-height: 1.45;
  border-bottom: 1px solid var(--table-border);
  vertical-align: middle;
  background: transparent;
}

.table-default tbody tr,
table tbody tr {
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.table-default tbody tr:nth-child(even),
table tbody tr:nth-child(even) {
  background: var(--table-stripe);
}

.table-default tbody select:not([multiple]),
table tbody select:not([multiple]) {
  display: inline-block;
  width: fit-content;
  max-width: max-content;
  min-width: 0;
  min-height: 14px;
  padding: 0 12px 0 5px;
  border: 1px solid var(--table-border-strong);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  vertical-align: middle;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 7px) 50%,
    calc(100% - 3px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

.table-default tbody select:not([multiple]):focus,
table tbody select:not([multiple]):focus {
  border-color: color-mix(in srgb, var(--primary) 62%, white);
  box-shadow: 0 0 0 3px rgba(36, 99, 200, 0.12);
  outline: none;
}

.table-default tbody select:not([multiple]):disabled,
table tbody select:not([multiple]):disabled {
  opacity: 0.78;
  cursor: not-allowed;
}

.table-default tbody tr:hover,
table tbody tr:hover {
  background: var(--table-hover);
}

.table-default tbody tr:hover td,
table tbody tr:hover td {
  background: transparent;
}

.table-default tbody tr:last-child td,
table tbody tr:last-child td {
  border-bottom: none;
}

.table-default tbody tr:last-child td:first-child,
table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 14px;
}

.table-default tbody tr:last-child td:last-child,
table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 14px;
}

.repo-process-history-modal {
  max-width: 760px;
}

.repo-process-history-content {
  max-height: min(55vh, 440px);
  overflow: auto;
}

.repo-process-history-table-wrap {
  overflow: auto;
}

.repo-process-description-modal {
  max-width: 620px;
}

.repo-process-description-content {
  max-height: min(45vh, 360px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.repo-process-description-body {
  font-size: 0.92em;
  line-height: 1.45;
  color: var(--text, #1f2b3a);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(255, 255, 255, 0.75);
}

.repo-process-description-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.repo-process-desc-edit-textarea {
  width: 100%;
  resize: vertical;
  min-height: 130px;
  box-sizing: border-box;
}

.repo-diff-versions-row,
.repo-audit-version-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.repo-diff-content,
.repo-audit-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 0;
}

.database-modal-switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  flex: 0 0 auto;
}

.database-description-input {
  resize: none;
  min-height: 220px;
  flex: 1 1 auto;
}

#databaseSaveForm.auth-form {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  overflow: hidden;
}

.database-save-current-id {
  margin: 0;
  padding: 6px 10px;
  background: rgba(25, 160, 150, 0.08);
  border: 1px solid rgba(25, 160, 150, 0.25);
  border-radius: 7px;
  font-size: 11px;
  color: var(--muted);
  flex: 1;
}

.database-status-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.database-status-row .auth-inline-status {
  flex: 1;
}

.database-status-row .auth-inline-status[hidden],
.database-status-row .database-save-current-id[hidden] {
  display: none;
}

#databaseSaveForm .database-description-field {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  overflow: hidden;
}

#databaseSaveForm .database-description-field .auth-form-label {
  margin-top: 2px;
}

#databaseSaveForm .database-save-actions {
  margin-top: 0;
  flex: 0 0 auto;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
}

.diagram-save-hint {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}
.diagram-save-hint-icon {
  color: var(--primary);
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}
.diagram-save-hint-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.diagram-save-hint-tip {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  transition: opacity 0.35s ease;
}
.diagram-save-hint-tip.is-fading {
  opacity: 0;
}
.diagram-save-hint-fixed {
  font-size: 11px;
  color: var(--primary-strong);
  font-weight: 600;
  line-height: 1.4;
}

#databaseSaveForm .database-description-input {
  min-height: 0;
  flex: 1 1 auto;
  width: 100%;
  align-self: stretch;
}

/* Company panel: inline company name input + save button */
.company-modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.company-edit-name-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex: 0 0 auto;
}

.company-edit-name-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.company-update-name-form {
  margin-bottom: 16px;
}

.company-name-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.company-name-row .auth-form-input {
  flex: 1 1 320px;
  margin-top: 0;
}

.company-name-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.company-name-actions .auth-submit-button {
  margin-top: 0;
}

/* Company invite token row with copy button */
.company-invite-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  flex-wrap: wrap;
}
.company-invite-value {
  font-family: monospace;
  background: rgba(255,255,255,0.6);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(25,42,63,0.06);
}

/* ═══════════════════════════════════════════
   LLM User Panel
   ═══════════════════════════════════════════ */

.llm-user-overlay {
  z-index: 94;
}

.llm-user-modal {
  width: min(760px, calc(100vw - 24px));
  height: min(680px, calc(100vh - 24px));
  border-radius: 18px;
  border: 1px solid rgba(25, 42, 63, 0.13);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(244,250,255,0.97) 100%);
  box-shadow:
    0 2px 0 rgba(14,138,168,0.10) inset,
    0 32px 80px rgba(15,30,47,0.26),
    0 2px 8px rgba(14,138,168,0.08);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Nagłówek */
.llm-user-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(25, 42, 63, 0.08);
  background: linear-gradient(135deg, rgba(14,138,168,0.05), rgba(82,125,98,0.04));
  flex-shrink: 0;
}

.llm-user-header-text {
  min-width: 0;
}

.llm-user-title {
  margin: 0 0 3px 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text);
  line-height: 1.2;
}

.llm-user-subtitle {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.llm-user-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(25,42,63,0.13);
  background: rgba(255,255,255,0.7);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.llm-user-close-btn:hover {
  background: rgba(207,67,67,0.08);
  color: var(--danger);
  border-color: rgba(207,67,67,0.22);
}

/* Sekcja pola opisu */
.llm-user-field {
  padding: 14px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.llm-user-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.llm-user-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.llm-user-field-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.llm-user-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px 0 6px;
  border-radius: 6px;
  border: 1px solid rgba(25,42,63,0.13);
  background: rgba(255,255,255,0.8);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.llm-user-tool-btn i {
  font-size: 13px;
}

.llm-user-tool-btn:hover {
  background: rgba(14,138,168,0.07);
  color: var(--primary);
  border-color: rgba(14,138,168,0.25);
}

.llm-user-info-toggle[aria-expanded="true"] {
  background: rgba(14,138,168,0.10);
  color: var(--primary-strong);
  border-color: rgba(14,138,168,0.30);
}

/* Wspólny pojemnik — textarea i wskazówki nigdy nie są obok siebie */
.llm-user-content-area {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.llm-user-desc-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Textarea */
.llm-user-textarea {
  width: 100%;
  flex: 1 1 auto;
  min-height: 160px;
  max-height: 38vh;
  resize: vertical;
  border: 1px solid rgba(25,42,63,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.9);
  padding: 10px 12px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.llm-user-textarea:focus {
  border-color: rgba(14,138,168,0.45);
  box-shadow: 0 0 0 3px rgba(14,138,168,0.08);
}

.llm-user-textarea::placeholder {
  color: rgba(92,111,134,0.55);
}

/* Licznik */
.llm-user-counter-bar {
  display: flex;
  justify-content: flex-end;
  padding: 3px 2px 8px;
  flex-shrink: 0;
}

.llm-user-counter {
  font-size: 10.5px;
  color: rgba(92,111,134,0.65);
  font-variant-numeric: tabular-nums;
  transition: color 0.15s;
}

.llm-user-counter.is-near-limit { color: #b45309; }
.llm-user-counter.is-at-limit   { color: #8e1f1f; font-weight: 700; }

/* Panel wskazówek — zastępuje textarea, nie pcha układu */
.llm-user-hints {
  flex: 1 1 auto;
  overflow-y: auto;
  border: 1px solid rgba(14,138,168,0.15);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(245,251,255,0.98) 0%, rgba(240,248,255,0.96) 100%);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.llm-user-hints-intro {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
  padding: 8px 10px;
  background: rgba(14,138,168,0.05);
  border-radius: 7px;
  border-left: 3px solid rgba(14,138,168,0.35);
  flex-shrink: 0;
}

.llm-user-hints-intro strong {
  color: var(--text);
}

.llm-user-hints-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.llm-user-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(25,42,63,0.07);
  border-radius: 8px;
  padding: 9px 10px;
}

.llm-user-hint-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(14,138,168,0.10);
  color: var(--primary);
  font-size: 15px;
  flex-shrink: 0;
}

.llm-user-hint-body {
  min-width: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.llm-user-hint-body strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.llm-user-hint-body p {
  margin: 0 0 3px 0;
}

.llm-user-hint-body em {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  color: rgba(92,111,134,0.75);
  border-top: 1px solid rgba(25,42,63,0.06);
  margin-top: 4px;
  padding-top: 3px;
}

/* Stopka */
.llm-user-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(25,42,63,0.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  background: rgba(247,251,255,0.7);
}

.llm-user-footer-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.llm-user-model-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
}

.llm-user-footer-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.llm-user-model-select {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  border: 1px solid rgba(25,42,63,0.14);
  border-radius: 7px;
  background: rgba(255,255,255,0.9);
  color: var(--text);
  font-size: 12px;
  padding: 0 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.llm-user-model-select:focus {
  border-color: rgba(14,138,168,0.40);
}

.llm-user-tokens-info {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.llm-user-tokens-info.is-success { color: #0d6b46; }
.llm-user-tokens-info.is-error   { color: #8e1f1f; }

.llm-user-history-btn {
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(25,42,63,0.14);
  background: rgba(255,255,255,0.92);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.llm-user-history-btn:hover {
  border-color: rgba(14,138,168,0.3);
  color: var(--primary);
  background: rgba(14,138,168,0.06);
}

/* Status inline */
.llm-user-inline-status {
  margin: 0;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid transparent;
}

.llm-user-inline-status.is-success {
  border-color: rgba(47,111,80,0.24);
  background: rgba(231,248,243,0.96);
  color: var(--success);
}

.llm-user-inline-status.is-error {
  border-color: rgba(207,67,67,0.22);
  background: rgba(255,235,235,0.96);
  color: var(--danger-strong);
}

.llm-user-inline-status.is-warning {
  border-color: rgba(176,116,28,0.26);
  background: rgba(255,244,224,0.96);
  color: #7a4b0d;
}

/* Zastrzeżenie pod statusem */
.llm-user-disclaimer {
  margin: 0 0 8px;
  font-size: 0.7rem;
  color: #888;
  line-height: 1.4;
  text-align: center;
}

/* Przycisk generowania */
.llm-user-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.1px;
  transition: opacity 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(14,138,168,0.30);
}

.llm-user-submit-btn i {
  font-size: 15px;
}

.llm-user-submit-btn:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 4px 14px rgba(14,138,168,0.38);
}

.llm-user-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.llm-history-modal {
  width: min(880px, calc(100vw - 24px));
  max-height: min(700px, calc(100vh - 24px));
  border-radius: 18px;
  border: 1px solid rgba(25,42,63,0.13);
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(244,250,255,0.97) 100%);
  box-shadow: 0 32px 80px rgba(15,30,47,0.26), 0 2px 8px rgba(14,138,168,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.llm-history-body {
  padding: 12px 16px 16px;
  min-height: 0;
  overflow: auto;
}

.llm-history-list {
  display: grid;
  gap: 10px;
}

.llm-history-entry {
  border: 1px solid rgba(25,42,63,0.12);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.9);
  display: grid;
  gap: 8px;
}

.llm-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--muted);
}

.llm-history-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

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

.database-save-actions {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
}

.database-open-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.database-open-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.company-panel-actions {
  margin-top: 10px;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.company-panel-actions .secondary-button {
  white-space: nowrap;
  flex: 0 0 auto;
}

.company-members-table-shell {
  border: 1px solid rgba(25, 42, 63, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 320px;
}

.company-members-table {
  width: 100%;
}

.company-members-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.company-members-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.company-members-actions .secondary-button:not(.table-action-button),
.company-members-actions .danger-button:not(.table-action-button) {
  white-space: normal;
}

#companyPanel .auth-submit-button {
  min-height: 0;
}

.database-diagrams-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 8px;
  overflow: auto;
}

.database-diagram-item {
  display: grid;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(255, 255, 255, 0.88);
}

.database-diagram-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.database-diagram-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.database-diagram-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: none;
}

.database-diagram-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
}

.database-diagram-editing-label {
  color: rgb(180, 100, 10);
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
  white-space: nowrap;
}

.database-diagram-access-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
  flex-shrink: 0;
  cursor: default;
}

.database-diagram-access-icon--owner {
  background: rgba(34, 170, 100, 0.15);
  color: rgb(22, 130, 70);
  border: 1px solid rgba(34, 170, 100, 0.35);
}

.database-diagram-access-icon--edit {
  background: rgba(234, 179, 8, 0.13);
  color: rgb(161, 118, 0);
  border: 1px solid rgba(234, 179, 8, 0.45);
}

.database-diagram-access-icon--view {
  background: rgba(220, 140, 30, 0.12);
  color: rgb(180, 100, 10);
  border: 1px solid rgba(220, 140, 30, 0.35);
}

.database-share-button--active {
  background: rgba(34, 170, 100, 0.12);
  color: rgb(22, 130, 70);
  border: 1px solid rgba(34, 170, 100, 0.35);
}

.database-share-button--active:hover {
  background: rgba(34, 170, 100, 0.2);
  border-color: rgba(34, 170, 100, 0.55);
}

.database-diagram-meta {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.3;
}

#databaseOpenPanel .database-diagram-item {
  padding: 6px 9px;
  border-radius: 8px;
}

#databaseOpenPanel .database-diagram-name {
  font-size: 10px;
}

#databaseOpenPanel .database-diagram-meta {
  font-size: 9px;
}


.database-description-editor {
  margin-top: 4px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(25, 42, 63, 0.03);
  display: grid;
  gap: 6px;
}

.database-description-editor-input {
  width: 100%;
  resize: vertical;
  min-height: 70px;
  font-size: 10px;
  box-sizing: border-box;
}

.database-description-editor-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.database-description-editor-actions .secondary-button,
.database-description-editor-actions .primary-button {
  min-height: 0;
  padding: 7px 9px;
  font-size: inherit;
}

.database-repository-version-row .secondary-button,
.database-repository-version-row .danger-button {
  min-height: 0;
  padding: 7px 9px;
  font-size: inherit;
}

:is(#databasePanel, #databaseOpenPanel) .database-repository-version-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(25, 42, 63, 0.10);
}

:is(#databasePanel, #databaseOpenPanel) .database-repository-version-row:first-child {
  border-top: none;
  padding-top: 2px;
}

:is(#databasePanel, #databaseOpenPanel) .database-repository-version-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 300px;
  min-width: 200px;
  flex-wrap: wrap;
}

:is(#databasePanel, #databaseOpenPanel) .database-repository-version-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}

:is(#databasePanel, #databaseOpenPanel) .database-repository-version-actions-row {
  display: flex;
  gap: 4px;
  align-items: stretch;
  width: 100%;
}

:is(#databasePanel, #databaseOpenPanel) .database-repository-version-actions-row .table-action-button {
  flex: 1;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
}

:is(#databasePanel, #databaseOpenPanel) .database-repository-version-row .secondary-button,
:is(#databasePanel, #databaseOpenPanel) .database-repository-version-row .danger-button {
  min-height: 0;
  padding: 7px 9px;
  font-size: inherit;
  line-height: inherit;
  white-space: nowrap;
}

:is(#databasePanel, #databaseOpenPanel) .database-repository-version-row .database-repository-version-label,
:is(#databasePanel, #databaseOpenPanel) .database-repository-version-row .database-repository-version-name {
  font-size: 9px;
  line-height: 1.2;
}

:is(#databasePanel, #databaseOpenPanel) .database-repository-version-row .database-repository-version-label {
  margin-right: 10px;
}

:is(#databasePanel, #databaseOpenPanel) .database-repository-version-row .database-repository-version-name {
  margin-left: 6px;
  margin-right: 4px;
}

:is(#databasePanel, #databaseOpenPanel) .database-repository-version-row .database-repository-version-meta-label,
:is(#databasePanel, #databaseOpenPanel) .database-repository-version-row .database-repository-hash-label {
  margin-left: 2px;
}

.database-delete-confirm {
  margin-top: 2px;
  border-radius: 9px;
  border: 1px solid rgba(207, 67, 67, 0.22);
  background: rgba(255, 239, 239, 0.78);
  padding: 4px;
  display: grid;
  gap: 4px;
}

.database-delete-confirm-message {
  margin: 0;
  font-size: 11px;
  color: var(--danger-strong);
  font-weight: 600;
}

.database-delete-confirm-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}

.database-delete-confirm-actions select,
.database-delete-confirm-actions input {
  padding: 4px 6px;
  font-size: 10px;
  min-height: 26px;
  flex: 1;
  min-width: 0;
}

.database-delete-confirm-actions button {
  padding: 4px 10px;
  font-size: 10px;
  min-height: 26px;
  flex-shrink: 0;
}

.database-share-permissions-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.database-share-permission-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 10px;
}

.database-share-permission-user {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.database-share-permission-value {
  padding: 2px 4px;
  background: rgba(25, 42, 63, 0.1);
  border-radius: 3px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  flex-shrink: 0;
}

.database-share-permission-row .danger-button {
  padding: 2px 6px;
  font-size: 9px;
  min-height: 20px;
  flex-shrink: 0;
}

.database-share-add-button-container {
  display: flex;
  justify-content: center;
  padding: 2px 0;
}

.database-share-add-button-container button {
  padding: 4px 10px;
  font-size: 10px;
  min-height: 26px;
}

.database-share-permission-editor {
  border-top: 1px solid rgba(207, 67, 67, 0.1);
  padding-top: 4px;
  margin-top: 4px;
}

.database-share-permission-editor[hidden] {
  display: none;
}

.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 1005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(14, 27, 41, 0.42);
  backdrop-filter: blur(4px);
}

#adminCompanyAdminsDialog {
  z-index: 1012;
}

#adminCompanyAdminsDialog .admin-company-admins-modal {
  position: relative;
  z-index: 1;
}

#logsOverlay.admin-overlay,
#logsDetailsOverlay.admin-overlay {
  align-items: flex-start;
  padding-top: 12px;
}

.admin-overlay[hidden] {
  display: none;
}

.admin-modal {
  width: min(560px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 32px));
  border-radius: 16px;
  border: 1px solid rgba(25, 42, 63, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 251, 255, 0.96)),
    linear-gradient(135deg, rgba(36, 99, 200, 0.06), rgba(58, 104, 176, 0.08));
  box-shadow: 0 26px 70px rgba(15, 30, 47, 0.28);
  padding: 16px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
}

.admin-users-modal {
  width: min(1220px, calc(100vw - 28px));
  height: min(820px, calc(100vh - 32px));
  max-height: min(820px, calc(100vh - 32px));
  grid-template-rows: auto auto minmax(0, 1fr);
}

.admin-company-admins-modal {
  width: min(1040px, calc(100vw - 28px));
  height: min(760px, calc(100vh - 32px));
  max-height: min(760px, calc(100vh - 32px));
  grid-template-rows: auto auto minmax(0, 1fr);
}

.admin-users-modal .admin-modal-header {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.admin-users-modal .admin-modal-title,
.admin-users-modal .admin-modal-description {
  display: none;
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-modal-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.admin-close-button {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
}

.admin-modal-description {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.admin-modal-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-overlay .secondary-button,
.admin-overlay .primary-button,
.admin-overlay .danger-button {
  border: 1px solid rgba(25, 42, 63, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  box-shadow: none;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transition: background 120ms, border-color 120ms, color 120ms;
}

.admin-overlay .secondary-button:hover:not(:disabled),
.admin-overlay .primary-button:hover:not(:disabled),
.admin-overlay .danger-button:hover:not(:disabled) {
  background: rgba(36, 99, 200, 0.07);
  border-color: rgba(36, 99, 200, 0.3);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.admin-overlay .primary-button {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.admin-overlay .primary-button:hover:not(:disabled) {
  background: var(--primary-strong);
  color: #fff;
  border-color: var(--primary-strong);
}

.admin-modal-tab,
.admin-modal-tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(25, 42, 63, 0.16);
  background: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.admin-modal-tab:hover,
.admin-modal-tab-button:hover {
  border-color: rgba(36, 99, 200, 0.3);
  background: rgba(236, 246, 255, 0.92);
}

.admin-modal-tab.is-active,
.admin-modal-tab-button.is-active {
  border-color: rgba(36, 99, 200, 0.42);
  background: rgba(229, 246, 250, 0.92);
  color: var(--text);
}

.admin-modal-scroll-content {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.admin-modal-tab-panel[hidden] {
  display: none;
}

.admin-data-section {
  display: grid;
  gap: 6px;
  min-height: 0;
  height: 100%;
}

.admin-data-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.admin-users-list-modal {
  max-height: 100%;
}

.admin-users-table-shell {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.admin-company-admins-modal .company-members-table-shell {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.admin-users-table-scroll {
  height: 100%;
  max-height: none;
  overflow: auto;
  border: 1px solid rgba(25, 42, 63, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
}

.admin-users-table-scroll--users {
  overflow-x: auto;
}

.admin-users-table-scroll--legal-events {
  overflow-x: hidden;
}

.admin-users-table-scroll--companies {
  overflow-x: hidden;
}

.admin-users-table-note {
  margin: 8px 0;
}

.admin-users-table {
  width: 100%;
}

.admin-user-username-cell {
  display: grid;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  white-space: nowrap;
}

.admin-user-username-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.admin-user-role-cell {
  display: grid;
  gap: 4px;
  justify-items: start;
  min-width: 0;
}

.admin-user-role-badges {
  display: grid;
  gap: 2px;
  justify-items: start;
}

.admin-user-username-cell .action-badge {
  white-space: nowrap;
}

.admin-user-force-password-button {
  border: none;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.admin-user-force-password-button:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.admin-user-force-password-button:focus-visible {
  outline: 2px solid rgba(36, 99, 200, 0.35);
  outline-offset: 1px;
}

.admin-user-force-password-button.error-badge {
  background: rgba(220, 53, 69, 0.12);
  color: var(--danger-strong);
}

.admin-user-force-password-button.muted-badge {
  background: rgba(43, 109, 178, 0.08);
  color: var(--muted);
}

.admin-user-username-label {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.admin-user-email-line {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-sort-button,
.admin-users-sort-button,
.repository-audit-sort-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  max-width: none;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(25, 42, 63, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 30, 47, 0.04);
}

.table-sort-button:hover,
.admin-users-sort-button:hover,
.repository-audit-sort-button:hover {
  border-color: rgba(36, 99, 200, 0.28);
  background: linear-gradient(180deg, rgba(251, 253, 255, 0.98), rgba(237, 246, 255, 0.98));
  color: var(--text);
}

.table-sort-button.is-active,
.admin-users-sort-button.is-active,
.repository-audit-sort-button.is-active {
  border-color: rgba(36, 99, 200, 0.36);
  background: linear-gradient(180deg, rgba(231, 246, 250, 0.98), rgba(221, 243, 248, 0.98));
  color: var(--text);
}

.table-sort-button-label,
.admin-users-sort-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-sort-button-indicator,
.admin-users-sort-indicator {
  flex: 0 0 auto;
  font-size: 8px;
  line-height: 1;
  opacity: 0.72;
}

.table-default tbody td.table-actions-row,
.table-default tbody td .table-actions-row {
  display: inline-grid;
  grid-template-rows: repeat(3, max-content);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 4px 6px;
  align-items: start;
  justify-content: start;
  width: fit-content;
  max-width: 100%;
}

.table-default tbody td.table-actions-row > *,
.table-default tbody td .table-actions-row > * {
  justify-self: stretch;
  width: 100%;
}

.admin-users-table--company-members .company-members-actions {
  gap: 4px;
  flex-direction: column;
  align-items: stretch;
}

.admin-users-table--company-members .company-members-actions .secondary-button:not(.table-action-button),
.admin-users-table--company-members .company-members-actions .danger-button:not(.table-action-button) {
  min-height: 24px;
  padding: 0 6px;
  font-size: 9px;
  white-space: nowrap;
}

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

.admin-companies-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.admin-companies-form-row .auth-form-input {
  width: 100%;
}

.admin-companies-form-row .auth-submit-button {
  white-space: nowrap;
}

.admin-companies-create-button {
  width: 100%;
  justify-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin-top: 0;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(25, 42, 63, 0.14);
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(241, 247, 255, 0.98) 100%);
  box-shadow: 0 2px 8px rgba(25, 42, 63, 0.06);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.admin-companies-panel-body {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
}

.admin-companies-panel-body .admin-users-table-shell {
  min-height: 0;
  height: 100%;
}

.admin-company-create-modal {
  width: min(620px, calc(100vw - 32px));
}

.admin-company-create-form {
  display: grid;
  gap: 10px;
}

.admin-company-create-form .auth-form-input {
  width: 100%;
}

.admin-company-create-actions {
  justify-content: flex-end;
}

.admin-users-context-label {
  margin: 0;
  margin-right: auto;
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
  font-weight: 700;
  flex: 1 1 auto;
  min-width: 0;
}

.collab-modal {
  width: min(980px, calc(100vw - 28px));
  height: min(860px, calc(100vh - 32px));
  max-height: min(860px, calc(100vh - 32px));
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.collab-modal .admin-modal-header {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.collab-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}

.collab-content {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(310px, 410px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  overflow: hidden;
}

.collab-sidebar {
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  height: 100%;
}

.collab-main-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.collab-panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

#collabOverlay .collab-panel-tab-button {
  border: 1px solid rgba(25, 42, 63, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  box-shadow: none;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

#collabOverlay .collab-panel-tab-button.is-active {
  background: rgba(36, 99, 200, 0.12);
  border-color: rgba(36, 99, 200, 0.32);
  color: var(--text);
}

#collabOverlay .collab-panel-tab-button:hover:not(:disabled) {
  background: rgba(36, 99, 200, 0.08);
}

.collab-panel-body {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.collab-panel-body[hidden] {
  display: none !important;
}

#collabOverlay .secondary-button,
#collabOverlay .primary-button {
  border: 1px solid rgba(25, 42, 63, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  box-shadow: none;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transition: background 120ms, border-color 120ms, color 120ms;
}

#collabOverlay .secondary-button:hover:not(:disabled),
#collabOverlay .primary-button:hover:not(:disabled) {
  background: rgba(36, 99, 200, 0.07);
  border-color: rgba(36, 99, 200, 0.3);
  color: var(--text);
}

.collab-status-banner {
  min-height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(25, 42, 63, 0.14);
  background: rgba(245, 249, 255, 0.9);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  display: flex;
  align-items: center;
}

.collab-status-banner.is-success {
  border-color: rgba(48, 145, 74, 0.28);
  background: rgba(235, 249, 239, 0.95);
  color: var(--success-strong);
}

.collab-status-banner.is-warning {
  border-color: rgba(224, 160, 36, 0.28);
  background: rgba(255, 247, 228, 0.95);
  color: #8b5a00;
}

.collab-status-banner.is-error {
  border-color: rgba(207, 67, 67, 0.28);
  background: rgba(255, 239, 239, 0.95);
  color: var(--danger-strong);
}

.collab-status-banner.is-info {
  border-color: rgba(36, 99, 200, 0.22);
  background: rgba(234, 247, 250, 0.95);
}

.collab-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.collab-stat-card {
  border-radius: 6px;
  border: 1px solid rgba(25, 42, 63, 0.14);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 3px 5px;
  display: grid;
  gap: 1px;
  min-height: 0;
  cursor: help;
}

.collab-stat-label {
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 1.03;
}

.collab-stat-value {
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--text);
  word-break: break-word;
}

.collab-chart-card {
  min-height: 0;
  display: grid;
  gap: 4px;
  padding: 7px;
  border-radius: 10px;
  border: 1px solid rgba(25, 42, 63, 0.14);
  background: rgba(248, 251, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.collab-chart-header {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.collab-chart-copy {
  display: grid;
  gap: 2px;
}

.collab-chart-kicker {
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.collab-chart-title {
  color: var(--text);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
}

.collab-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  justify-items: end;
  justify-content: flex-end;
}

.collab-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 7px;
  color: var(--muted);
  white-space: nowrap;
}

.collab-chart-legend-swatch {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.collab-chart-legend-label {
  color: var(--muted);
}

.collab-chart-legend-value {
  color: var(--text);
  font-weight: 800;
}

.collab-history-chart-shell {
  position: relative;
  height: clamp(100px, 16vw, 200px);
  min-height: 80px;
  max-height: 200px;
  overflow: hidden;
}

.collab-history-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.collab-history-empty-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.collab-chart-footnote {
  color: var(--muted);
  font-size: 7px;
  line-height: 1.2;
}

.collab-room-ranking-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.collab-room-ranking-copy {
  display: grid;
  gap: 2px;
}

.collab-room-ranking-kicker {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.collab-room-ranking-title {
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.collab-room-ranking-list {
  min-height: 0;
  flex: 1;
  display: grid;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

.collab-room-ranking-panel {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(25, 42, 63, 0.14);
  background: rgba(248, 251, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.collab-room-entry {
  display: grid;
  gap: 4px;
  border-radius: 10px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(255, 255, 255, 0.92);
  padding: 8px;
}

.collab-room-entry-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.collab-room-entry-room {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.collab-room-entry-name {
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  word-break: break-word;
}

.collab-room-entry-meta {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
}

.collab-room-entry-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.collab-room-entry-badge {
  border-radius: 999px;
  background: rgba(36, 99, 200, 0.08);
  border: 1px solid rgba(36, 99, 200, 0.16);
  color: #0f5062;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 7px;
  white-space: nowrap;
  cursor: help;
}

.collab-room-entry-badge.is-latency {
  background: rgba(224, 160, 36, 0.10);
  border-color: rgba(224, 160, 36, 0.18);
  color: #7a4e00;
}

.collab-room-entry-badge.is-muted {
  background: rgba(25, 42, 63, 0.05);
  border-color: rgba(25, 42, 63, 0.08);
  color: var(--muted);
}

.collab-room-entry-bar {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(25, 42, 63, 0.08);
}

.collab-room-entry-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(36, 99, 200, 0.72), rgba(224, 160, 36, 0.82));
}

.collab-log-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(25, 42, 63, 0.14);
  background: rgba(248, 251, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.collab-log-content {
  min-height: 0;
  flex: 1;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(25, 42, 63, 0.14);
  background: #07131f;
  color: #d8f3ff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  .collab-modal {
    width: min(100vw - 20px, 980px);
    height: min(100vh - 24px, 860px);
  }

  .collab-content {
    grid-template-columns: 1fr;
  }

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

  .collab-main-panel {
    min-height: 360px;
  }
}

/* ── Logs modal ─────────────────────────────────────────────── */
.logs-modal {
  width: min(1220px, calc(100vw - 24px));
  height: min(780px, calc(100vh - 32px));
  max-height: min(780px, calc(100vh - 32px));
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
  padding-top: 10px;
  gap: 8px;
}

.logs-modal #logsCount {
  display: none;
}

.logs-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.logs-filter-select,
.logs-filter-input {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.8);
  font-size: 11px;
  color: var(--fg);
  outline: none;
}

.logs-filter-select:focus,
.logs-filter-input:focus {
  border-color: var(--accent);
}

.logs-filter-input {
  flex: 1;
  min-width: 100px;
}

.logs-filter-date {
  flex: 0 0 auto;
  width: 130px;
}

.logs-date-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.logs-date-range-separator {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.logs-table-wrapper {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 0;
  max-height: 100%;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}

.ip-blacklist-modal {
  width: min(900px, calc(100vw - 28px));
  height: min(680px, calc(100vh - 32px));
  max-height: min(680px, calc(100vh - 32px));
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.ip-blacklist-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ip-blacklist-toolbar-actions {
  display: flex;
  gap: 6px;
}

.ip-blacklist-info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}

.ip-blacklist-stats-text {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.ip-blacklist-tab-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

.ip-blacklist-add-form {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.ip-blacklist-add-ip {
  flex: 1 1 150px;
  min-width: 130px;
}

.ip-blacklist-add-reason {
  flex: 1 1 120px;
  min-width: 100px;
}

.ip-blacklist-add-expires {
  flex: 0 1 160px;
  min-width: 130px;
}

.ip-list-empty {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.system-metrics-panel-wrapper {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: min(62vh, 720px);
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}

.system-metrics-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.system-metrics-summary {
  margin: 0;
  flex: 1 1 260px;
  min-width: 0;
}

.system-metrics-refresh-button {
  flex: 0 0 auto;
}

.system-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  grid-auto-rows: 8px;
  grid-auto-flow: row dense;
  align-items: start;
}

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

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

.system-metrics-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(15, 30, 47, 0.06);
  padding: 10px 11px;
  display: grid;
  gap: 8px;
  align-self: start;
}

.system-metrics-card-title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.system-metrics-card-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  align-content: start;
  justify-content: flex-start;
}

.system-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
  line-height: 1.22;
}

.system-metrics-service-list {
  display: grid;
  gap: 6px;
}

.system-metrics-service-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
  align-items: baseline;
  line-height: 1.22;
}

.system-metrics-service-address {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-family: monospace;
  line-height: 1.22;
  opacity: 0.8;
}

.system-metrics-service-detail {
  flex-basis: 100%;
  margin-left: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.22;
  font-weight: 600;
}

.system-metrics-label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.22;
  font-weight: 600;
}

.system-metrics-value {
  margin: 0;
  color: var(--fg);
  font-size: 10px;
  line-height: 1.22;
  font-weight: 700;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.system-metrics-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.logs-modal .admin-modal-tab-panel {
  min-height: 0;
  overflow: hidden;
}

.logs-table--llm tbody tr.logs-llm-row--success {
  background: rgba(224, 245, 231, 0.82);
}

.logs-table--llm tbody tr.logs-llm-row--success:hover {
  background: rgba(209, 239, 219, 0.96);
}

.logs-table--llm tbody tr.logs-llm-row--error {
  background: rgba(255, 232, 238, 0.88);
}

.logs-table--llm tbody tr.logs-llm-row--error:hover {
  background: rgba(255, 221, 230, 0.98);
}

.logs-level-INFO    { color: #1a7a3c; }
.logs-level-WARNING { color: #b06a00; }
.logs-level-ERROR   { color: #c0392b; }

.logs-datetime-cell {
  white-space: nowrap;
}

.logs-empty {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-family: inherit;
}

.logs-llm-summary {
  display: grid;
  gap: 2px;
}

.logs-llm-summary-meta {
  font-size: 8.5px;
  color: var(--muted);
}

.logs-llm-summary-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.logs-inline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  min-width: 0;
  padding: 0 5px;
  font-size: 7px;
  line-height: 1.1;
  border-radius: 999px;
  box-shadow: none;
}

.logs-table--llm td:nth-child(8),
.logs-table--llm td:nth-child(9),
.logs-llm-params-cell,
.logs-llm-actions-cell,
.logs-llm-text-cell {
  vertical-align: top !important;
  padding-top: 0 !important;
}

.logs-llm-text-cell {
  min-width: 170px;
}

.logs-llm-text-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.1;
}

.logs-llm-text-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.logs-llm-text-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.logs-llm-text-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  font-size: 7px;
  font-weight: 700;
  color: var(--text);
}

.logs-llm-params-cell {
  text-align: center;
  line-height: 0;
  min-width: 58px;
}

.logs-llm-params-cell .logs-inline-button {
  display: inline-flex;
  min-height: 18px;
  min-width: 44px;
  padding: 0 5px;
  font-size: 7px;
  line-height: 1.1;
  margin-top: 0;
}

.logs-llm-actions-cell {
  line-height: 0;
}

.logs-llm-actions-row {
  gap: 3px;
  white-space: normal;
}

.logs-llm-select-cell {
  width: 24px;
  text-align: center;
}

.logs-llm-select {
  cursor: pointer;
}

.logs-llm-actions-row .secondary-button,
.logs-llm-actions-row .danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 18px;
  padding: 0 5px;
  font-size: 7px;
  line-height: 1.1;
  border-radius: 999px;
  box-shadow: none;
}

.logs-preview-button {
  min-height: 18px;
  padding: 0 5px;
  font-size: 7px;
  line-height: 1.1;
}

.logs-delete-button {
  min-height: 18px;
  padding: 0 5px;
  font-size: 7px;
  line-height: 1.1;
}

.logs-error-button {
  min-height: 18px;
  padding: 0 5px;
  font-size: 7px;
  line-height: 1.1;
}

.logs-error-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.logs-details-modal {
  width: min(980px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 32px));
  grid-template-rows: auto minmax(0, 1fr);
}

.logs-details-content {
  margin: 0;
  min-height: 0;
  min-width: 0;       /* zapobiega rozjeżdżaniu grid item poza kontener */
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  padding: 12px;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: break-word;  /* standard — łamie długie tokeny bez spacji */
  word-break: break-word;     /* fallback dla starszych przeglądarek */
  scrollbar-width: thin;
}

.logs-status-success {
  color: #1a7a3c;
  font-weight: 700;
}

.logs-status-error {
  color: #c0392b;
  font-weight: 700;
}

.process-import-modal {
  width: min(760px, calc(100vw - 28px));
  grid-template-rows: auto auto auto auto;
}

.process-reference-modal {
  width: min(680px, calc(100vw - 28px));
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
}

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

/* ── About modal ────────────────────────────────────────────── */
.about-overlay {
  z-index: 94;
}

.about-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(680px, calc(100vw - 24px));
  max-height: min(820px, calc(100vh - 32px));
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel-strong);
  box-shadow: var(--shadow), 0 0 0 1px rgba(36, 99, 200, 0.14);
}

/* Hero */
.about-hero {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 18px 52px 18px 20px;
  background: linear-gradient(145deg, #17469a 0%, #2463c8 55%, #1fa8c4 100%);
  color: #fff;
  text-align: left;
}

.about-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.about-close-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.about-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 22px;
  backdrop-filter: blur(6px);
}

.about-hero-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.about-hero-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
}

.about-hero-sub {
  margin: 0;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 400;
}

.about-version-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  align-self: flex-start;
}

/* Body */
.about-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 24px 28px;
  overflow-y: auto;
}

/* Author card */
.about-author-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(36, 99, 200, 0.07) 0%, rgba(36, 99, 200, 0.03) 100%);
  border: 1px solid rgba(36, 99, 200, 0.14);
}

.about-author-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2463c8, #17469a);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.about-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.about-author-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.about-author-role {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* Section label */
.about-group-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

/* Features grid */
.about-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.about-feature-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 4px;
  padding: 13px 14px;
  border-radius: 11px;
  background: rgba(36, 99, 200, 0.04);
  border: 1px solid rgba(36, 99, 200, 0.11);
  transition: border-color 0.15s, background 0.15s;
}
.about-feature-card:hover {
  background: rgba(36, 99, 200, 0.09);
  border-color: rgba(36, 99, 200, 0.22);
}

.about-feature-icon {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 2px;
}

.about-feature-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.about-feature-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.about-feature-acronym {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.1px;
  margin-top: 1px;
}

.about-feature-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.about-feature-link:hover {
  text-decoration: underline;
}

/* Tech badges */
.about-tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.about-tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 30, 47, 0.06);
}
.about-tech-badge i {
  font-size: 13px;
  color: var(--primary);
}

/* Disclaimer */
.about-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(176, 116, 28, 0.22);
  background: rgba(255, 248, 230, 0.9);
  color: #7a4b0d;
  font-size: 11.5px;
  line-height: 1.5;
  font-weight: 500;
}
.about-disclaimer i {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
  color: #b8780f;
}

/* ── Legal consent banner + PDF modals ───────────────────── */
.app-shell.is-legal-consent-required {
  pointer-events: none;
  user-select: none;
}

.legal-consent-banner {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100vw - 24px);
  max-width: 800px;
  z-index: 140;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  row-gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(25, 42, 63, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.96)),
    linear-gradient(135deg, rgba(36, 99, 200, 0.08), rgba(58, 104, 176, 0.09));
  box-shadow: 0 16px 30px rgba(15, 30, 47, 0.2);
}

.legal-consent-header {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.legal-consent-title {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  flex: none;
}

.legal-consent-description {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  min-width: 0;
}

.legal-consent-links {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-self: center;
}

.legal-consent-row2 {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.legal-consent-actions {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  display: flex;
  gap: 6px;
}

.legal-consent-actions > * {
  flex: 1;
}

.legal-consent-checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(247, 251, 255, 0.9);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.legal-consent-checkbox-row input[type="checkbox"] {
  margin-top: 0;
  width: 14px;
  height: 14px;
  flex: none;
}

/* ── Splash screen ────────────────────────────────────────────────────────── */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: opacity 0.4s ease;
}

.app-splash.is-fading {
  opacity: 0;
  pointer-events: none;
}

.app-splash-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.app-splash-logo {
  width: 120px;
  height: 120px;
  animation: appSplashSpin 3s linear infinite;
}

@keyframes appSplashSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.app-splash-message {
  margin: 0;
  font-size: 13px;
  color: rgba(25, 42, 63, 0.45);
  letter-spacing: 0.03em;
}

.app-splash-progress-track {
  width: 200px;
  height: 4px;
  border-radius: 2px;
  background: rgba(25, 42, 63, 0.1);
  overflow: hidden;
}

.app-splash-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, #2463c8, #3a68b0);
  transition: width 0.35s ease;
}

.legal-pdf-overlay {
  z-index: 135;
}

.legal-pdf-modal {
  width: min(980px, calc(100vw - 28px));
  height: min(860px, calc(100vh - 24px));
  border-radius: 16px;
  border: 1px solid rgba(25, 42, 63, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.97)),
    linear-gradient(135deg, rgba(36, 99, 200, 0.06), rgba(58, 104, 176, 0.08));
  box-shadow: 0 26px 70px rgba(15, 30, 47, 0.28);
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.legal-pdf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.legal-document-viewer {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(25, 42, 63, 0.16);
  border-radius: 10px;
  background: #ffffff;
  padding: 24px;
}

.legal-document-status {
  font-size: 14px;
  line-height: 1.6;
  color: #526570;
}

.legal-document-status[hidden] {
  display: none;
}

.legal-document-content {
  width: 100%;
}

.legal-document-content[hidden] {
  display: none;
}

.legal-pdf-page-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.legal-pdf-page {
  width: 100%;
  display: flex;
  justify-content: center;
}

.legal-pdf-page-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #ffffff;
  border: 1px solid rgba(25, 42, 63, 0.12);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 30, 47, 0.08);
}

.process-import-form {
  display: grid;
  gap: 10px;
}

.process-import-textarea {
  min-height: 280px;
  resize: vertical;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.process-import-textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 9px 7px;
  min-height: 0;
  height: 100dvh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: rgba(243, 248, 255, 0.78);
  backdrop-filter: blur(12px);
}

.toolbox-sidebar {
  scrollbar-width: thin;
}

.toolbox-edge-toggle {
  grid-column: 2;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: var(--toolbox-handle-width);
  height: 100dvh;
  padding: 14px 0;
  border: 0;
  border-right: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(243, 248, 255, 0.46);
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.toolbox-edge-toggle:hover {
  background: rgba(243, 248, 255, 0.72);
  box-shadow: inset -1px 0 0 rgba(36, 99, 200, 0.14);
  transform: none;
}

.toolbox-edge-toggle:focus-visible {
  outline: 2px solid rgba(36, 99, 200, 0.5);
  outline-offset: -2px;
}

.toolbox-edge-toggle-line {
  width: 1px;
  height: 82px;
  background: rgba(25, 42, 63, 0.24);
}

.toolbox-edge-toggle-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
}

.toolbox-edge-toggle[aria-expanded="true"] {
  color: var(--primary-strong);
}

.toolbox-edge-toggle[aria-expanded="true"] .toolbox-edge-toggle-line {
  background: rgba(36, 99, 200, 0.32);
}

.app-shell.is-toolbox-collapsed .toolbox-edge-toggle {
  grid-column: 1;
  background: rgba(243, 248, 255, 0.82);
}

.app-shell.is-toolbox-collapsed .toolbox-edge-toggle .toolbox-edge-toggle-line {
  background: rgba(36, 99, 200, 0.42);
}

.brand-card,
.panel-card {
  background: var(--panel);
  border: 1px solid rgba(28, 45, 66, 0.1);
  border-radius: 14px;
  box-shadow: var(--shadow);
  min-height: 0;
}

.brand-card {
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 249, 240, 0.94)),
    linear-gradient(135deg, rgba(36, 99, 200, 0.08), rgba(58, 104, 176, 0.08));
}

.panel-card {
  padding: 10px;
}

.files-card,
.validation-card,
.property-card {
  min-height: 0;
}

.files-card {
  display: flex;
  flex-direction: column;
}

.files-card #filesCardBody {
  display: flex;
  flex-direction: column;
  min-height: fit-content;
}

.validation-card {
  display: flex;
  flex-direction: column;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-card h1,
.panel-card h2 {
  margin: 0;
}

.brand-card h1 {
  font-size: 20px;
  line-height: 1.05;
}

.panel-card h2 {
  font-size: 15px;
  line-height: 1.12;
}

.brand-copy {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.32;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
  font-size: 11px;
}

.button-grid {
  display: grid;
  gap: 5px;
}

.files-card .action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.files-card .action-grid .primary-button:first-child {
  grid-column: auto;
}

.files-card .db-action-grid {
  margin-top: 6px;
  grid-template-columns: minmax(0, 1fr);
}

.files-card .db-action-grid--2col {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.files-card-title-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.files-card-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(25, 42, 63, 0.2);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  line-height: 1;
  color: var(--muted);
  transition: transform 150ms ease, color 120ms;
  flex-shrink: 0;
}

.files-card-toggle:hover {
  color: var(--text);
  border-color: rgba(25, 42, 63, 0.35);
}

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

.files-card.is-collapsed .panel-title-row {
  margin-bottom: 0;
}

.files-card.is-collapsed #filesCardBody {
  display: none;
}

.demo-credentials-banner {
  margin: 0 0 6px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(31, 143, 102, 0.18);
  background:
    linear-gradient(180deg, rgba(240, 252, 247, 0.98), rgba(228, 248, 239, 0.96)),
    linear-gradient(135deg, rgba(31, 143, 102, 0.08), rgba(36, 99, 200, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.demo-credentials-banner__title {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1f7d59;
}

.demo-credentials-banner__text {
  margin: 3px 0 6px;
  font-size: 9px;
  line-height: 1.25;
  color: #2f4f43;
}

.demo-credentials-banner__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.demo-credentials-banner__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.demo-credentials-banner__label {
  flex: 0 0 auto;
  font-size: 8px;
  font-weight: 700;
  color: #48685a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.demo-credentials-banner__value {
  min-width: 0;
  max-width: 100%;
  justify-content: center;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  white-space: normal;
  color: #1c5f44;
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(31, 143, 102, 0.22);
}

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

.action-grid .primary-button:first-child {
  grid-column: 1 / -1;
}

.primary-button,
.secondary-button,
.tool-button,
.danger-button {
  border: 0;
  border-radius: 10px;
  padding: 7px 9px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button,
.secondary-button,
.tool-button {
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 8px 18px rgba(18, 35, 53, 0.08);
}

.tool-button {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 5px;
  text-align: left;
}

.tool-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 246, 255, 0.92));
  border: 1px solid rgba(25, 42, 63, 0.1);
}

.tool-copy {
  display: grid;
  gap: 2px;
}

.tool-name {
  font-size: 11px;
  font-weight: 800;
}

.tool-caption {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.mini-shape {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.mini-event {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
}

.mini-start-event {
  border: 2px solid var(--success);
}

.mini-end-event {
  border: 4px solid var(--danger);
}

.mini-intermediate-event {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(36, 99, 200, 0.24);
}

.mini-task-shape {
  width: 46px;
  height: 34px;
  border-radius: 8px;
  border: 2px solid rgba(43, 109, 178, 0.55);
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
}

.mini-data-object {
  width: 26px;
  height: 34px;
  border: 2px solid rgba(73, 111, 147, 0.6);
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
  clip-path: polygon(0 0, 68% 0, 100% 28%, 100% 100%, 0 100%);
}

.mini-data-object::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #eef5fb;
  border-left: 2px solid rgba(73, 111, 147, 0.6);
  border-bottom: 2px solid rgba(73, 111, 147, 0.6);
  border-bottom-left-radius: 2px;
}

.mini-data-store {
  width: 40px;
  height: 24px;
  border: 2px solid rgba(63, 115, 155, 0.58);
  border-radius: 999px / 8px;
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
}

.mini-data-store::before,
.mini-data-store::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  height: 8px;
  border: 2px solid rgba(63, 115, 155, 0.58);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.mini-data-store::before {
  top: -5px;
}

.mini-data-store::after {
  bottom: -5px;
  background: rgba(243, 248, 255, 0.96);
}

.mini-text-annotation {
  width: 44px;
  height: 30px;
  border-left: 2px solid rgba(110, 119, 131, 0.7);
}

.mini-text-annotation::before,
.mini-text-annotation::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 2px;
  border-top: 2px solid rgba(110, 119, 131, 0.7);
}

.mini-text-annotation::before {
  top: 3px;
}

.mini-text-annotation::after {
  bottom: 3px;
}

.mini-group-shape {
  width: 48px;
  height: 32px;
  border: 2px dashed rgba(167, 125, 70, 0.64);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(252, 246, 238, 0.92));
}

.mini-user-task {
  border-color: rgba(47, 111, 80, 0.55);
  background: linear-gradient(180deg, #ffffff 0%, #f1faf4 100%);
}

.mini-service-task {
  border-color: rgba(59, 124, 186, 0.55);
  background: linear-gradient(180deg, #ffffff 0%, #eef5fb 100%);
}

.mini-call-activity {
  border-color: rgba(36, 99, 200, 0.72);
  background: #f3f9ff;
}

.mini-call-activity-marker {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 11px;
  height: 11px;
  border: 1.3px solid rgba(36, 99, 200, 0.8);
  border-radius: 1.5px;
  background: #ffffff;
  transform: translateX(-50%);
}

.mini-call-activity-marker-v,
.mini-call-activity-marker-h {
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(36, 99, 200, 0.88);
  border-radius: 2px;
  transform: translate(-50%, -50%);
}

.mini-call-activity-marker-v {
  width: 1.4px;
  height: 6px;
}

.mini-call-activity-marker-h {
  width: 6px;
  height: 1.4px;
}

.mini-gateway {
  width: 32px;
  height: 32px;
  transform: rotate(45deg);
  border: 2px solid rgba(36, 99, 200, 0.6);
  background: linear-gradient(180deg, #fffdfa 0%, #f7efe5 100%);
}

.mini-gateway-mark {
  transform: rotate(-45deg);
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-strong);
}

.mini-parallel-gateway {
  border-color: rgba(43, 109, 178, 0.58);
  background: linear-gradient(180deg, #ffffff 0%, #eef5fb 100%);
}

.mini-sequence-flow,
.mini-message-flow,
.mini-association-flow {
  width: 56px;
  height: 16px;
}

.mini-sequence-line {
  width: 44px;
  height: 2px;
  background: rgba(18, 34, 52, 0.72);
}

.mini-sequence-arrow,
.mini-message-arrow {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid rgba(18, 34, 52, 0.72);
  margin-left: -2px;
}

.mini-message-line {
  width: 44px;
  height: 0;
  border-top: 2px dashed rgba(18, 34, 52, 0.72);
}

.mini-association-line {
  width: 44px;
  height: 0;
  border-top: 2px dashed rgba(110, 119, 131, 0.78);
}

.mini-association-open-arrow {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid rgba(110, 119, 131, 0.78);
  margin-left: -2px;
  position: relative;
}

.mini-association-open-arrow::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -7px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid rgba(247, 251, 255, 1);
}

.mini-association-open-arrow-left {
  transform: rotate(180deg);
  margin-left: 0;
  margin-right: -2px;
}

.mini-pool,
.mini-lane {
  width: 72px;
  height: 34px;
  border-radius: 7px;
  border: 2px solid rgba(43, 109, 178, 0.55);
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
}

.mini-pool {
  display: grid;
  grid-template-columns: 10px 1fr;
}

.mini-pool-label {
  background: linear-gradient(180deg, rgba(43, 109, 178, 0.08), rgba(29, 128, 191, 0.05));
  border-right: 1px solid rgba(43, 109, 178, 0.15);
}

.mini-pool-body,
.mini-lane-body {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f3faf8 100%);
}

.mini-pool-divider {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(29, 128, 191, 0.22);
}

.mini-lane {
  display: grid;
  grid-template-columns: 10px 1fr;
  border-color: rgba(29, 128, 191, 0.34);
}

.primary-button {
  color: #fff7ef;
  background: linear-gradient(135deg, var(--primary) 0%, #14a3c1 100%);
}

.secondary-button:hover,
.primary-button:hover,
.tool-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(18, 35, 53, 0.14);
}

.accent-button {
  background: linear-gradient(135deg, rgba(59, 124, 186, 0.12), rgba(36, 99, 200, 0.15));
}

.collaboration-button {
  background: linear-gradient(135deg, rgba(29, 128, 191, 0.12), rgba(36, 99, 200, 0.14));
}

.danger-button {
  color: #fff7f4;
  background: linear-gradient(135deg, var(--danger) 0%, #cf6358 100%);
}

.danger-button:disabled,
.tool-button:disabled,
.secondary-button:disabled,
.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.panel-note {
  margin: 8px 2px 0;
  color: var(--muted);
  line-height: 1.42;
  font-size: 11px;
}

.action-badge,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--action-badge-color, #2463c8) 13%, #ffffff);
  color: var(--action-badge-color, #2463c8);
  font-size: 0.50rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  box-sizing: border-box;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--action-badge-color, #2463c8) 28%, #dbe7f3);
}

.action-badge.is-success { --action-badge-color: #2f7a52; }
.action-badge.is-teal    { --action-badge-color: #2463c8; }
.action-badge.is-blue    { --action-badge-color: #1565c0; }
.action-badge.is-indigo  { --action-badge-color: #3949ab; }
.action-badge.is-violet  { --action-badge-color: #6a1b9a; }
.action-badge.is-amber   { --action-badge-color: #b45309; }
.action-badge.is-warning { --action-badge-color: #b07c00; }
.action-badge.is-error   { --action-badge-color: #cf4343; }
.action-badge.is-neutral { --action-badge-color: #546e7a; }

.table-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 18px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  font-size: 0.6rem !important;
  font-weight: 700;
  line-height: 1.05 !important;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(18, 35, 53, 0.05);
  transition: background 120ms, border-color 120ms, color 120ms, box-shadow 120ms, transform 120ms;
}

.table-action-button.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(25, 42, 63, 0.18) !important;
  box-shadow: 0 1px 2px rgba(18, 35, 53, 0.05);
}

.table-action-button.danger-button,
.table-action-button--danger {
  color: #fff;
  background: linear-gradient(180deg, #e25f58 0%, #cf4343 100%);
  border: 1px solid rgba(180, 40, 40, 0.3) !important;
  box-shadow: 0 1px 2px rgba(180, 40, 40, 0.15);
}

.table-action-button.secondary-button:hover {
  border-color: rgba(25, 42, 63, 0.25) !important;
  box-shadow: 0 2px 4px rgba(18, 35, 53, 0.08);
}

.table-action-button.danger-button:hover,
.table-action-button--danger:hover {
  box-shadow: 0 2px 4px rgba(180, 40, 40, 0.18);
}

table button:not(.primary-button):not(.tool-button):not(.table-sort-button):not(.admin-users-sort-button):not(.repository-audit-sort-button):not(.table-action-button),
table a.button:not(.primary-button):not(.tool-button):not(.table-action-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 18px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  font-size: 0.6rem !important;
  font-weight: 700;
  line-height: 1.05 !important;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(18, 35, 53, 0.05);
  transition: background 120ms, border-color 120ms, color 120ms, box-shadow 120ms, transform 120ms;
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(25, 42, 63, 0.18) !important;
}

table button:not(.primary-button):not(.tool-button):not(.table-sort-button):not(.admin-users-sort-button):not(.repository-audit-sort-button):not(.table-action-button):hover:not(:disabled),
table a.button:not(.primary-button):not(.tool-button):not(.table-action-button):hover:not(:disabled) {
  border-color: rgba(25, 42, 63, 0.25) !important;
  box-shadow: 0 2px 4px rgba(18, 35, 53, 0.08);
}

.muted-badge {
  background: rgba(43, 109, 178, 0.08);
  color: var(--muted);
}

.success-badge {
  background: rgba(47, 111, 80, 0.12);
  color: var(--success);
}

.warning-badge {
  background: rgba(36, 99, 200, 0.12);
  color: var(--primary-strong);
}

.error-badge {
  background: rgba(207, 67, 67, 0.12);
  color: var(--danger-strong);
}

.property-card {
  margin-top: 0;
}

.properties-form {
  display: grid;
  gap: 5px;
}

.properties-form label {
  font-size: 10px;
  font-weight: 700;
}

.properties-form input {
  width: 100%;
  border: 1px solid rgba(25, 42, 63, 0.14);
  border-radius: 8px;
  padding: 6px 7px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.properties-form input:disabled {
  color: var(--muted);
  background: rgba(247, 251, 255, 0.65);
}

.workspace {
  grid-column: 3;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  padding: 8px 14px 14px;
  gap: 8px;
  overflow: hidden;
}

.app-shell.is-toolbox-collapsed .workspace {
  grid-column: 2;
}

.document-tabs-shell {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
  flex: none;
  height: 30px;
  padding: 0 6px 0 0;
  border-bottom: 1px solid rgba(25, 42, 63, 0.12);
  position: relative;
  isolation: isolate;
}

.document-tabs-shell.has-open-document-tabs {
  padding-right: 10px;
}

.document-tabs-shell::after {
  content: "Reasontica Studio";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 5px;
  font-family: "Cinzel", "Georgia", serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: rgba(25, 42, 63, 0.18);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  text-transform: uppercase;
}

.document-tabs-shell.has-open-document-tabs::after {
  content: none;
  display: none;
}

.document-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  scrollbar-width: none;
  position: relative;
  z-index: 2;
}

.document-tabs::-webkit-scrollbar {
  display: none;
}

.document-tab {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  flex: 0 1 132px;
  min-width: 86px;
  min-height: 27px;
  padding: 0 2px 0 4px;
  border-radius: 8px 8px 0 0;
  border: 1px solid rgba(25, 42, 63, 0.14);
  border-bottom: 0;
  background: rgba(233, 242, 253, 0.98);
  box-shadow: none;
  max-width: 132px;
}

.document-tab.is-active {
  background: rgba(247, 251, 255, 1);
  border-color: rgba(36, 99, 200, 0.34);
  position: relative;
}

.document-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(247, 251, 255, 0.98);
}

.document-tab-button,
.document-tab-close,
.menu-toggle-button,
.tab-add-button {
  border-radius: 6px;
}

.menu-toggle-button {
  min-width: 58px;
  min-height: 24px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  border-radius: 5px;
  box-shadow: none;
  position: relative;
  z-index: 2;
}

.toolbox-toggle-button {
  min-width: 116px;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
  padding: 2px;
  border-radius: 999px;
  background: rgba(247, 251, 255, 0.78);
  border: 1px solid rgba(25, 42, 63, 0.1);
}

.auth-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.auth-controls > * {
  min-width: 0;
}

.auth-button {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

.auth-badges-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  column-gap: 6px;
  align-items: center;
}

.auth-session-actions {
  grid-column: 2;
  display: grid;
  grid-auto-rows: min-content;
  gap: 3px;
  align-self: center;
}

.auth-session-actions .auth-button {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  min-height: 16px;
  max-height: 16px;
  padding: 0 6px;
  font-size: 8px;
  line-height: 1;
  white-space: nowrap;
}

#logoutButton,
#changePasswordButton {
  height: 16px !important;
  min-height: 16px !important;
  max-height: 16px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1 !important;
}

.auth-user-badge {
  grid-column: 1;
  min-height: 36px;
  padding: 4px 10px;
  min-width: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
  white-space: normal;
  overflow: hidden;
}

.auth-user-badge.is-interactive {
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.auth-user-badge.is-interactive:hover {
  transform: translateY(-1px);
}

.auth-user-badge.is-interactive:focus-visible {
  outline: 2px solid rgba(36, 99, 200, 0.45);
  outline-offset: 2px;
}

.auth-user-badge-line {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.auth-user-badge-line--company {
  opacity: 0.9;
  font-size: 0.46rem;
}

.auth-company-badge {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  min-height: 28px;
  min-width: unset;
  padding: 2px 10px;
  flex: 0 0 auto;
  border: 1px solid rgba(25, 100, 180, 0.25);
  justify-content: center;
  align-self: center;
  cursor: default;
  background: rgba(25, 120, 200, 0.1);
  color: rgba(25, 100, 180, 0.85);
  font-size: 10px;
  font-weight: 700;
  box-shadow: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.auth-company-badge.is-interactive {
  cursor: pointer;
  background: rgba(25, 120, 200, 0.16);
  border-color: rgba(25, 100, 180, 0.35);
}

.auth-company-badge.is-interactive:hover {
  background: rgba(25, 120, 200, 0.24);
  border-color: rgba(25, 100, 180, 0.48);
}

.auth-backup-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.auth-account-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.auth-company-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}

.auth-company-row .auth-company-badge {
  max-width: 100%;
  width: 100%;
  justify-content: center;
}

.auth-company-actions {
  display: contents;
}

.auth-company-row .auth-company-menu-button {
  width: 100%;
  min-width: 0;
  justify-content: center;
  white-space: nowrap;
}

.auth-company-row .auth-company-actions > .auth-company-menu-button {
  grid-column: auto;
}

.auth-company-menu-button {
  flex: 0 0 auto;
  gap: 6px;
}

.auth-account-row .auth-button {
  width: 100%;
  min-width: 0;
  white-space: normal;
  line-height: 1.1;
  padding: 4px 6px;
}

.auth-logout-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
}

.auth-logout-row .auth-button {
  flex: 1;
}


.auth-card {
  padding: 10px;
}

.menu-auth-controls {
  width: 100%;
}

.language-badge {
  min-width: 34px;
  min-height: 22px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.language-badge.is-active {
  color: #fff7ef;
  background: linear-gradient(135deg, var(--primary) 0%, #14a3c1 100%);
  box-shadow: 0 8px 18px rgba(18, 35, 53, 0.12);
}

.language-badge:hover {
  transform: none;
  color: var(--primary-strong);
}

.language-badge.is-active:hover {
  color: #fff7ef;
}

.menu-toggle-button.is-open {
  color: var(--primary-strong);
  background: rgba(247, 251, 255, 0.98);
  border: 1px solid rgba(36, 99, 200, 0.26);
}

.document-tab-button {
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  padding: 5px 6px 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.document-tab-label {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-tab-label-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-width: 0;
}

.document-tab-lock-owner {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.15;
  color: rgba(160, 92, 10, 0.95);
}

.document-tab-dirty {
  flex: none;
  color: inherit;
  margin-left: 0;
}

.document-tab-editor-badge,
.document-tab-viewers-badge {
  flex: none;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.15;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.document-tab-editor-badge {
  background: rgba(220, 140, 30, 0.18);
  color: rgb(180, 100, 10);
  border: 1px solid rgba(220, 140, 30, 0.4);
}

.document-tab-viewers-badge {
  background: rgba(30, 120, 180, 0.15);
  color: rgb(20, 90, 140);
  border: 1px solid rgba(30, 120, 180, 0.35);
}

.document-tab.is-active .document-tab-button {
  color: var(--primary-strong);
}

.document-tab.is-readonly .document-tab-button {
  color: rgb(180, 100, 10);
}

.document-tab.is-active.is-readonly .document-tab-button {
  color: rgb(180, 100, 10);
}

.document-tab.is-readonly {
  border-color: rgba(220, 140, 30, 0.3);
  background: rgba(220, 140, 30, 0.06);
}

.document-tab-owner-badge {
  margin-left: 6px;
  max-width: 180px;
  font-size: 9px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-tab-close {
  border: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.document-tab-close:hover,
.document-tab-button:hover,
.tab-add-button:hover,
.document-tabs-action-button:hover {
  transform: none;
}

.document-tab-close:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tab-add-button {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  border-radius: 5px;
  box-shadow: none;
}

.document-tabs-actions {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
}

.document-tabs-action-button {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid rgba(25, 42, 63, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  border-radius: 5px;
  box-shadow: none;
}

.tab-add-button:disabled {
  opacity: 0.45;
}

.document-tabs-action-button:disabled {
  opacity: 0.45;
}

.zoom-controls {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(3, 34px);
  grid-template-rows: 34px 34px;
  column-gap: 6px;
  row-gap: 6px;
  padding: 10px 8px 8px;
}

.zoom-controls::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(247, 251, 255, 0.9);
  border: 1px solid rgba(25, 42, 63, 0.12);
  box-shadow: 0 10px 24px rgba(15, 30, 47, 0.1);
  clip-path: polygon(50% 6%, 97% 96%, 3% 96%);
  border-radius: 16px;
  z-index: -1;
}

.zoom-controls-overlay {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 13;
}

.zoom-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-row: 2;
}

#zoomOutButton {
  grid-column: 1;
}

#zoomInButton {
  grid-column: 3;
}

#llmQuickButton {
  grid-column: 2;
}

.info-overlay-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-column: 1 / 4;
  grid-row: 1;
  justify-self: center;
  align-self: end;
  margin-bottom: 1px;
}

.llm-quick-button {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.llm-quick-button.llm-quick-button--pending {
  border-color: rgba(214, 166, 0, 0.65);
  background: rgba(255, 235, 168, 0.95);
  color: #6b4f00;
  animation: llmQuickPulse 1.1s ease-in-out infinite;
}

.llm-quick-button.llm-quick-button--success {
  border-color: rgba(18, 148, 98, 0.62);
  background: rgba(212, 247, 233, 0.96);
  color: #0d6b46;
  animation: none;
}

.llm-quick-button.llm-quick-button--error {
  border-color: rgba(200, 58, 58, 0.62);
  background: rgba(255, 224, 224, 0.96);
  color: #8e1f1f;
  animation: none;
}

@keyframes llmQuickPulse {
  0% { box-shadow: 0 0 0 0 rgba(214, 166, 0, 0.38); }
  70% { box-shadow: 0 0 0 8px rgba(214, 166, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(214, 166, 0, 0); }
}

.info-overlay-button .ph {
  font-size: 18px;
  line-height: 1;
}

.info-overlay-button--active {
  background: rgba(36, 99, 200, 0.12);
  border-color: rgba(36, 99, 200, 0.35);
  color: #1a5cbf;
}

.quick-actions-panel {
  position: absolute;
  right: 12px;
  bottom: calc(12px + 104px);
  z-index: 13;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: rgba(247, 251, 255, 0.97);
  border: 1px solid rgba(25, 42, 63, 0.13);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(15, 30, 47, 0.14), 0 2px 6px rgba(15, 30, 47, 0.07);
  transform-origin: bottom right;
  animation: quickActionSlideIn 0.16s ease-out;
}

.quick-actions-panel[hidden] {
  display: none;
}

@keyframes quickActionSlideIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  min-height: 34px;
  width: 100%;
  text-align: left;
}

.quick-action-btn .ph {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.canvas-shell {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(28, 45, 66, 0.08);
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 243, 0.96)),
    linear-gradient(90deg, rgba(36, 99, 200, 0.04), rgba(58, 104, 176, 0.04));
}

.workspace-empty-state {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.workspace-empty-state__panel {
  width: min(460px, calc(100% - 24px));
  padding: 28px 24px;
  border-radius: 22px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 251, 255, 0.94)),
    linear-gradient(135deg, rgba(36, 99, 200, 0.06), rgba(58, 104, 176, 0.08));
  box-shadow: 0 20px 46px rgba(15, 30, 47, 0.16);
  text-align: center;
}

.workspace-empty-state__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.workspace-empty-state__copy {
  margin: 12px auto 0;
  max-width: 32ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.workspace-empty-state__actions {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.workspace-empty-state__button {
  min-height: 42px;
  font-size: 13px;
  font-weight: 800;
}

.workspace-empty-state__illustration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

.canvas-shell.is-drag-target {
  box-shadow: 0 0 0 2px rgba(36, 99, 200, 0.18), var(--shadow);
}

.toolbox-sidebar .toolbox-dock-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 1px;
  background: linear-gradient(180deg, rgba(243, 248, 255, 0.96), rgba(243, 248, 255, 0.82));
}

.toolbox-sidebar .toolbox-dock-grid {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 8px;
}

.app-menu-dock {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 13;
  width: min(240px, calc(100% - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  max-height: min(calc(100% - 28px), calc(100dvh - 122px));
  padding: 0;
  border-radius: 16px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(247, 251, 255, 0.92);
  box-shadow: 0 16px 30px rgba(15, 30, 47, 0.12);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(-100% - 18px));
  transition: opacity 180ms ease, transform 180ms ease;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.sbvr-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.app-menu-dock.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.app-menu-dock .panel-card {
  box-shadow: none;
}

.app-menu-dock button {
  border: 1px solid rgba(25, 42, 63, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  box-shadow: none;
  transition: background 120ms, border-color 120ms, color 120ms;
}

.app-menu-dock button:not(.admin-download-button) {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

.app-menu-dock button:hover:not(:disabled) {
  background: rgba(36, 99, 200, 0.07);
  border-color: rgba(36, 99, 200, 0.3);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.app-menu-dock .primary-button {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.app-menu-dock .primary-button:hover:not(:disabled) {
  background: var(--primary-strong);
  color: #fff;
  border-color: var(--primary-strong);
}

@media (max-height: 760px) {
  .app-menu-dock {
    gap: 6px;
    max-height: min(calc(100% - 20px), calc(100dvh - 112px));
    border-radius: 14px;
  }

  .app-menu-dock .panel-card {
    padding: 7px;
  }

  .app-menu-dock button:not(.admin-download-button) {
    min-height: 24px;
    padding: 0 6px;
    font-size: 9px;
  }

  .app-menu-dock .panel-title-row {
    margin-bottom: 6px;
  }

  .app-menu-dock .panel-card h2 {
    font-size: 13px;
  }

  .app-menu-dock .button-grid {
    gap: 4px;
  }

  .app-menu-dock .files-card .db-action-grid {
    margin-top: 4px;
  }

  .app-menu-dock .files-card {
    min-height: fit-content;
    overflow: visible;
  }

  .app-menu-dock .files-card .action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-menu-dock .files-card .db-action-grid--2col {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .app-menu-dock .files-card .action-grid .primary-button:first-child {
    grid-column: auto;
  }

  .app-menu-dock .demo-credentials-banner {
    margin-bottom: 5px;
    padding: 6px 7px;
  }

  .app-menu-dock .demo-credentials-banner__text {
    margin-bottom: 5px;
    font-size: 8px;
    line-height: 1.2;
  }
}

.admin-download-button {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
}

@media (max-height: 760px) {
  .admin-download-button {
    min-height: 24px;
    padding: 0 6px;
    font-size: 9px;
  }
}

.admin-tools-modal {
  width: min(640px, calc(100vw - 28px));
}

.admin-tools-actions {
  display: grid;
  gap: 8px;
}

.admin-tools-actions .admin-download-button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

#backupOverlay .secondary-button,
#backupOverlay .primary-button {
  border: 1px solid rgba(25, 42, 63, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  box-shadow: none;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transition: background 120ms, border-color 120ms, color 120ms;
}

#backupOverlay .secondary-button:hover:not(:disabled),
#backupOverlay .primary-button:hover:not(:disabled) {
  background: rgba(36, 99, 200, 0.07);
  border-color: rgba(36, 99, 200, 0.3);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

#backupOverlay .primary-button {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

#backupOverlay .primary-button:hover:not(:disabled) {
  background: var(--primary-strong);
  color: #fff;
  border-color: var(--primary-strong);
}

.admin-users-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.admin-user-item {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(255, 255, 255, 0.86);
}

.admin-user-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
}

.admin-user-meta {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
}

.admin-user-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.admin-user-actions-cell {
  justify-content: flex-end;
}

.admin-users-table--users .admin-user-actions-cell {
  justify-content: flex-start;
}

.admin-user-role-select:focus {
  outline: none;
}

.admin-user-activate-button:not(.table-action-button),
.admin-user-password-button:not(.table-action-button),
.admin-user-delete-button:not(.table-action-button),
.admin-user-force-password-action-button:not(.table-action-button) {
  min-height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 9px;
}

.admin-user-force-password-action-button {
  padding: 0 5px;
  white-space: nowrap;
}

.admin-user-force-password-action-button:not(.table-action-button).error-badge {
  background: rgba(220, 53, 69, 0.12);
  color: var(--danger-strong);
}

.admin-user-force-password-action-button:not(.table-action-button).muted-badge {
  background: rgba(43, 109, 178, 0.08);
  color: var(--muted);
}

.admin-users-table--users .admin-user-actions {
  gap: 3px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.admin-legal-event-details-button {
  min-height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 9px;
  white-space: nowrap;
}

.admin-user-delete-button:not(.table-action-button) {
  color: #c0392b;
  border-color: rgba(192, 57, 43, 0.35);
}

.admin-company-actions {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
}

.admin-company-actions .secondary-button:not(.table-action-button) {
  flex: 0 0 auto;
}

.admin-company-admins-button {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .admin-users-modal {
    width: calc(100vw - 18px);
    height: calc(100vh - 18px);
    max-height: calc(100vh - 18px);
    padding: 12px;
  }

  .admin-users-table th,
  .admin-users-table td {
    padding: 7px 8px;
    font-size: 11px;
  }

  .admin-users-table th:last-child,
  .admin-users-table td:last-child {
    width: 190px;
  }

  .admin-user-actions-cell .secondary-button {
    min-height: 22px;
    padding: 0 7px;
    font-size: 10px;
  }
}

  .validation-dock {
    position: absolute;
    right: 160px;
    bottom: 12px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

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

.validation-actions-row .diagram-rotate-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(15, 30, 47, 0.12);
}

.diagram-db-save-overlay {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 11;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0;
  row-gap: 8px;
  width: max-content;
  overflow: visible;
}

.diagram-db-save-overlay .diagram-id-badge {
  flex: 0 0 100%;
  width: max-content;
  pointer-events: none;
}

.diagram-db-save-overlay .diagram-readonly-owner-badge {
  margin-left: 8px;
  max-width: min(320px, calc(100% - 160px));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Overlay shown on the diagram canvas when the document is read-only and
   someone else is editing it. High-contrast orange to match badges. */
.diagram-readonly-overlay {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(220, 140, 30, 0.95);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(15, 30, 47, 0.18);
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100% - 48px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.diagram-readonly-owner-badge {
  max-width: min(320px, calc(100vw - 48px));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(220, 140, 30, 0.14);
  color: rgb(180, 100, 10);
  border: 1px solid rgba(220, 140, 30, 0.35);
  box-shadow: 0 5px 12px rgba(180, 100, 10, 0.12);
}

.diagram-viewers-badge {
  max-width: min(320px, calc(100vw - 48px));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(30, 120, 180, 0.14);
  color: rgb(20, 90, 140);
  border: 1px solid rgba(30, 120, 180, 0.35);
  box-shadow: 0 5px 12px rgba(20, 90, 140, 0.12);
}

.diagram-overlay-icon-button {
  padding: 0;
  border-radius: 12px;
  font-size: 28px;
  line-height: 1;
  border: none;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 160ms ease;
}

.diagram-overlay-icon-button:hover {
  opacity: 1;
}

.diagram-overlay-icon-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.diagram-screenshot-overlay-button,
.diagram-db-save-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  font-size: 24px;
}

.diagram-undo-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 12px;
  font-size: 20px;
}

.diagram-db-save-button {
  margin: 0;
}

.validation-help-button:not(.document-tabs-action-button) {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(15, 30, 47, 0.12);
}

.token-playback-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 4px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(15, 30, 47, 0.12);
}

.token-playback-button.is-running {
  border-color: rgba(47, 111, 80, 0.24);
  background: rgba(231, 248, 243, 0.96);
  color: var(--success);
}

.validation-help-button:not(.document-tabs-action-button).validation-state-idle,
.validation-help-button:not(.document-tabs-action-button).validation-state-checking {
  border-color: rgba(43, 109, 178, 0.16);
  background: rgba(247, 251, 255, 0.94);
  color: var(--muted);
}

.validation-help-button:not(.document-tabs-action-button).validation-state-ok {
  border-color: rgba(47, 111, 80, 0.22);
  background: rgba(231, 248, 243, 0.96);
  color: var(--success);
}

.validation-help-button:not(.document-tabs-action-button).validation-state-error {
  border-color: rgba(207, 67, 67, 0.22);
  background: rgba(255, 235, 235, 0.96);
  color: var(--danger-strong);
}

.validation-help-button.document-tabs-action-button.validation-state-idle,
.validation-help-button.document-tabs-action-button.validation-state-checking {
  border-color: rgba(43, 109, 178, 0.18);
  background: rgba(247, 251, 255, 0.94);
  color: var(--muted);
}

.validation-help-button.document-tabs-action-button.validation-state-ok {
  border-color: rgba(31, 143, 102, 0.58);
  background: linear-gradient(135deg, #1f8f66 0%, #28a676 100%);
  color: #f7fff9;
}

.validation-help-button.document-tabs-action-button.validation-state-error {
  border-color: rgba(207, 67, 67, 0.58);
  background: linear-gradient(135deg, #cf4343 0%, #df5a5a 100%);
  color: #fff7f7;
}

.validation-help-button:not(.document-tabs-action-button)[aria-expanded="true"] {
  box-shadow: 0 12px 28px rgba(15, 30, 47, 0.18);
}

.validation-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(320px, calc(100vw - 44px));
  padding: 10px;
  display: grid;
  gap: 8px;
  background: rgba(247, 251, 255, 0.92);
  border: 1px solid rgba(25, 42, 63, 0.12);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 30px rgba(15, 30, 47, 0.12);
}

.validation-panel.validation-panel--topbar {
  top: calc(100% + 8px);
  bottom: auto;
  right: 0;
  z-index: 24;
}

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

.validation-panel .panel-note {
  margin-top: 0;
}

.validation-panel .validation-list {
  min-height: 0;
  max-height: min(220px, calc(100vh - 240px));
}

.token-playback-layer {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}

.token-playback-success-indicator {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 14;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(43, 109, 178, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(243, 248, 255, 0.96));
  color: #17324d;
  box-shadow: 0 10px 24px rgba(18, 34, 52, 0.16);
  backdrop-filter: blur(12px);
  transform: translate(-50%, -8px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.token-playback-success-indicator.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.token-playback-success-indicator__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(31, 143, 102, 0.1);
  color: var(--success);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(31, 143, 102, 0.14);
}

.token-playback-dot,
.token-playback-signal {
  position: absolute;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.token-playback-dot {
  width: 8px;
  height: 8px;
  border: 1.5px solid rgba(240, 255, 246, 0.96);
  background: radial-gradient(circle at 30% 30%, #7affb6, #1f8f66);
  box-shadow: 0 0 0 2px rgba(47, 157, 102, 0.22), 0 0 10px rgba(31, 143, 102, 0.46);
}

.token-playback-signal {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(238, 246, 255, 0.92);
  background: radial-gradient(circle at 32% 32%, #8be7ff, #2b6db2);
  box-shadow: 0 0 0 2px rgba(43, 109, 178, 0.18), 0 0 12px rgba(43, 109, 178, 0.45);
}

#canvas [data-element-id].token-visited-node path,
#canvas [data-element-id].token-visited-node rect,
#canvas [data-element-id].token-visited-node circle,
#canvas [data-element-id].token-visited-node polygon,
#canvas [data-element-id].token-visited-node ellipse,
#canvas [data-element-id].token-visited-node line {
  animation: token-visit-pulse 520ms ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(116, 255, 176, 0.92)) drop-shadow(0 0 14px rgba(31, 143, 102, 0.68));
}

#canvas [data-element-id].token-stuck-node path,
#canvas [data-element-id].token-stuck-node rect,
#canvas [data-element-id].token-stuck-node circle,
#canvas [data-element-id].token-stuck-node polygon,
#canvas [data-element-id].token-stuck-node ellipse,
#canvas [data-element-id].token-stuck-node line {
  animation: token-stuck-pulse 900ms ease-in-out infinite;
  filter: drop-shadow(0 0 5px rgba(206, 58, 58, 0.76));
}

@keyframes token-stuck-pulse {
  0% {
    stroke: rgba(206, 58, 58, 0.96);
  }

  50% {
    stroke: rgba(255, 76, 76, 0.62);
  }

  100% {
    stroke: rgba(206, 58, 58, 0.96);
  }
}

@keyframes token-visit-pulse {
  0% {
    stroke: rgba(116, 255, 176, 0.96);
    stroke-width: 1.8px;
  }

  50% {
    stroke: rgba(66, 220, 138, 0.98);
    stroke-width: 2.5px;
  }

  100% {
    stroke: rgba(43, 180, 117, 0.86);
    stroke-width: 1.7px;
  }
}

.toolbox-dock-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.toolbox-dock-header-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.toolbox-dock-header strong {
  font-size: 11px;
  line-height: 1.1;
}

.toolbox-dock-header-hint {
  font-size: 8px;
  color: var(--muted);
  line-height: 1.25;
}

.toolbox-compact-toggle {
  flex: 0 0 auto;
  min-height: 20px;
  padding: 2px 6px;
  font-size: 9px;
  line-height: 1;
  border-radius: 999px;
}

.toolbox-dock-grid {
  display: grid;
  gap: 7px;
}

.toolbox-group {
  display: grid;
  gap: 3px;
}

.toolbox-group-title {
  margin: 0;
  padding: 0 2px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.toolbox-group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.toolbox-button {
  width: 100%;
  justify-self: center;
  align-items: center;
  gap: 2px;
  padding: 3px 2px 4px;
  text-align: center;
  cursor: grab;
}

.toolbox-button:active,
.toolbox-button.is-dragging {
  cursor: grabbing;
}

.toolbox-button.is-armed {
  background: linear-gradient(135deg, rgba(36, 99, 200, 0.15), rgba(29, 128, 191, 0.18));
  box-shadow: 0 0 0 1.5px rgba(36, 99, 200, 0.35), 0 8px 18px rgba(18, 35, 53, 0.08);
}

.toolbox-button .tool-thumb {
  height: 42px;
  width: 100%;
  transform: scale(0.81);
  transform-origin: center;
}

.toolbox-button .tool-thumb > .mini-shape {
  transform-origin: center;
}

.toolbox-button .tool-thumb > .mini-shape:not(.mini-gateway) {
  transform: scale(0.81);
}

.toolbox-button .mini-sequence-flow,
.toolbox-button .mini-message-flow,
.toolbox-button .mini-association-flow {
  width: min(100%, 36px);
  height: 11px;
}

.toolbox-button .mini-sequence-line,
.toolbox-button .mini-message-line,
.toolbox-button .mini-association-line {
  width: min(100%, 29px);
}

.toolbox-button .mini-sequence-arrow,
.toolbox-button .mini-message-arrow {
  border-top-width: 2px;
  border-bottom-width: 2px;
  border-left-width: 5px;
}

.toolbox-button .mini-association-open-arrow {
  border-top-width: 2px;
  border-bottom-width: 2px;
  border-left-width: 5px;
}

.toolbox-button .mini-association-open-arrow::after {
  top: -2px;
  left: -5px;
  border-top-width: 2px;
  border-bottom-width: 2px;
  border-left-width: 5px;
}

.toolbox-button .tool-thumb > .mini-gateway {
  width: 22px;
  height: 22px;
  border-width: 2px;
  transform: rotate(45deg) scale(0.81);
}

.toolbox-button .mini-gateway-mark {
  display: none;
}

.toolbox-button .mini-pool,
.toolbox-button .mini-lane {
  width: min(100%, 36px);
  height: 18px;
  border-radius: 4px;
}

.toolbox-button .mini-data-object {
  width: 22px;
  height: 29px;
}

.toolbox-button .mini-data-store {
  width: 32px;
  height: 20px;
}

.toolbox-button .mini-text-annotation {
  width: 36px;
  height: 25px;
}

.toolbox-button .mini-group-shape {
  width: 38px;
  height: 25px;
}

.toolbox-button .mini-pool {
  grid-template-columns: 6px 1fr;
}

.toolbox-label {
  display: block;
  font-size: clamp(5.4px, 0.5vw, 7.4px);
  font-weight: 700;
  line-height: 1.18;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  text-wrap: balance;
}

.app-shell.is-toolbox-compact .toolbox-dock-header-hint,
.app-shell.is-toolbox-compact .toolbox-label {
  display: none;
}

.app-shell.is-toolbox-compact .toolbox-dock-grid {
  gap: 4px;
}

.app-shell.is-toolbox-compact .toolbox-group-grid {
  gap: 4px;
}

.app-shell.is-toolbox-compact .toolbox-button {
  padding: 2px;
  gap: 0;
}

.app-shell.is-toolbox-compact .toolbox-button .tool-thumb {
  height: 28px;
}

.app-shell.is-toolbox-compact .toolbox-button.collaboration-button {
  background: var(--panel-strong);
}

.app-shell.is-toolbox-compact .toolbox-group {
  gap: 0;
}

.canvas-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(18, 35, 53, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 35, 53, 0.06) 1px, transparent 1px);
  background-size:
    24px 24px,
    24px 24px;
  background-position:
    0 0,
    0 0;
  background-repeat:
    repeat,
    repeat;
  pointer-events: none;
}

.canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.canvas.canvas-readonly {
  pointer-events: auto;
  cursor: grab;
}

.canvas.canvas-readonly:active {
  cursor: grabbing;
}

.canvas-shell.is-canvas-panning,
.canvas-shell.is-canvas-panning .canvas {
  cursor: grab !important;
}

.canvas > div,
.canvas svg {
  width: 100%;
  height: 100%;
}

.connection-preview-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: visible;
}

.connection-preview-path {
  fill: none;
  stroke: rgba(43, 109, 178, 0.9);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 8 6;
}

.connection-preview-arrow {
  fill: rgba(43, 109, 178, 0.9);
  stroke: rgba(43, 109, 178, 0.95);
  stroke-width: 1.25;
  stroke-linejoin: round;
}

.connection-preview-layer[data-connection-type="bpmn:MessageFlow"] .connection-preview-path {
  stroke-dasharray: 8 6;
}

.connection-preview-layer[data-connection-type="bpmn:MessageFlow"] .connection-preview-arrow {
  fill: rgba(43, 109, 178, 0.9);
  stroke: rgba(43, 109, 178, 0.95);
  stroke-width: 1.25;
}

.connection-preview-layer[data-connection-type="bpmn:Association"] .connection-preview-path {
  stroke: rgba(110, 119, 131, 0.92);
  stroke-dasharray: 6 5;
}

.connection-preview-layer[data-connection-type="bpmn:Association"] .connection-preview-arrow {
  display: none;
}

.connection-preview-layer[data-state="valid"] .connection-preview-path {
  stroke: rgba(47, 111, 80, 0.92);
  stroke-dasharray: none;
}

.connection-preview-layer[data-state="valid"][data-connection-type="bpmn:MessageFlow"] .connection-preview-path {
  stroke: rgba(47, 111, 80, 0.92);
  stroke-dasharray: 8 6;
}

.connection-preview-layer[data-state="valid"] .connection-preview-arrow {
  fill: rgba(47, 111, 80, 0.92);
  stroke: rgba(47, 111, 80, 0.96);
}

.connection-preview-layer[data-state="valid"][data-connection-type="bpmn:MessageFlow"] .connection-preview-arrow {
  fill: rgba(47, 111, 80, 0.92);
  stroke: rgba(47, 111, 80, 0.96);
}

.connection-preview-layer[data-state="valid"][data-connection-type="bpmn:Association"] .connection-preview-path {
  stroke: rgba(47, 111, 80, 0.92);
  stroke-dasharray: 6 5;
}

.live-preview-remote-cursor {
  position: absolute;
  z-index: 34;
  transform: translate(-2px, -2px);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-preview-remote-cursor-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f08a00 0%, #ffb347 100%);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 3px 10px rgba(19, 33, 51, 0.28);
}

.live-preview-remote-cursor-label {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(240, 138, 0, 0.95);
  color: #fff8ef;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(15, 30, 47, 0.2);
}

.djs-element.live-preview-remote-selected .djs-visual > :first-child {
  stroke: #f08a00 !important;
  stroke-width: 3px !important;
  filter: drop-shadow(0 0 4px rgba(240, 138, 0, 0.35));
}

/* ── Collaborative cursor dots ──────────────────────────────────────────────── */
.collab-cursor {
  position: absolute;
  z-index: 36;
  /* offset so the dot is centered on the actual mouse tip */
  transform: translate(-6px, -6px);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  /* smooth glide between throttled position updates */
  transition: left 0.07s linear, top 0.07s linear;
}

.collab-cursor-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  /* background-color set via inline style from awareness user.color */
}

.collab-cursor-label {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 6px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  /* background-color set via inline style from awareness user.color */
}

.connection-anchor-handles {
  position: absolute;
  inset: 0;
  z-index: 16;
  pointer-events: none;
  --connection-anchor-handle-size: 18px;
}

.connection-anchor-handles[hidden] {
  display: none;
}

.connection-anchor-handle {
  position: absolute;
  width: var(--connection-anchor-handle-size);
  height: var(--connection-anchor-handle-size);
  margin: 0;
  padding: 0;
  border: 2px solid rgba(247, 251, 255, 0.98);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(43, 109, 178, 0.98), rgba(36, 99, 200, 0.98));
  box-shadow: 0 10px 18px rgba(15, 30, 47, 0.24);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: grab;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.connection-anchor-handle:hover,
.connection-anchor-handle.is-dragging {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 12px 24px rgba(15, 30, 47, 0.32);
}

.connection-anchor-handle.is-dragging {
  cursor: grabbing;
}

.canvas-shell.is-connection-anchor-dragging {
  cursor: grabbing;
}

.connection-segment-handles {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.connection-segment-handles[hidden] {
  display: none;
}

.connection-segment-handle {
  position: absolute;
  pointer-events: auto;
  background: rgba(43, 109, 178, 0.22);
  border: 1.5px solid rgba(43, 109, 178, 0.6);
  border-radius: 4px;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.connection-segment-handle.is-horizontal {
  height: 10px;
  min-width: 20px;
  cursor: ns-resize;
  transform: translateY(-50%);
}

.connection-segment-handle.is-vertical {
  width: 10px;
  min-height: 20px;
  cursor: ew-resize;
  transform: translateX(-50%);
}

.connection-segment-handle:hover {
  background: rgba(43, 109, 178, 0.42);
  border-color: rgba(43, 109, 178, 0.9);
  box-shadow: 0 2px 8px rgba(43, 109, 178, 0.3);
}

.canvas-shell.is-segment-dragging-h {
  cursor: ns-resize;
}

.canvas-shell.is-segment-dragging-v {
  cursor: ew-resize;
}

.status-banner {
  position: absolute;
  left: 12px;
  right: auto;
  bottom: 12px;
  z-index: 120;
  padding: 8px 12px;
  border-radius: 10px;
  backdrop-filter: blur(12px);
  color: #fff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  max-width: min(540px, calc(100% - 96px));
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.status-banner.is-hidden {
  opacity: 0;
  transform: translateY(8px);
}

.status-banner.info {
  background: rgba(43, 109, 178, 0.9);
}

.status-banner.success {
  background: rgba(47, 111, 80, 0.92);
}

.status-banner.warning {
  background: rgba(36, 99, 200, 0.92);
}

.status-banner.error {
  background: rgba(165, 48, 48, 0.92);
}

/* ── LLM task toast (prawy górny róg canvasu) ──────────────────────── */

.llm-task-toast {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 121;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 13px 9px 12px;
  border-radius: 10px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  max-width: min(380px, calc(100vw - 32px));
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
  color: #fff;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 200ms ease, transform 200ms ease;
  cursor: default;
  pointer-events: auto;
}

.llm-task-toast[hidden] {
  display: none;
}

.llm-task-toast.is-hiding {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.llm-task-toast__icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1.45;
}

.llm-task-toast__text {
  flex: 1 1 auto;
  word-break: break-word;
}

.llm-task-toast__close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 0 0 0 6px;
  margin: 0;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  font-family: inherit;
  transition: opacity 120ms;
}

.llm-task-toast__close:hover {
  opacity: 1;
}

/* stany */
.llm-task-toast.pending {
  background: rgba(140, 100, 0, 0.88);
  animation: llmToastPulse 1.4s ease-in-out infinite;
}

.llm-task-toast.success {
  background: rgba(33, 110, 72, 0.92);
  animation: none;
}

.llm-task-toast.error {
  background: rgba(155, 40, 40, 0.94);
  animation: none;
}

@keyframes llmToastPulse {
  0%   { box-shadow: 0 4px 18px rgba(0,0,0,0.18), 0 0 0 0 rgba(214, 166, 0, 0.55); }
  60%  { box-shadow: 0 4px 18px rgba(0,0,0,0.18), 0 0 0 10px rgba(214, 166, 0, 0); }
  100% { box-shadow: 0 4px 18px rgba(0,0,0,0.18), 0 0 0 0 rgba(214, 166, 0, 0); }
}

/* ── koniec LLM task toast ─────────────────────────────────────────── */

/* ── Live task monitor panel ────────────────────────────────────────── */

.live-panel-wrapper {
  padding: 0;
  overflow: hidden;
  height: 100%;
}

.live-panel {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 340px;
  overflow: hidden;
}

.live-panel-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px 10px 10px;
  border-right: 1px solid var(--border-color, #e5e7eb);
  overflow-y: auto;
  background: var(--panel-bg, #f8f9fb);
}

.live-panel-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 2px;
}

.live-tasks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e5e7eb);
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, border-color 0.12s;
}

.live-task-item:hover {
  background: #f0f2f5;
  border-color: var(--accent-muted, #c7d2fe);
}

.live-task-item.is-selected {
  background: var(--accent-bg, #eff2ff);
  border-color: var(--accent-color, #6366f1);
}

.live-task-username {
  font-weight: 600;
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-task-elapsed {
  font-size: 0.66rem;
  color: var(--text-secondary, #6b7280);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.live-panel-viewer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  min-height: 0;
  overflow-y: auto;
}

.live-stream-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.live-stream-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.live-stream-tab {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 11px;
}

.live-stream-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 6px;
}

.live-stream-panel[hidden] {
  display: none;
}

.live-stream-panel .llm-user-label {
  margin: 0;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.live-stream-textarea {
  flex: 1 1 auto;
  resize: none;
  font-family: var(--mono-font, "SFMono-Regular", Consolas, monospace);
  font-size: 10px;
  line-height: 1.35;
  min-height: 0;
  max-height: none;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f8f9fb;
  overflow-wrap: break-word;  /* łamie długie tokeny (matematyka, JSON) */
  word-break: break-word;
}

@media (max-width: 1100px) {
  .live-panel {
    grid-template-columns: 180px 1fr;
  }
}

@media (max-width: 860px) {
  .live-panel {
    grid-template-columns: 1fr;
  }

  .live-panel-list {
    max-height: 130px;
    border-right: none;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
  }

  .live-stream-textarea {
    min-height: 0;
  }
}

/* ── koniec live task monitor panel ─────────────────────────────────── */

.validation-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  align-content: start;
  scrollbar-width: thin;
}

#validationSummary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.validation-item,
.validation-empty {
  border: 1px solid rgba(25, 42, 63, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.validation-empty {
  padding: 8px 10px;
  color: var(--muted);
  line-height: 1.3;
  font-size: 10px;
}

.validation-item {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
}

.validation-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.validation-severity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.validation-severity.error {
  background: rgba(207, 67, 67, 0.12);
  color: var(--danger-strong);
}

.validation-severity.warn {
  background: rgba(36, 99, 200, 0.12);
  color: var(--primary-strong);
}

.validation-target {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.validation-message {
  line-height: 1.3;
  font-size: 11px;
}

.validation-rule {
  color: var(--muted);
  font-size: 10px;
}

.inline-task-editor {
  position: absolute;
  z-index: 14;
  pointer-events: auto;
}

.inline-task-editor[hidden] {
  display: none;
}

.inline-task-editor-input {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(43, 109, 178, 0.38);
  border-radius: 12px;
  padding: 10px 12px;
  resize: none;
  outline: none;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  text-align: center;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 10px 22px rgba(43, 109, 178, 0.14);
}

.inline-task-editor-input:focus {
  border-color: rgba(43, 109, 178, 0.62);
  box-shadow: 0 12px 26px rgba(43, 109, 178, 0.2);
}

.context-pad-trigger {
  position: absolute;
  z-index: 15;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(25, 42, 63, 0.14);
  border-radius: 999px;
  background: rgba(247, 251, 255, 0.98);
  box-shadow: 0 12px 20px rgba(18, 35, 53, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.context-pad-trigger[hidden] {
  display: none;
}

.context-pad-trigger:hover,
.context-pad-trigger.is-open {
  transform: translateY(-1px);
  background: rgba(236, 247, 255, 0.98);
  box-shadow: 0 14px 24px rgba(18, 35, 53, 0.2);
}

.context-pad-trigger-glyph {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background:
    linear-gradient(rgba(36, 99, 200, 0.88), rgba(36, 99, 200, 0.88)) 0 0/3px 3px no-repeat,
    linear-gradient(rgba(43, 109, 178, 0.88), rgba(43, 109, 178, 0.88)) 7px 0/3px 3px no-repeat,
    linear-gradient(rgba(49, 111, 80, 0.88), rgba(49, 111, 80, 0.88)) 0 7px/3px 3px no-repeat,
    linear-gradient(rgba(25, 42, 63, 0.82), rgba(25, 42, 63, 0.82)) 7px 7px/3px 3px no-repeat;
}

.djs-palette {
  display: none;
}

.djs-container .djs-context-pad .entry:hover,
.djs-container .djs-popup .entry:hover {
  background: rgba(36, 99, 200, 0.12);
}

.djs-container .djs-context-pad {
  display: grid;
  width: max-content;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(247, 251, 255, 0.96);
  border: 1px solid rgba(25, 42, 63, 0.12);
  box-shadow: 0 12px 24px rgba(18, 35, 53, 0.12);
  padding: 3px;
  gap: 3px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.96);
  transition: opacity 120ms ease, transform 120ms ease;
}

.djs-container .djs-context-pad.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.djs-container .djs-context-pad .group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 34px;
  gap: 3px;
  width: max-content;
  padding: 0;
}

.djs-container .djs-context-pad .group + .group {
  border-top: 1px solid rgba(25, 42, 63, 0.08);
  padding-top: 3px;
}

.djs-container .djs-context-pad .entry {
  float: none;
  display: block;
  margin: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.djs-container .djs-context-pad .entry.is-current-type {
  background: rgba(47, 111, 80, 0.14);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 80, 0.28);
}

.djs-container .djs-context-pad .entry.is-picker-open {
  background: rgba(43, 109, 178, 0.14);
  box-shadow: inset 0 0 0 1px rgba(43, 109, 178, 0.24);
}

.context-type-picker {
  position: absolute;
  z-index: 22;
  min-width: 204px;
  max-width: 228px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(248, 252, 255, 0.98);
  box-shadow: 0 20px 40px rgba(18, 35, 53, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  transition: opacity 120ms ease, transform 120ms ease;
}

.context-type-picker.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.context-type-picker-heading {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: rgba(18, 34, 52, 0.92);
}

.context-type-picker-hint {
  margin: 4px 0 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: rgba(79, 95, 116, 0.86);
}

.context-type-picker-list {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.context-type-picker-option {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 7px;
  border: 1px solid rgba(25, 42, 63, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: rgba(18, 34, 52, 0.92);
  cursor: pointer;
  text-align: left;
}

.context-type-picker-option:hover {
  border-color: rgba(43, 109, 178, 0.24);
  background: rgba(246, 250, 255, 0.96);
}

.context-type-picker-option.is-current-type {
  border-color: rgba(47, 111, 80, 0.28);
  background: rgba(231, 248, 243, 0.94);
}

.context-type-picker-option-label {
  min-width: 0;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
}

.context-type-picker-option-icon {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(241, 248, 255, 0.94);
}

.context-type-picker[data-family-key="event"] {
  min-width: 188px;
  max-width: 210px;
  padding: 8px;
  border-radius: 14px;
}

.context-type-picker[data-family-key="event"] .context-type-picker-hint {
  margin-top: 3px;
  font-size: 0.64rem;
  line-height: 1.3;
}

.context-type-picker[data-family-key="event"] .context-type-picker-list {
  gap: 4px;
  margin-top: 6px;
}

.context-type-picker[data-family-key="event"] .context-type-picker-option {
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 7px;
  padding: 4px 6px;
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-label,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-label {
  font-size: 0.72rem;
  line-height: 1.15;
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  transform: scale(0.92);
  transform-origin: center;
}

.context-type-picker[data-family-key="task"] .context-type-picker-task-icon {
  display: grid;
  place-items: center;
}

.context-type-picker[data-family-key="task"] .context-type-picker-task-glyph-svg {
  width: 24px;
  height: 24px;
  display: block;
}

.context-type-picker[data-family-key="boundary"] .context-type-picker-boundary-icon {
  display: grid;
  place-items: center;
}

.context-type-picker[data-family-key="boundary"] .context-type-picker-boundary-glyph-svg {
  width: 24px;
  height: 24px;
  display: block;
}

.context-type-picker[data-family-key="gateway"] .context-type-picker-gateway-icon {
  display: grid;
  place-items: center;
}

.context-type-picker[data-family-key="gateway"] .context-type-picker-gateway-glyph-svg {
  width: 24px;
  height: 24px;
  display: block;
}

.context-type-picker[data-family-key="event"] .context-type-picker-event-icon {
  display: grid;
  place-items: center;
}

.context-type-picker[data-family-key="event"] .context-type-picker-event-glyph-svg {
  width: 24px;
  height: 24px;
  display: block;
}

.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-task::before,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-task::after,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-user-task::before,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-user-task::after,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-service-task::before,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-service-task::after,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-script-task::before,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-script-task::after,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-manual-task::before,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-manual-task::after,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-business-rule-task::before,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-business-rule-task::after,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-send-task::before,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-send-task::after,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-receive-task::before,
.context-type-picker[data-family-key="task"] .context-type-picker-option-icon.context-pad-icon-switch-receive-task::after {
  content: none !important;
}

.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-message-event::before,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-message-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-timer-event::before,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-timer-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-conditional-event::before,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-conditional-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-signal-event::before,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-signal-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-error-event::before,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-error-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-escalation-event::before,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-escalation-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-compensation-event::before,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-compensation-event::after {
  content: none !important;
}

.context-type-picker[data-family-key="gateway"] .context-type-picker-option-icon.context-pad-icon-switch-exclusive-gateway::before,
.context-type-picker[data-family-key="gateway"] .context-type-picker-option-icon.context-pad-icon-switch-exclusive-gateway::after,
.context-type-picker[data-family-key="gateway"] .context-type-picker-option-icon.context-pad-icon-switch-parallel-gateway::before,
.context-type-picker[data-family-key="gateway"] .context-type-picker-option-icon.context-pad-icon-switch-parallel-gateway::after,
.context-type-picker[data-family-key="gateway"] .context-type-picker-option-icon.context-pad-icon-switch-inclusive-gateway::before,
.context-type-picker[data-family-key="gateway"] .context-type-picker-option-icon.context-pad-icon-switch-inclusive-gateway::after,
.context-type-picker[data-family-key="gateway"] .context-type-picker-option-icon.context-pad-icon-switch-event-based-gateway::before,
.context-type-picker[data-family-key="gateway"] .context-type-picker-option-icon.context-pad-icon-switch-event-based-gateway::after,
.context-type-picker[data-family-key="gateway"] .context-type-picker-option-icon.context-pad-icon-switch-complex-gateway::before,
.context-type-picker[data-family-key="gateway"] .context-type-picker-option-icon.context-pad-icon-switch-complex-gateway::after {
  content: none !important;
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-start-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-start-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-intermediate-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-intermediate-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-end-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-end-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-message-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-message-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-timer-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-timer-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-conditional-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-conditional-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-signal-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-signal-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-error-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-error-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-escalation-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-escalation-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-cancel-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-cancel-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-compensation-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-compensation-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-link-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-link-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-multiple-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-multiple-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-parallel-multiple-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-parallel-multiple-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-terminate-event::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-terminate-event::after {
  content: none !important;
}

.context-type-picker-option-icon.context-pad-icon-switch-start-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-intermediate-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-end-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-message-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-timer-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-conditional-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-signal-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-error-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-escalation-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-cancel-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-compensation-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-link-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-multiple-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-parallel-multiple-event::before,
.context-type-picker-option-icon.context-pad-icon-switch-terminate-event::before {
  left: 6px;
  top: 6px;
}

.context-pad-icon-open-task-types,
.context-pad-icon-open-gateway-types,
.context-pad-icon-open-event-types,
.context-pad-icon-open-boundary-types,
.context-pad-icon-open-association-types {
  position: relative;
}

.context-pad-icon-open-task-types::before,
.context-pad-icon-open-task-types::after,
.context-pad-icon-open-gateway-types::before,
.context-pad-icon-open-gateway-types::after,
.context-pad-icon-open-event-types::before,
.context-pad-icon-open-event-types::after,
.context-pad-icon-open-boundary-types::before,
.context-pad-icon-open-boundary-types::after,
.context-pad-icon-open-association-types::before,
.context-pad-icon-open-association-types::after {
  content: "";
  position: absolute;
}

.context-pad-icon-open-task-types::before {
  left: 50%;
  top: 50%;
  width: 17px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 4px;
  border: 2px solid rgba(43, 109, 178, 0.84);
  background: rgba(255, 255, 255, 0.94);
}

.context-pad-icon-open-gateway-types::before {
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 2px solid rgba(36, 99, 200, 0.88);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(236, 247, 255, 0.94));
  box-sizing: border-box;
}

.context-pad-icon-open-event-types::before {
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 3px solid rgba(47, 111, 80, 0.88);
  background: rgba(255, 255, 255, 0.96);
}

.context-pad-icon-open-boundary-types::before {
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 3px double rgba(47, 111, 80, 0.88);
  border-bottom-color: rgba(47, 111, 80, 0.38);
  background: rgba(255, 255, 255, 0.96);
}

.context-pad-icon-open-association-types::before {
  left: 7px;
  top: 14px;
  width: 16px;
  height: 0;
  border-top: 2px dashed rgba(18, 34, 52, 0.72);
}

.context-pad-icon-open-task-types::after,
.context-pad-icon-open-gateway-types::after,
.context-pad-icon-open-event-types::after,
.context-pad-icon-open-boundary-types::after,
.context-pad-icon-open-association-types::after {
  right: 6px;
  top: 9px;
  width: 9px;
  height: 18px;
  background:
    linear-gradient(rgba(79, 95, 116, 0.86), rgba(79, 95, 116, 0.86)) right 0 top 3px/9px 2px no-repeat,
    linear-gradient(rgba(79, 95, 116, 0.86), rgba(79, 95, 116, 0.86)) right 0 top 8px/9px 2px no-repeat,
    linear-gradient(rgba(79, 95, 116, 0.86), rgba(79, 95, 116, 0.86)) right 0 top 13px/9px 2px no-repeat;
}

.context-pad-icon-open-gateway-types::after {
  content: "?";
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  background: transparent;
  color: rgba(36, 99, 200, 0.92);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.context-pad-icon-open-task-types::after {
  content: "?";
  left: 50%;
  top: 50%;
  width: 17px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  background: transparent;
  color: rgba(43, 109, 178, 0.92);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.context-pad-icon-open-event-types::after {
  content: "?";
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  background: transparent;
  color: rgba(47, 111, 80, 0.92);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.context-pad-icon-open-boundary-types::after {
  content: "?";
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  background: transparent;
  color: rgba(47, 111, 80, 0.92);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.context-pad-icon-connect,
.context-pad-icon-message-connect,
.context-pad-icon-remove,
.context-pad-icon-append-task,
.context-pad-icon-append-gateway,
.context-pad-icon-append-end,
.context-pad-icon-rename,
.context-pad-icon-switch-task,
.context-pad-icon-switch-user-task,
.context-pad-icon-switch-service-task,
.context-pad-icon-switch-script-task,
.context-pad-icon-switch-manual-task,
.context-pad-icon-switch-business-rule-task,
.context-pad-icon-switch-send-task,
.context-pad-icon-switch-receive-task,
.context-pad-icon-switch-start-event,
.context-pad-icon-switch-intermediate-event,
.context-pad-icon-switch-end-event,
.context-pad-icon-switch-exclusive-gateway,
.context-pad-icon-switch-parallel-gateway,
.context-pad-icon-switch-association,
.context-pad-icon-switch-directed-association,
.context-pad-icon-switch-bidirectional-association,
.context-pad-icon-inside-task,
.context-pad-icon-inside-start,
.context-pad-icon-inside-intermediate,
.context-pad-icon-inside-user-task,
.context-pad-icon-inside-service-task,
.context-pad-icon-inside-script-task,
.context-pad-icon-inside-manual-task,
.context-pad-icon-inside-business-rule-task,
.context-pad-icon-inside-send-task,
.context-pad-icon-inside-receive-task,
.context-pad-icon-inside-subprocess,
.context-pad-icon-create-linked-diagram,
.context-pad-icon-open-linked-diagram,
.context-pad-icon-inside-exclusive-gateway,
.context-pad-icon-inside-parallel-gateway,
.context-pad-icon-inside-end,
.context-pad-icon-add-lane {
  position: relative;
}

.context-pad-icon-group-color-amber,
.context-pad-icon-group-color-mint,
.context-pad-icon-group-color-sky,
.context-pad-icon-group-color-coral,
.context-pad-icon-group-color-slate,
.context-pad-icon-group-color-olive {
  position: relative;
}

.context-pad-icon-group-color-amber::before,
.context-pad-icon-group-color-mint::before,
.context-pad-icon-group-color-sky::before,
.context-pad-icon-group-color-coral::before,
.context-pad-icon-group-color-slate::before,
.context-pad-icon-group-color-olive::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 2px solid transparent;
}

.context-pad-icon-group-color-amber::before {
  border-color: #a77d46;
  background: rgba(255, 247, 235, 0.95);
}

.context-pad-icon-group-color-mint::before {
  border-color: #4f8a69;
  background: rgba(236, 249, 241, 0.95);
}

.context-pad-icon-group-color-sky::before {
  border-color: #4d7fb0;
  background: rgba(236, 245, 255, 0.95);
}

.context-pad-icon-group-color-coral::before {
  border-color: #b86a5b;
  background: rgba(255, 239, 235, 0.95);
}

.context-pad-icon-group-color-slate::before {
  border-color: #657488;
  background: rgba(241, 246, 251, 0.95);
}

.context-pad-icon-group-color-olive::before {
  border-color: #8a8a4d;
  background: rgba(249, 249, 236, 0.95);
}

.context-pad-icon-connect::before,
.context-pad-icon-message-connect::before,
.context-pad-icon-message-connect::after,
.context-pad-icon-remove::before,
.context-pad-icon-remove::after,
.context-pad-icon-append-task::before,
.context-pad-icon-append-task::after,
.context-pad-icon-append-gateway::before,
.context-pad-icon-append-gateway::after,
.context-pad-icon-append-end::before,
.context-pad-icon-append-end::after,
.context-pad-icon-rename::before,
.context-pad-icon-rename::after,
.context-pad-icon-switch-task::before,
.context-pad-icon-switch-task::after,
.context-pad-icon-switch-user-task::before,
.context-pad-icon-switch-user-task::after,
.context-pad-icon-switch-service-task::before,
.context-pad-icon-switch-service-task::after,
.context-pad-icon-switch-script-task::before,
.context-pad-icon-switch-script-task::after,
.context-pad-icon-switch-manual-task::before,
.context-pad-icon-switch-manual-task::after,
.context-pad-icon-switch-business-rule-task::before,
.context-pad-icon-switch-business-rule-task::after,
.context-pad-icon-switch-send-task::before,
.context-pad-icon-switch-send-task::after,
.context-pad-icon-switch-receive-task::before,
.context-pad-icon-switch-receive-task::after,
.context-pad-icon-switch-start-event::before,
.context-pad-icon-switch-start-event::after,
.context-pad-icon-switch-intermediate-event::before,
.context-pad-icon-switch-intermediate-event::after,
.context-pad-icon-switch-end-event::before,
.context-pad-icon-switch-end-event::after,
.context-pad-icon-switch-exclusive-gateway::before,
.context-pad-icon-switch-exclusive-gateway::after,
.context-pad-icon-switch-parallel-gateway::before,
.context-pad-icon-switch-parallel-gateway::after,
.context-pad-icon-switch-association::before,
.context-pad-icon-switch-association::after,
.context-pad-icon-switch-directed-association::before,
.context-pad-icon-switch-directed-association::after,
.context-pad-icon-switch-bidirectional-association::before,
.context-pad-icon-switch-bidirectional-association::after,
.context-pad-icon-inside-start::before,
.context-pad-icon-inside-start::after,
.context-pad-icon-inside-intermediate::before,
.context-pad-icon-inside-intermediate::after,
.context-pad-icon-inside-task::before,
.context-pad-icon-inside-task::after,
.context-pad-icon-inside-user-task::before,
.context-pad-icon-inside-user-task::after,
.context-pad-icon-inside-service-task::before,
.context-pad-icon-inside-service-task::after,
.context-pad-icon-inside-script-task::before,
.context-pad-icon-inside-script-task::after,
.context-pad-icon-inside-manual-task::before,
.context-pad-icon-inside-manual-task::after,
.context-pad-icon-inside-business-rule-task::before,
.context-pad-icon-inside-business-rule-task::after,
.context-pad-icon-inside-send-task::before,
.context-pad-icon-inside-send-task::after,
.context-pad-icon-inside-receive-task::before,
.context-pad-icon-inside-receive-task::after,
.context-pad-icon-inside-subprocess::before,
.context-pad-icon-inside-subprocess::after,
.context-pad-icon-create-linked-diagram::before,
.context-pad-icon-create-linked-diagram::after,
.context-pad-icon-open-linked-diagram::before,
.context-pad-icon-open-linked-diagram::after,
.context-pad-icon-inside-exclusive-gateway::before,
.context-pad-icon-inside-exclusive-gateway::after,
.context-pad-icon-inside-parallel-gateway::before,
.context-pad-icon-inside-parallel-gateway::after,
.context-pad-icon-inside-end::before,
.context-pad-icon-inside-end::after,
.context-pad-icon-add-lane::before,
.context-pad-icon-add-lane::after {
  content: "";
  position: absolute;
}

.context-pad-icon-connect::before {
  left: 7px;
  top: 15px;
  width: 18px;
  height: 2px;
  background: rgba(18, 34, 52, 0.82);
}

.context-pad-icon-connect::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 11px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid rgba(18, 34, 52, 0.82);
}

.context-pad-icon-message-connect::before {
  left: 7px;
  top: 15px;
  width: 18px;
  height: 0;
  border-top: 2px dashed rgba(18, 34, 52, 0.72);
}

.context-pad-icon-message-connect::after {
  right: 7px;
  top: 11px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid rgba(18, 34, 52, 0.72);
}

.context-pad-icon-switch-association::before,
.context-pad-icon-switch-directed-association::before,
.context-pad-icon-switch-bidirectional-association::before {
  left: 7px;
  top: 15px;
  width: 18px;
  height: 0;
  border-top: 2px dashed rgba(18, 34, 52, 0.78);
}

.context-pad-icon-switch-directed-association::after {
  right: 7px;
  top: 13px;
  width: 0;
  height: 0;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-left: 6px solid rgba(18, 34, 52, 0.78);
}

.context-pad-icon-switch-bidirectional-association::after {
  left: 6px;
  top: 12px;
  width: 20px;
  height: 7px;
  background:
    linear-gradient(135deg, transparent 46%, rgba(18, 34, 52, 0.78) 46% 54%, transparent 54%) left 0 top 2px/4px 4px no-repeat,
    linear-gradient(-135deg, transparent 46%, rgba(18, 34, 52, 0.78) 46% 54%, transparent 54%) left 0 top 2px/4px 4px no-repeat,
    linear-gradient(45deg, transparent 46%, rgba(18, 34, 52, 0.78) 46% 54%, transparent 54%) right 0 top 2px/4px 4px no-repeat,
    linear-gradient(-45deg, transparent 46%, rgba(18, 34, 52, 0.78) 46% 54%, transparent 54%) right 0 top 2px/4px 4px no-repeat;
}

.context-pad-icon-remove::before,
.context-pad-icon-remove::after {
  left: 8px;
  top: 16px;
  width: 18px;
  height: 2px;
  background: rgba(165, 48, 48, 0.88);
}

.context-pad-icon-remove::before {
  transform: rotate(45deg);
}

.context-pad-icon-remove::after {
  transform: rotate(-45deg);
}

.context-pad-icon-append-task::before,
.context-pad-icon-switch-task::before,
.context-pad-icon-switch-user-task::before,
.context-pad-icon-switch-service-task::before,
.context-pad-icon-switch-script-task::before,
.context-pad-icon-switch-manual-task::before,
.context-pad-icon-switch-business-rule-task::before,
.context-pad-icon-switch-send-task::before,
.context-pad-icon-switch-receive-task::before,
.context-pad-icon-inside-task::before,
.context-pad-icon-inside-user-task::before,
.context-pad-icon-inside-service-task::before,
.context-pad-icon-inside-script-task::before,
.context-pad-icon-inside-manual-task::before,
.context-pad-icon-inside-business-rule-task::before,
.context-pad-icon-inside-send-task::before,
.context-pad-icon-inside-receive-task::before,
.context-pad-icon-inside-subprocess::before,
.context-pad-icon-create-linked-diagram::before,
.context-pad-icon-open-linked-diagram::before {
  left: 50%;
  top: 50%;
  width: 20px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 5px;
  border: 2px solid rgba(43, 109, 178, 0.8);
  background: rgba(255, 255, 255, 0.94);
}

.context-pad-icon-append-task::after,
.context-pad-icon-inside-task::after,
.context-pad-icon-inside-user-task::after,
.context-pad-icon-inside-service-task::after,
.context-pad-icon-inside-script-task::after,
.context-pad-icon-inside-manual-task::after,
.context-pad-icon-inside-business-rule-task::after,
.context-pad-icon-inside-send-task::after,
.context-pad-icon-inside-receive-task::after,
.context-pad-icon-inside-subprocess::after {
  right: 6px;
  bottom: 6px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(rgba(47, 111, 80, 0.9), rgba(47, 111, 80, 0.9)) center/2px 8px no-repeat,
    linear-gradient(rgba(47, 111, 80, 0.9), rgba(47, 111, 80, 0.9)) center/8px 2px no-repeat,
    rgba(231, 248, 243, 0.96);
  border: 1px solid rgba(47, 111, 80, 0.28);
}

.context-pad-icon-create-linked-diagram::after {
  right: 6px;
  bottom: 6px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(rgba(47, 111, 80, 0.9), rgba(47, 111, 80, 0.9)) center/2px 8px no-repeat,
    linear-gradient(rgba(47, 111, 80, 0.9), rgba(47, 111, 80, 0.9)) center/8px 2px no-repeat,
    rgba(231, 248, 243, 0.96);
  border: 1px solid rgba(47, 111, 80, 0.28);
}

.context-pad-icon-open-linked-diagram::after {
  right: 6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-top: 2px solid rgba(43, 109, 178, 0.9);
  border-right: 2px solid rgba(43, 109, 178, 0.9);
  transform: translateY(1px);
}

.context-pad-icon-switch-user-task::after,
.context-pad-icon-switch-service-task::after,
.context-pad-icon-switch-script-task::after,
.context-pad-icon-switch-manual-task::after,
.context-pad-icon-switch-business-rule-task::after,
.context-pad-icon-switch-send-task::after,
.context-pad-icon-switch-receive-task::after,
.context-pad-icon-switch-exclusive-gateway::after,
.context-pad-icon-switch-parallel-gateway::after {
  display: grid;
  place-items: center;
  color: rgba(18, 34, 52, 0.88);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.context-pad-icon-switch-user-task::after,
.context-pad-icon-switch-service-task::after,
.context-pad-icon-switch-script-task::after,
.context-pad-icon-switch-manual-task::after,
.context-pad-icon-switch-business-rule-task::after,
.context-pad-icon-switch-send-task::after,
.context-pad-icon-switch-receive-task::after {
  right: 6px;
  bottom: 7px;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: rgba(236, 247, 255, 0.98);
  border: 1px solid rgba(36, 99, 200, 0.22);
}

.context-type-picker-option-icon.context-pad-icon-switch-user-task::after,
.context-type-picker-option-icon.context-pad-icon-switch-service-task::after,
.context-type-picker-option-icon.context-pad-icon-switch-script-task::after,
.context-type-picker-option-icon.context-pad-icon-switch-manual-task::after,
.context-type-picker-option-icon.context-pad-icon-switch-business-rule-task::after,
.context-type-picker-option-icon.context-pad-icon-switch-send-task::after,
.context-type-picker-option-icon.context-pad-icon-switch-receive-task::after {
  left: 18px;
  top: 17px;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%) scale(0.86);
  transform-origin: center;
}

.context-pad-icon-switch-user-task::after {
  content: "";
  background:
    radial-gradient(circle at 50% 30%, rgba(18, 34, 52, 0.88) 0 18%, transparent 20%),
    radial-gradient(ellipse at 50% 78%, rgba(18, 34, 52, 0.88) 0 34%, transparent 36%),
    rgba(236, 247, 255, 0.98);
}

.context-pad-icon-switch-service-task::after {
  content: "";
  background:
    radial-gradient(circle at 50% 50%, transparent 0 20%, rgba(18, 34, 52, 0.88) 21% 31%, transparent 32%),
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) center/2px 9px no-repeat,
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) center/9px 2px no-repeat,
    linear-gradient(45deg, transparent 42%, rgba(18, 34, 52, 0.88) 42% 58%, transparent 58%) center/9px 9px no-repeat,
    linear-gradient(-45deg, transparent 42%, rgba(18, 34, 52, 0.88) 42% 58%, transparent 58%) center/9px 9px no-repeat,
    rgba(236, 247, 255, 0.98);
}

.context-pad-icon-switch-script-task::after {
  content: "";
  background:
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) 3px 4px/6px 1.2px no-repeat,
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) 3px 7px/5px 1.2px no-repeat,
    linear-gradient(135deg, transparent 50%, rgba(18, 34, 52, 0.88) 50%) 8px 2px/3px 3px no-repeat,
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) center/7px 9px no-repeat,
    rgba(236, 247, 255, 0.98);
}

.context-pad-icon-switch-manual-task::after {
  content: "";
  background:
    radial-gradient(circle at 32% 72%, rgba(18, 34, 52, 0.88) 0 18%, transparent 20%),
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) 3px 3px/1.4px 6px no-repeat,
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) 5px 2px/1.4px 7px no-repeat,
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) 7px 3px/1.4px 6px no-repeat,
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) 9px 4px/1.4px 5px no-repeat,
    linear-gradient(135deg, transparent 44%, rgba(18, 34, 52, 0.88) 44% 58%, transparent 58%) 5px 7px/6px 4px no-repeat,
    rgba(236, 247, 255, 0.98);
}

.context-pad-icon-switch-business-rule-task::after {
  content: "";
  background:
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) center 4px/8px 1.2px no-repeat,
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) center 7px/8px 1.2px no-repeat,
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) 4px center/1.2px 8px no-repeat,
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) 8px center/1.2px 8px no-repeat,
    rgba(236, 247, 255, 0.98);
}

.context-pad-icon-switch-send-task::after {
  content: "";
  background:
    linear-gradient(33deg, transparent 46%, rgba(18, 34, 52, 0.88) 46% 54%, transparent 54%) center/9px 6px no-repeat,
    linear-gradient(-33deg, transparent 46%, rgba(18, 34, 52, 0.88) 46% 54%, transparent 54%) center/9px 6px no-repeat,
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) center/8px 5px no-repeat,
    rgba(236, 247, 255, 0.98);
}

.context-pad-icon-switch-receive-task::after {
  content: "";
  background:
    linear-gradient(33deg, transparent 46%, rgba(18, 34, 52, 0.88) 46% 54%, transparent 54%) center/9px 6px no-repeat,
    linear-gradient(-33deg, transparent 46%, rgba(18, 34, 52, 0.88) 46% 54%, transparent 54%) center/9px 6px no-repeat,
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) center/8px 5px no-repeat,
    linear-gradient(rgba(18, 34, 52, 0.88), rgba(18, 34, 52, 0.88)) center 9px/6px 1.2px no-repeat,
    linear-gradient(135deg, transparent 46%, rgba(18, 34, 52, 0.88) 46% 54%, transparent 54%) 3px 9px/3px 3px no-repeat,
    linear-gradient(-135deg, transparent 46%, rgba(18, 34, 52, 0.88) 46% 54%, transparent 54%) 3px 9px/3px 3px no-repeat,
    rgba(236, 247, 255, 0.98);
}

.context-pad-icon-inside-user-task::after,
.context-pad-icon-inside-service-task::after,
.context-pad-icon-inside-script-task::after,
.context-pad-icon-inside-manual-task::after,
.context-pad-icon-inside-business-rule-task::after,
.context-pad-icon-inside-send-task::after,
.context-pad-icon-inside-receive-task::after,
.context-pad-icon-inside-subprocess::after,
.context-pad-icon-inside-exclusive-gateway::after,
.context-pad-icon-inside-parallel-gateway::after {
  display: grid;
  place-items: center;
  color: rgba(18, 34, 52, 0.88);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.context-pad-icon-inside-user-task::after {
  content: "U";
}

.context-pad-icon-inside-service-task::after {
  content: "S";
}

.context-pad-icon-inside-script-task::after {
  content: "Sc";
  font-size: 7px;
}

.context-pad-icon-inside-manual-task::after {
  content: "M";
}

.context-pad-icon-inside-business-rule-task::after {
  content: "BR";
  font-size: 7px;
}

.context-pad-icon-inside-send-task::after {
  content: ">";
}

.context-pad-icon-inside-receive-task::after {
  content: "<";
}

.context-pad-icon-inside-subprocess::after {
  content: "+";
}

.context-pad-icon-inside-start::before,
.context-pad-icon-inside-end::before,
.context-pad-icon-switch-start-event::before,
.context-pad-icon-switch-end-event::before,
.context-pad-icon-inside-intermediate::before {
  left: 9px;
  top: 9px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
}

.context-pad-icon-inside-start::before {
  border: 3px solid rgba(47, 111, 80, 0.88);
}

.context-pad-icon-switch-start-event::before {
  border: 3px solid rgba(47, 111, 80, 0.88);
}

.context-pad-icon-inside-intermediate::before {
  border: 2px solid rgba(70, 116, 179, 0.88);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.96), inset 0 0 0 5px rgba(70, 116, 179, 0.88);
}

.context-pad-icon-switch-intermediate-event::before {
  left: 9px;
  top: 9px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(70, 116, 179, 0.88);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.96), inset 0 0 0 5px rgba(70, 116, 179, 0.88);
}

.context-pad-icon-inside-end::before {
  border: 4px solid rgba(207, 67, 67, 0.86);
}

.context-pad-icon-switch-end-event::before {
  border: 4px solid rgba(207, 67, 67, 0.86);
}

.context-pad-icon-switch-message-event,
.context-pad-icon-switch-timer-event,
.context-pad-icon-switch-conditional-event,
.context-pad-icon-switch-signal-event,
.context-pad-icon-switch-error-event,
.context-pad-icon-switch-escalation-event,
.context-pad-icon-switch-cancel-event,
.context-pad-icon-switch-compensation-event,
.context-pad-icon-switch-link-event,
.context-pad-icon-switch-multiple-event,
.context-pad-icon-switch-parallel-multiple-event,
.context-pad-icon-switch-terminate-event {
  position: relative;
}

.context-pad-icon-switch-message-event::before,
.context-pad-icon-switch-message-event::after,
.context-pad-icon-switch-timer-event::before,
.context-pad-icon-switch-timer-event::after,
.context-pad-icon-switch-conditional-event::before,
.context-pad-icon-switch-conditional-event::after,
.context-pad-icon-switch-signal-event::before,
.context-pad-icon-switch-signal-event::after,
.context-pad-icon-switch-error-event::before,
.context-pad-icon-switch-error-event::after,
.context-pad-icon-switch-escalation-event::before,
.context-pad-icon-switch-escalation-event::after,
.context-pad-icon-switch-cancel-event::before,
.context-pad-icon-switch-cancel-event::after,
.context-pad-icon-switch-compensation-event::before,
.context-pad-icon-switch-compensation-event::after,
.context-pad-icon-switch-link-event::before,
.context-pad-icon-switch-link-event::after,
.context-pad-icon-switch-multiple-event::before,
.context-pad-icon-switch-multiple-event::after,
.context-pad-icon-switch-parallel-multiple-event::before,
.context-pad-icon-switch-parallel-multiple-event::after,
.context-pad-icon-switch-terminate-event::before,
.context-pad-icon-switch-terminate-event::after {
  content: "";
  position: absolute;
}

.context-pad-icon-switch-message-event::before,
.context-pad-icon-switch-timer-event::before,
.context-pad-icon-switch-conditional-event::before,
.context-pad-icon-switch-signal-event::before,
.context-pad-icon-switch-compensation-event::before,
.context-pad-icon-switch-link-event::before,
.context-pad-icon-switch-multiple-event::before,
.context-pad-icon-switch-parallel-multiple-event::before {
  left: 9px;
  top: 9px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(70, 116, 179, 0.88);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.96), inset 0 0 0 5px rgba(70, 116, 179, 0.88);
}

.context-pad-icon-switch-error-event::before,
.context-pad-icon-switch-escalation-event::before,
.context-pad-icon-switch-cancel-event::before,
.context-pad-icon-switch-terminate-event::before {
  left: 9px;
  top: 9px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 4px solid rgba(207, 67, 67, 0.86);
}

.context-pad-icon-switch-message-event::after,
.context-pad-icon-switch-timer-event::after,
.context-pad-icon-switch-conditional-event::after,
.context-pad-icon-switch-signal-event::after,
.context-pad-icon-switch-error-event::after,
.context-pad-icon-switch-escalation-event::after,
.context-pad-icon-switch-cancel-event::after,
.context-pad-icon-switch-compensation-event::after,
.context-pad-icon-switch-link-event::after,
.context-pad-icon-switch-multiple-event::after,
.context-pad-icon-switch-parallel-multiple-event::after,
.context-pad-icon-switch-terminate-event::after {
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  color: rgba(18, 34, 52, 0.88);
}

.context-pad-icon-switch-message-event::after {
  content: "M";
}

.context-pad-icon-switch-timer-event::after {
  content: "T";
}

.context-pad-icon-switch-conditional-event::after {
  content: "?";
}

.context-pad-icon-switch-signal-event::after {
  content: "S";
}

.context-pad-icon-switch-error-event::after {
  content: "!";
}

.context-pad-icon-switch-escalation-event::after {
  content: "^";
}

.context-pad-icon-switch-cancel-event::after {
  content: "X";
}

.context-pad-icon-switch-compensation-event::after {
  content: "<<";
  font-size: 7px;
}

.context-pad-icon-switch-link-event::after {
  content: ">";
}

.context-pad-icon-switch-multiple-event::after {
  content: "*";
}

.context-pad-icon-switch-parallel-multiple-event::after {
  content: "+";
}

.context-pad-icon-switch-terminate-event::after {
  margin: auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(207, 67, 67, 0.92);
}

/* End-event variants in the picker must always use end-event red ring styling. */
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:EndEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:MessageEndEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:SignalEndEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:ErrorEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:EscalationEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:CancelEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:CompensationEndEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:MultipleEndEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:TerminateEndEvent"] .context-type-picker-option-icon::before {
  border: 4px solid rgba(207, 67, 67, 0.86);
  box-shadow: none;
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-message-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-timer-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-conditional-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-signal-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-error-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-escalation-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-cancel-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-compensation-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-link-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-multiple-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-parallel-multiple-event::after,
.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-terminate-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-message-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-timer-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-conditional-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-signal-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-error-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-escalation-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-cancel-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-compensation-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-link-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-multiple-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-parallel-multiple-event::after {
  content: "";
  inset: auto;
  transform: none;
  display: block;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-message-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-message-event::after {
  left: 8px;
  top: 10px;
  width: 12px;
  height: 8px;
  border: 1.6px solid rgba(43, 109, 178, 0.92);
  border-radius: 1px;
  background:
    linear-gradient(35deg, transparent 47%, rgba(43, 109, 178, 0.9) 47% 53%, transparent 53%),
    linear-gradient(-35deg, transparent 47%, rgba(43, 109, 178, 0.9) 47% 53%, transparent 53%);
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-timer-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-timer-event::after {
  left: 8.5px;
  top: 8.5px;
  width: 11px;
  height: 11px;
  border: 1.6px solid rgba(43, 109, 178, 0.92);
  border-radius: 999px;
  background:
    linear-gradient(rgba(43, 109, 178, 0.9), rgba(43, 109, 178, 0.9)) center 2px/1.4px 4px no-repeat,
    linear-gradient(rgba(43, 109, 178, 0.9), rgba(43, 109, 178, 0.9)) 66% 52%/3px 1.4px no-repeat,
    radial-gradient(circle at center, rgba(43, 109, 178, 0.9) 0 1.1px, transparent 1.2px);
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-conditional-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-conditional-event::after {
  left: 9.5px;
  top: 8px;
  width: 9px;
  height: 12px;
  border: 1.5px solid rgba(43, 109, 178, 0.92);
  border-radius: 1px;
  background:
    linear-gradient(rgba(43, 109, 178, 0.9), rgba(43, 109, 178, 0.9)) center 2px/5px 1.2px no-repeat,
    linear-gradient(rgba(43, 109, 178, 0.9), rgba(43, 109, 178, 0.9)) center 5px/5px 1.2px no-repeat,
    linear-gradient(rgba(43, 109, 178, 0.9), rgba(43, 109, 178, 0.9)) center 8px/4px 1.2px no-repeat;
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-signal-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-signal-event::after {
  left: 8.5px;
  top: 9px;
  width: 11px;
  height: 10px;
  background: rgba(43, 109, 178, 0.92);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-error-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-error-event::after {
  left: 9px;
  top: 8px;
  width: 10px;
  height: 12px;
  background: rgba(207, 67, 67, 0.92);
  clip-path: polygon(44% 0, 68% 0, 55% 38%, 82% 38%, 34% 100%, 46% 60%, 20% 60%);
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-escalation-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-escalation-event::after {
  left: 8.5px;
  top: 9px;
  width: 11px;
  height: 10px;
  background: rgba(43, 109, 178, 0.92);
  clip-path: polygon(50% 0, 100% 100%, 50% 62%, 0 100%);
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-compensation-event::after,
.context-type-picker[data-family-key="boundary"] .context-type-picker-option-icon.context-pad-icon-switch-compensation-event::after {
  left: 8.5px;
  top: 9px;
  width: 6px;
  height: 10px;
  background: rgba(43, 109, 178, 0.92);
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
  box-shadow: 5px 0 0 0 rgba(43, 109, 178, 0.92);
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-cancel-event::after {
  left: 8.5px;
  top: 8.5px;
  width: 11px;
  height: 11px;
  background:
    linear-gradient(45deg, transparent 44%, rgba(207, 67, 67, 0.92) 44% 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, rgba(207, 67, 67, 0.92) 44% 56%, transparent 56%);
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-link-event::after {
  left: 8px;
  top: 10px;
  width: 12px;
  height: 8px;
  background: rgba(43, 109, 178, 0.92);
  clip-path: polygon(0 35%, 55% 35%, 55% 0, 100% 50%, 55% 100%, 55% 65%, 0 65%);
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-multiple-event::after {
  left: 8.5px;
  top: 8.5px;
  width: 11px;
  height: 11px;
  background: rgba(43, 109, 178, 0.92);
  clip-path: polygon(50% 0, 95% 35%, 77% 92%, 23% 92%, 5% 35%);
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-parallel-multiple-event::after {
  left: 8.5px;
  top: 8.5px;
  width: 11px;
  height: 11px;
  background:
    linear-gradient(rgba(43, 109, 178, 0.92), rgba(43, 109, 178, 0.92)) center/1.8px 11px no-repeat,
    linear-gradient(rgba(43, 109, 178, 0.92), rgba(43, 109, 178, 0.92)) center/11px 1.8px no-repeat;
}

.context-type-picker[data-family-key="event"] .context-type-picker-option-icon.context-pad-icon-switch-terminate-event::after {
  left: 10px;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(18, 34, 52, 0.92);
}

/* Start-event variants in the picker must use start-event green ring styling. */
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:MessageStartEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:TimerStartEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:ConditionalStartEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:SignalStartEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:MultipleStartEvent"] .context-type-picker-option-icon::before,
.context-type-picker[data-family-key="event"] .context-type-picker-option[data-element-type="bpmn:ParallelMultipleStartEvent"] .context-type-picker-option-icon::before {
  border: 3px solid rgba(47, 111, 80, 0.88);
  box-shadow: none;
}

.context-pad-icon-inside-start::after,
.context-pad-icon-inside-intermediate::after,
.context-pad-icon-inside-end::after {
  right: 5px;
  bottom: 5px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(rgba(47, 111, 80, 0.9), rgba(47, 111, 80, 0.9)) center/2px 8px no-repeat,
    linear-gradient(rgba(47, 111, 80, 0.9), rgba(47, 111, 80, 0.9)) center/8px 2px no-repeat,
    rgba(231, 248, 243, 0.96);
  border: 1px solid rgba(47, 111, 80, 0.28);
}

.context-pad-icon-append-gateway::before {
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 2px solid rgba(36, 99, 200, 0.82);
  background: rgba(248, 252, 255, 0.96);
}

.context-pad-icon-append-gateway::after {
  right: 5px;
  bottom: 5px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(rgba(47, 111, 80, 0.9), rgba(47, 111, 80, 0.9)) center/2px 8px no-repeat,
    linear-gradient(rgba(47, 111, 80, 0.9), rgba(47, 111, 80, 0.9)) center/8px 2px no-repeat,
    rgba(231, 248, 243, 0.96);
  border: 1px solid rgba(47, 111, 80, 0.28);
}

.context-pad-icon-inside-exclusive-gateway::before,
.context-pad-icon-switch-exclusive-gateway::before,
.context-pad-icon-switch-parallel-gateway::before,
.context-pad-icon-inside-parallel-gateway::before {
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: rgba(248, 252, 255, 0.96);
}

.context-pad-icon-inside-exclusive-gateway::before {
  border: 2px solid rgba(36, 99, 200, 0.82);
}

.context-pad-icon-switch-exclusive-gateway::before {
  border: 2px solid rgba(36, 99, 200, 0.82);
}

.context-pad-icon-inside-parallel-gateway::before {
  border: 2px solid rgba(103, 115, 156, 0.82);
}

.context-pad-icon-switch-parallel-gateway::before {
  border: 2px solid rgba(103, 115, 156, 0.82);
}

.context-pad-icon-inside-exclusive-gateway::after {
  content: "X";
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
}

.context-pad-icon-switch-exclusive-gateway::after {
  content: "X";
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
}

.context-pad-icon-inside-parallel-gateway::after {
  content: "+";
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
}

.context-pad-icon-switch-parallel-gateway::after {
  content: "+";
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
}

.context-pad-icon-inside-inclusive-gateway,
.context-pad-icon-switch-inclusive-gateway,
.context-pad-icon-inside-event-based-gateway,
.context-pad-icon-switch-event-based-gateway,
.context-pad-icon-inside-complex-gateway,
.context-pad-icon-switch-complex-gateway {
  position: relative;
}

.context-pad-icon-inside-inclusive-gateway::before,
.context-pad-icon-inside-inclusive-gateway::after,
.context-pad-icon-switch-inclusive-gateway::before,
.context-pad-icon-switch-inclusive-gateway::after,
.context-pad-icon-inside-event-based-gateway::before,
.context-pad-icon-inside-event-based-gateway::after,
.context-pad-icon-switch-event-based-gateway::before,
.context-pad-icon-switch-event-based-gateway::after,
.context-pad-icon-inside-complex-gateway::before,
.context-pad-icon-inside-complex-gateway::after,
.context-pad-icon-switch-complex-gateway::before,
.context-pad-icon-switch-complex-gateway::after {
  content: "";
  position: absolute;
}

.context-pad-icon-inside-inclusive-gateway::before,
.context-pad-icon-switch-inclusive-gateway::before,
.context-pad-icon-inside-event-based-gateway::before,
.context-pad-icon-switch-event-based-gateway::before,
.context-pad-icon-inside-complex-gateway::before,
.context-pad-icon-switch-complex-gateway::before {
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: rgba(248, 252, 255, 0.96);
}

.context-pad-icon-inside-inclusive-gateway::before,
.context-pad-icon-switch-inclusive-gateway::before {
  border: 2px solid rgba(47, 111, 80, 0.82);
}

.context-pad-icon-inside-event-based-gateway::before,
.context-pad-icon-switch-event-based-gateway::before {
  border: 2px solid rgba(43, 109, 178, 0.82);
}

.context-pad-icon-inside-complex-gateway::before,
.context-pad-icon-switch-complex-gateway::before {
  border: 2px solid rgba(94, 111, 179, 0.82);
}

.context-pad-icon-inside-inclusive-gateway::after,
.context-pad-icon-switch-inclusive-gateway::after,
.context-pad-icon-inside-event-based-gateway::after,
.context-pad-icon-switch-event-based-gateway::after,
.context-pad-icon-inside-complex-gateway::after,
.context-pad-icon-switch-complex-gateway::after {
  display: grid;
  place-items: center;
  color: rgba(18, 34, 52, 0.88);
  line-height: 1;
}

.context-pad-icon-inside-inclusive-gateway::after,
.context-pad-icon-switch-inclusive-gateway::after {
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 2px solid rgba(47, 111, 80, 0.88);
  background: rgba(255, 255, 255, 0.96);
}

.context-pad-icon-inside-event-based-gateway::after,
.context-pad-icon-switch-event-based-gateway::after {
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 2px solid rgba(43, 109, 178, 0.88);
  background:
    radial-gradient(circle at center, rgba(43, 109, 178, 0.9) 0 1px, transparent 1.2px),
    rgba(255, 255, 255, 0.96);
}

.context-pad-icon-inside-complex-gateway::after,
.context-pad-icon-switch-complex-gateway::after {
  content: "*";
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: 900;
  color: rgba(94, 111, 179, 0.92);
}

.context-pad-icon-inside-subprocess::before {
  border-style: dashed;
  border-color: rgba(36, 99, 200, 0.82);
}

.context-pad-icon-append-end::before {
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 4px solid rgba(207, 67, 67, 0.86);
  background: rgba(255, 255, 255, 0.96);
}

.context-pad-icon-append-end::after {
  right: 6px;
  bottom: 6px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(rgba(47, 111, 80, 0.9), rgba(47, 111, 80, 0.9)) center/2px 8px no-repeat,
    linear-gradient(rgba(47, 111, 80, 0.9), rgba(47, 111, 80, 0.9)) center/8px 2px no-repeat,
    rgba(231, 248, 243, 0.96);
  border: 1px solid rgba(47, 111, 80, 0.28);
}

.context-pad-icon-append-task::after,
.context-pad-icon-append-gateway::after,
.context-pad-icon-append-end::after,
.context-pad-icon-inside-start::after,
.context-pad-icon-inside-intermediate::after,
.context-pad-icon-inside-task::after,
.context-pad-icon-inside-end::after {
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
}

.context-pad-icon-rename::before {
  left: 8px;
  top: 10px;
  width: 17px;
  height: 14px;
  border-radius: 4px;
  background:
    linear-gradient(rgba(43, 109, 178, 0.84), rgba(43, 109, 178, 0.84)) 4px 4px/9px 2px no-repeat,
    linear-gradient(rgba(43, 109, 178, 0.84), rgba(43, 109, 178, 0.84)) 4px 8px/9px 2px no-repeat,
    rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(43, 109, 178, 0.18);
}

.context-pad-icon-rename::after {
  right: 8px;
  bottom: 8px;
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: rgba(36, 99, 200, 0.88);
  transform: rotate(-38deg);
  box-shadow: -1px -4px 0 0 rgba(36, 99, 200, 0.2);
}

.context-pad-icon-add-lane::before {
  left: 8px;
  top: 9px;
  width: 18px;
  height: 16px;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(29, 128, 191, 0.16), rgba(29, 128, 191, 0.16)) 0 0/5px 100% no-repeat,
    linear-gradient(rgba(29, 128, 191, 0.42), rgba(29, 128, 191, 0.42)) 5px 50%/13px 1px no-repeat,
    rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(29, 128, 191, 0.34);
}

.context-pad-icon-add-lane::after {
  right: 6px;
  bottom: 6px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(rgba(47, 111, 80, 0.9), rgba(47, 111, 80, 0.9)) center/2px 8px no-repeat,
    linear-gradient(rgba(47, 111, 80, 0.9), rgba(47, 111, 80, 0.9)) center/8px 2px no-repeat,
    rgba(231, 248, 243, 0.96);
  border: 1px solid rgba(47, 111, 80, 0.28);
}

@media (max-width: 1100px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: clamp(120px, 30vw, var(--sidebar-width)) var(--toolbox-handle-width) 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .toolbox-sidebar .toolbox-group-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace {
    height: auto;
    overflow: visible;
    padding-top: 12px;
  }

  .document-tabs-shell {
    height: auto;
  }

  .category-list,
  .validation-list {
    overflow: visible;
    max-height: none;
  }

  .app-menu-dock {
    top: 12px;
    left: 12px;
  }

  .validation-dock {
    right: 160px;
    bottom: 12px;
  }

  .diagram-db-save-overlay {
    top: 12px;
    left: 12px;
  }

  .canvas-shell {
    min-height: 62vh;
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .sidebar {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .toolbox-sidebar .toolbox-group-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .document-tabs-shell {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    border-bottom: 0;
  }

  .document-tabs {
    order: 3;
    width: 100%;
    padding-bottom: 2px;
  }

  .language-switch {
    order: 1;
    margin-bottom: 0;
  }

  .tab-add-button {
    order: 4;
    margin-bottom: 0;
  }

  .document-tabs-actions {
    order: 5;
    margin-bottom: 0;
  }

  .menu-toggle-button {
    order: 0;
    margin-bottom: 0;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .app-menu-dock {
    width: min(260px, calc(100% - 24px));
  }

  .validation-dock {
    right: 160px;
    bottom: 12px;
    max-width: calc(100% - 104px);
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .diagram-db-save-overlay {
    top: 12px;
    left: 12px;
  }

  .toolbox-edge-toggle {
    min-width: 20px;
  }

  .toolbox-edge-toggle-line {
    height: 68px;
  }

  .toolbox-edge-toggle-label {
    font-size: 9px;
  }

  .validation-dock .validation-list {
    max-height: 160px;
  }

  .status-banner {
    left: 12px;
    right: 92px;
    bottom: 12px;
    max-width: none;
  }
}

/* ════════════════════════════════════════════════════
   SBVR Module styles
   ════════════════════════════════════════════════════ */

/* ── Przyciski paneli semantycznych w validation-dock ─ */
.sbvr-panel-toggle-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 10px;
}

.sbvr-panel-toggle-button[aria-expanded="true"] {
  background: rgba(36, 99, 200, 0.12);
  color: var(--primary);
  border-color: rgba(36, 99, 200, 0.3);
}

/* ── Badge walidacji SBVR ────────────────────────── */
.sbvr-validation-badge:not(.document-tabs-action-button) {
  min-width: 34px;
  min-height: 34px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  transition: background 160ms, color 160ms;
}

.sbvr-validation-badge:not(.document-tabs-action-button).sbvr-validation-badge--idle   { }
.sbvr-validation-badge:not(.document-tabs-action-button).sbvr-validation-badge--ok     { color: var(--success); }
.sbvr-validation-badge:not(.document-tabs-action-button).sbvr-validation-badge--warning { color: #b07800; }
.sbvr-validation-badge:not(.document-tabs-action-button).sbvr-validation-badge--error  { color: var(--error); }

.sbvr-validation-badge.document-tabs-action-button.sbvr-validation-badge--idle {
  border-color: rgba(43, 109, 178, 0.18);
  background: rgba(247, 251, 255, 0.94);
  color: var(--muted);
}

.sbvr-validation-badge.document-tabs-action-button.sbvr-validation-badge--ok {
  border-color: rgba(31, 143, 102, 0.58);
  background: linear-gradient(135deg, #1f8f66 0%, #28a676 100%);
  color: #f7fff9;
}

.sbvr-validation-badge.document-tabs-action-button.sbvr-validation-badge--warning {
  border-color: rgba(176, 120, 0, 0.3);
  background: rgba(255, 247, 219, 0.96);
  color: #8a5f00;
}

.sbvr-validation-badge.document-tabs-action-button.sbvr-validation-badge--error {
  border-color: rgba(207, 67, 67, 0.58);
  background: linear-gradient(135deg, #cf4343 0%, #df5a5a 100%);
  color: #fff7f7;
}

/* ── Panel SBVR (prawy overlay) ──────────────────── */
.sbvr-dock {
  position: absolute;
  top: 0;
  right: 14px;
  bottom: 52px;
  z-index: 11;
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 16px;
  border: 1px solid rgba(25, 42, 63, 0.1);
  background: rgba(247, 251, 255, 0.94);
  box-shadow: 0 16px 30px rgba(15, 30, 47, 0.12);
  backdrop-filter: blur(14px);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 20px));
  transition: opacity 200ms ease, transform 200ms ease;
}

.sbvr-dock.sbvr-dock--open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* ── SbvrVocabularyPanel ─────────────────────────── */
#sbvr-panel,
#sdmn-panel,
#llm-panel {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.sbvr-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.llm-panel__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.llm-panel__textarea {
  flex: 1 1 auto;
  min-height: 220px;
  font-size: 11.5px;
  line-height: 1.55;
}

.llm-panel__actions {
  margin-top: 0;
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding: 6px 0 0;
  background: linear-gradient(180deg, rgba(247, 251, 255, 0), rgba(247, 251, 255, 0.96) 40%);
}

.llm-log-modal-overlay {
  z-index: 1001;
  align-items: flex-start;
  padding-top: 16px;
}

.llm-description-modal-overlay {
  z-index: 1002;
}

.sbvr-modal.llm-log-modal {
  width: min(calc(400px * 3), calc(100vw - 16px));
  max-height: calc(100dvh - 24px);
}

.sbvr-modal.llm-description-modal {
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
}

.sbvr-modal.llm-models-modal {
  width: min(1100px, calc(100vw - 32px));
  height: calc(100dvh - 8px);
  max-width: none;
  max-height: none;
  border-radius: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.llm-models-modal__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  overflow-x: hidden;
  min-height: 0;
}

.llm-models-modal .sbvr-modal__body {
  max-height: none;
}

.llm-models-modal__intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.llm-models-modal__content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-right: 4px;
  min-width: 0;
  width: 100%;
}

.llm-example-card {
  border: 1px solid rgba(16, 32, 51, 0.12);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.75);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr);
  gap: 16px;
  align-items: stretch;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
  width: 100%;
  min-width: 0;
}

.llm-example-card__button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(36, 99, 200, 0.12), rgba(36, 99, 200, 0.05));
  padding: 0;
  display: grid;
  grid-template-rows: minmax(240px, 1fr) auto;
  align-content: stretch;
  justify-items: stretch;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(36, 99, 200, 0.14);
  width: 100%;
  min-width: 0;
}

.llm-example-card__thumb {
  position: relative;
  min-height: 240px;
  background: rgba(255, 255, 255, 0.68);
  min-width: 0;
}

.llm-example-card__thumb--fallback {
  background: linear-gradient(180deg, rgba(36, 99, 200, 0.18), rgba(36, 99, 200, 0.08));
}

.llm-example-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.llm-example-card__thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(16, 32, 51, 0.18));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
}

.llm-example-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.llm-example-card__title {
  display: block;
  font-size: 18px;
  line-height: 1.35;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(4px);
  padding: 8px 10px;
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}

.llm-example-card__badge {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(4px);
  padding: 6px 10px;
  border-radius: 999px;
  width: fit-content;
}

.llm-example-card__details {
  padding: 0 4px 2px;
  display: grid;
  gap: 8px;
  text-align: left;
  min-width: 0;
}

.llm-example-card__filename {
  font-size: 12px;
  color: var(--muted);
}

.llm-example-card__copy {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  padding-top: 4px;
}

.llm-example-card__copy-title {
  font-size: 15px;
  line-height: 1.3;
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.llm-example-card__copy-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(16, 32, 51, 0.03);
  border: 1px solid rgba(16, 32, 51, 0.08);
  color: var(--text);
  min-width: 0;
  max-width: 100%;
  max-height: 180px;
  overflow-y: auto;
}

.llm-models-modal__note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .llm-example-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .sbvr-modal.llm-models-modal {
    width: calc(100vw - 4px);
    height: calc(100dvh - 4px);
  }

  .llm-example-card__button {
    grid-template-rows: minmax(180px, 1fr) auto;
  }

  .llm-example-card__thumb {
    min-height: 180px;
  }
}

.llm-log-modal .sbvr-modal__body {
  max-height: calc(100dvh - 170px);
}

.llm-log-modal__call-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(25, 42, 63, 0.10);
  background: rgba(248, 250, 252, 0.95);
}

.llm-log-modal__call-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.llm-log-modal__call-select {
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid rgba(25, 42, 63, 0.18);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.llm-log-modal__body {
  padding: 12px 16px;
}

.llm-log-modal__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.llm-log-modal__pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 6px;
}

.llm-log-modal__pane-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.llm-log-modal__content {
  margin: 0;
  height: 74vh;
  min-width: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  line-height: 1.45;
  border-radius: 10px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
}

.llm-description-modal__body {
  padding: 12px 16px;
}

.llm-description-modal__content {
  margin: 0;
  max-height: min(66vh, 560px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  border-radius: 12px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(255, 255, 255, 0.94);
  padding: 12px 14px;
}

@media (max-width: 1280px) {
  .llm-log-modal__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .llm-log-modal__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .llm-log-modal__content {
    height: 30vh;
  }
}

.llm-panel__status {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.llm-panel__status--success {
  color: var(--success);
}

.llm-panel__status--warning {
  color: #b07800;
}

.llm-panel__status--error {
  color: var(--error);
}

/* ── Skala typografii paneli SBVR/SDMN (okno dock) ────────── */
.sbvr-dock {
  --sbvr-font-scale: 0.76;
  --sbvr-ui-scale: 0.76;
}

.sbvr-dock .sbvr-vocab-select,
.sbvr-dock .sbvr-diagram-select,
.sbvr-dock .sbvr-search-input,
.sbvr-dock .sbvr-list-item,
.sbvr-dock .sbvr-item__term,
.sbvr-dock .sbvr-item__statement,
.sbvr-dock .sbvr-binding-row,
.sbvr-dock .sbvr-binding__stmt,
.sbvr-dock .sbvr-btn,
.sbvr-dock .sbvr-btn--add {
  font-size: calc(12px * var(--sbvr-font-scale));
}

.sbvr-dock .sbvr-tab,
.sbvr-dock .sbvr-item__def,
.sbvr-dock .sbvr-empty,
.sbvr-dock .sbvr-readonly-note,
.sbvr-dock .sbvr-label,
.sbvr-dock .sbvr-section__title,
.sbvr-dock .sbvr-section__subtitle,
.sbvr-dock .sbvr-panel-filter {
  font-size: calc(11px * var(--sbvr-font-scale));
}

.sbvr-dock .sbvr-item__type,
.sbvr-dock .sbvr-binding__scope,
.sbvr-dock .sbvr-binding__modality {
  font-size: calc(10px * var(--sbvr-font-scale));
}

.sbvr-dock .sbvr-btn--icon {
  font-size: calc(13px * var(--sbvr-font-scale));
}

.sbvr-dock .sbvr-panel__header {
  gap: calc(2px * var(--sbvr-ui-scale));
  padding: calc(10px * var(--sbvr-ui-scale)) calc(10px * var(--sbvr-ui-scale)) calc(6px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-panel__header .sbvr-btn--icon {
  width: calc(22px * var(--sbvr-ui-scale));
  height: calc(22px * var(--sbvr-ui-scale));
  font-size: calc(11px * var(--sbvr-font-scale));
  border-radius: calc(6px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-search-row {
  padding: calc(6px * var(--sbvr-ui-scale)) calc(10px * var(--sbvr-ui-scale)) calc(4px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-filter-row {
  padding: calc(4px * var(--sbvr-ui-scale)) calc(10px * var(--sbvr-ui-scale)) calc(4px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-vocab-select,
.sbvr-dock .sbvr-diagram-select {
  height: calc(28px * var(--sbvr-ui-scale));
  padding: 0 calc(6px * var(--sbvr-ui-scale));
  border-radius: calc(7px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-search-input {
  height: calc(26px * var(--sbvr-ui-scale));
  padding: 0 calc(8px * var(--sbvr-ui-scale));
  border-radius: calc(7px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-panel-filter {
  height: calc(26px * var(--sbvr-ui-scale));
  padding: 0 calc(8px * var(--sbvr-ui-scale));
  border-radius: calc(7px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-tabs {
  padding: calc(4px * var(--sbvr-ui-scale)) calc(10px * var(--sbvr-ui-scale)) 0;
  gap: calc(2px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-tab {
  padding: calc(4px * var(--sbvr-ui-scale)) calc(2px * var(--sbvr-ui-scale)) calc(6px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-list {
  padding: calc(4px * var(--sbvr-ui-scale)) calc(6px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-list-item {
  gap: calc(4px * var(--sbvr-ui-scale));
  padding: calc(3px * var(--sbvr-ui-scale)) calc(4px * var(--sbvr-ui-scale)) calc(3px * var(--sbvr-ui-scale)) calc(8px * var(--sbvr-ui-scale));
  border-radius: calc(6px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-item__actions {
  gap: calc(2px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-item__actions button {
  width: calc(22px * var(--sbvr-ui-scale));
  height: calc(22px * var(--sbvr-ui-scale));
  border-radius: calc(5px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-btn {
  gap: calc(4px * var(--sbvr-ui-scale));
  padding: calc(4px * var(--sbvr-ui-scale)) calc(10px * var(--sbvr-ui-scale));
  height: calc(26px * var(--sbvr-ui-scale));
  border-radius: calc(7px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-btn--icon {
  width: calc(26px * var(--sbvr-ui-scale));
  height: calc(26px * var(--sbvr-ui-scale));
  padding: 0;
}

.sbvr-dock .sbvr-btn--add {
  margin: calc(4px * var(--sbvr-ui-scale)) calc(8px * var(--sbvr-ui-scale)) calc(8px * var(--sbvr-ui-scale));
  width: calc(100% - (16px * var(--sbvr-ui-scale)));
  height: calc(28px * var(--sbvr-ui-scale));
  border-radius: calc(8px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-element-section {
  max-height: calc(250px * var(--sbvr-ui-scale));
  padding: calc(8px * var(--sbvr-ui-scale)) calc(10px * var(--sbvr-ui-scale));
}

.sbvr-dock .sbvr-section__actions {
  gap: calc(4px * var(--sbvr-ui-scale));
  margin-top: calc(8px * var(--sbvr-ui-scale));
}

.sbvr-panel__header {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 10px 10px 6px;
  flex: none;
  border-bottom: 1px solid rgba(25, 42, 63, 0.08);
}

.sbvr-panel__header .sbvr-btn--icon {
  width: 22px;
  height: 22px;
  font-size: 11px;
  border-radius: 6px;
}

.sbvr-vocab-select,
.sbvr-diagram-select {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 6px;
  font: inherit;
  font-size: 12px;
  border: 1px solid rgba(25, 42, 63, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  cursor: pointer;
}

.sbvr-vocab-select:disabled,
.sbvr-diagram-select:disabled {
  color: var(--muted);
  cursor: default;
}

.sbvr-search-row {
  padding: 6px 10px 4px;
  flex: none;
}

.sbvr-filter-row {
  padding: 4px 10px;
  flex: none;
  border-bottom: 1px solid rgba(25, 42, 63, 0.08);
}

.sbvr-search-input {
  width: 100%;
  height: 26px;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  border: 1px solid rgba(25, 42, 63, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  outline: none;
}

.sbvr-search-input:focus {
  border-color: var(--primary);
}

.sbvr-panel-filter {
  width: 100%;
  height: 26px;
  padding: 0 8px;
}

.sbvr-tabs {
  display: flex;
  padding: 4px 10px 0;
  gap: 2px;
  flex: none;
  border-bottom: 1px solid rgba(25, 42, 63, 0.08);
}

.sbvr-tab {
  flex: 1;
  padding: 4px 2px 6px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}

.sbvr-tab:hover { color: var(--text); }

.sbvr-tab--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.sbvr-tab--disabled,
.sbvr-tab--disabled:hover {
  color: var(--text-muted, #999);
  cursor: not-allowed;
  opacity: 0.45;
}

/* Lista elementów słownika */
.sbvr-list {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 6px;
}

.sbvr-btn--add {
  flex: none;
  margin: 4px 8px 8px;
  width: calc(100% - 16px);
  height: 28px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(36, 99, 200, 0.07);
  border-color: rgba(36, 99, 200, 0.22);
  color: var(--primary);
}

.sbvr-btn--add:hover {
  background: rgba(36, 99, 200, 0.14);
}

.sbvr-data-quick-actions {
  flex: none;
  margin: 4px 8px 8px;
  width: calc(100% - 16px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
}

.sbvr-data-action-with-help {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.sbvr-data-quick-actions .sbvr-btn--add {
  margin: 0;
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
  height: auto;
  padding: 6px 10px;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
}

.sbvr-data-action-with-help .sbvr-help-btn {
  width: 17px;
  height: 17px;
  min-width: 17px;
  min-height: 17px;
}

.sbvr-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 8px;
  border-radius: 6px;
  cursor: default;
  font-size: 12px;
  transition: background 100ms;
}

.sbvr-list-item--concept {
  border-left: 3px solid transparent;
}

.sbvr-list-item--concept.sbvr-concept--general {
  border-left-color: rgba(36, 93, 201, 0.78);
  background: rgba(36, 93, 201, 0.11);
}

.sbvr-list-item--concept.sbvr-concept--individual {
  border-left-color: rgba(17, 145, 88, 0.8);
  background: rgba(17, 145, 88, 0.13);
}

.sbvr-list-item--concept.sbvr-concept--role {
  border-left-color: rgba(218, 127, 9, 0.8);
  background: rgba(218, 127, 9, 0.14);
}

.sbvr-list-item--concept.sbvr-concept--fact-type {
  border-left-color: rgba(150, 58, 196, 0.82);
  background: rgba(150, 58, 196, 0.13);
}

/* Kolory dla elementów modelu danych (SDMN) */
.sbvr-list-item--item-definition {
  border-left: 3px solid rgba(63, 81, 181, 0.75);
  background: rgba(63, 81, 181, 0.09);
}

.sbvr-list-item--item-definition:hover {
  background: rgba(63, 81, 181, 0.16);
}

.sbvr-list-item--data-item {
  border-left: 3px solid rgba(0, 137, 123, 0.78);
  background: rgba(0, 137, 123, 0.09);
}

.sbvr-list-item--data-item:hover {
  background: rgba(0, 137, 123, 0.17);
}

.sbvr-list-item--single {
  grid-template-columns: 1fr;
}

.sbvr-list-item--clickable {
  cursor: pointer;
}

.sbvr-list-item--clickable:focus-visible {
  outline: 2px solid rgba(36, 99, 200, 0.4);
  outline-offset: 1px;
}

.sbvr-list-item:hover {
  background: rgba(36, 99, 200, 0.06);
}

.sbvr-list-item--concept.sbvr-concept--general:hover {
  background: rgba(36, 93, 201, 0.18);
}

.sbvr-list-item--concept.sbvr-concept--individual:hover {
  background: rgba(17, 145, 88, 0.2);
}

.sbvr-list-item--concept.sbvr-concept--role:hover {
  background: rgba(218, 127, 9, 0.2);
}

.sbvr-list-item--concept.sbvr-concept--fact-type:hover {
  background: rgba(150, 58, 196, 0.2);
}

/* Tekst wewnątrz itemu — blokowe spany tworzą "wiersze" */
.sbvr-list-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sbvr-item__term {
  font-weight: 700;
  font-size: 12px;
}

.sbvr-item__type {
  font-size: 10px;
  color: var(--muted);
  text-transform: lowercase;
}

.sbvr-item__def {
  font-size: 11px;
  color: var(--muted);
}

.sbvr-item__hint {
  font-size: 10px;
}

.sbvr-item__modality {
  display: inline-block !important;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(36, 99, 200, 0.1);
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
  margin-bottom: 2px;
}

.sbvr-modality--operative {
  background: rgba(31, 143, 102, 0.1);
  color: var(--success);
}

.sbvr-item__statement {
  font-size: 12px;
  white-space: normal !important;
  line-height: 1.35;
}

.sbvr-item__statement--compact {
  white-space: nowrap !important;
  line-height: 1.2;
}

.sbvr-item__name {
  font-weight: 700;
}

.sbvr-item__name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.sbvr-item__badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(26, 52, 84, 0.92);
  background: rgba(36, 93, 201, 0.14);
  border: 1px solid rgba(36, 93, 201, 0.28);
}

.sbvr-item__actions {
  display: flex;
  gap: 2px;
  align-self: center;
  opacity: 0;
  transition: opacity 100ms;
}

.sbvr-list-item:hover .sbvr-item__actions {
  opacity: 1;
}

.sbvr-item__actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 12px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  color: var(--muted);
  transition: background 100ms, color 100ms;
}

.sbvr-item__actions button:hover {
  background: rgba(25, 42, 63, 0.08);
  color: var(--text);
}

.sbvr-item__actions button:last-child:hover {
  background: rgba(207, 67, 67, 0.1);
  color: var(--danger);
}

.sbvr-empty {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding: 16px 8px;
  margin: 0;
}

/* ── SbvrElementSection ──────────────────────────── */
.sbvr-element-section {
  flex: none;
  max-height: 250px;
  overflow-y: auto;
  padding: 8px 10px;
  border-top: 1px solid rgba(25, 42, 63, 0.1);
  font-size: 12px;
  line-height: 1.32;
}

.sbvr-element-section--inline {
  max-height: none;
  overflow: visible;
  padding: 4px 2px 2px;
  border-top: none;
  display: flex;
  flex-direction: column;
}

.sbvr-section__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.sbvr-section__subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin: 6px 0 3px;
}

.sbvr-section-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin: 0 0 6px;
  padding: 2px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.7);
}

.sbvr-section-tab {
  height: 18px;
  padding: 0 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

.sbvr-section-tab:hover {
  background: rgba(25, 42, 63, 0.08);
  color: var(--text);
}

.sbvr-section-tab--active {
  background: rgba(36, 99, 200, 0.16);
  color: var(--primary-strong);
}

.sbvr-section__actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.sbvr-element-section--inline .sbvr-section__actions {
  margin-top: auto;
  padding-top: 8px;
  position: sticky;
  bottom: 0;
  background: rgba(247, 251, 255, 0.96);
}

.sbvr-binding-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px 0;
  border-bottom: 1px solid rgba(25, 42, 63, 0.05);
  font-size: 11px;
}

.sbvr-binding-row--stack {
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  padding: 4px 5px;
  border-bottom: none;
  border: 1px solid rgba(25, 42, 63, 0.1);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.55);
}

.sbvr-binding__term {
  flex: 1;
  font-weight: 600;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.sbvr-binding__scope {
  font-size: 9px;
  padding: 0 4px;
  height: 14px;
  min-width: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: rgba(25, 42, 63, 0.07);
  color: var(--muted);
  white-space: nowrap;
}

.sbvr-scope--global   { background: rgba(36, 99, 200, 0.12); color: var(--primary); }
.sbvr-scope--inherited { background: rgba(31, 143, 102, 0.1);  color: var(--success); }

.sbvr-binding__modality {
  font-size: 9px;
  padding: 0 4px;
  height: 14px;
  min-width: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: rgba(36, 99, 200, 0.1);
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

.sbvr-binding__stmt {
  flex: 1;
  font-size: 11px;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.sbvr-binding__type {
  font-size: 9px;
  padding: 0 4px;
  height: 14px;
  min-width: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  color: var(--muted);
  background: rgba(25, 42, 63, 0.06);
  white-space: nowrap;
}

.sbvr-binding__type--general {
  border-color: rgba(43, 109, 178, 0.25);
  background: rgba(43, 109, 178, 0.1);
  color: #1f4f83;
}

.sbvr-binding__type--individual {
  border-color: rgba(122, 87, 182, 0.25);
  background: rgba(122, 87, 182, 0.1);
  color: #5a3d88;
}

.sbvr-binding__type--role {
  border-color: rgba(31, 143, 102, 0.26);
  background: rgba(31, 143, 102, 0.11);
  color: #1a6b4c;
}

.sbvr-binding__type--fact-type {
  border-color: rgba(176, 120, 0, 0.3);
  background: rgba(176, 120, 0, 0.12);
  color: #8a5f00;
}

.sbvr-binding-row--concept {
  border-left: 3px solid rgba(43, 109, 178, 0.2);
  padding-left: 4px;
}

.sbvr-binding-row--concept-role {
  border-left-color: rgba(31, 143, 102, 0.35);
}

.sbvr-binding-row--concept-fact-type {
  border-left-color: rgba(176, 120, 0, 0.4);
}

.sbvr-binding-row--concept-individual {
  border-left-color: rgba(122, 87, 182, 0.35);
}

.sbvr-binding-row--rule {
  border-left: 3px solid rgba(36, 99, 200, 0.22);
  padding-left: 4px;
}

.sbvr-binding-row--rule-must-not {
  border-left-color: rgba(207, 67, 67, 0.42);
}

.sbvr-binding-row--rule-should,
.sbvr-binding-row--rule-should-not {
  border-left-color: rgba(176, 120, 0, 0.4);
}

.sbvr-binding-row--rule-is-necessary,
.sbvr-binding-row--rule-is-possible {
  border-left-color: rgba(31, 143, 102, 0.4);
}

.sbvr-binding-row--data {
  border-left: 3px solid rgba(36, 99, 200, 0.18);
  padding-left: 4px;
  align-items: flex-start;
  flex-wrap: nowrap;
}

.sbvr-binding__data {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sbvr-binding__data-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.sbvr-binding__data-arrow {
  flex: none;
  width: 18px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
}

.sbvr-binding__data-arrow--input {
  color: #1a6b4c;
}

.sbvr-binding__data-arrow--output {
  color: #7a4b0d;
}

.sbvr-binding__stmt--input {
  color: #1a6b4c;
}

.sbvr-binding__stmt--output {
  color: #7a4b0d;
}

.sbvr-binding__stmt--refs {
  color: var(--muted);
}

.sbvr-binding-row > .sbvr-btn--icon {
  margin-left: auto;
}

.sbvr-binding__actions {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  align-self: center;
}

.sbvr-binding-row--data .sbvr-binding__actions {
  align-self: flex-start;
  margin-top: 1px;
}

.sbvr-binding__actions .sbvr-btn--icon {
  width: 16px;
  height: 16px;
  font-size: 9px;
  border-radius: 4px;
  line-height: 1;
  padding: 0;
}

/* ── Panel walidacji SBVR ────────────────────────── */
.sbvr-validation-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(247, 251, 255, 0.97);
  border: 1px solid rgba(25, 42, 63, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 30, 47, 0.14);
  padding: 10px;
  z-index: 20;
}

.sbvr-vp__layer-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 8px 0 4px;
}

.sbvr-vp__layer-title:first-child { margin-top: 0; }

.sbvr-vp__issue {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(25, 42, 63, 0.05);
  font-size: 11px;
}

.sbvr-vp__code {
  font-family: monospace;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.sbvr-vp__issue--error   .sbvr-vp__code { color: var(--error); }
.sbvr-vp__issue--warning .sbvr-vp__code { color: #b07800; }

/* ── Przyciski SBVR ──────────────────────────────── */
.sbvr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px;
  height: 26px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid rgba(25, 42, 63, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
  white-space: nowrap;
}

.sbvr-btn:hover { background: rgba(36, 99, 200, 0.07); border-color: rgba(36, 99, 200, 0.3); }

.sbvr-btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.sbvr-btn--primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }

.sbvr-btn--icon {
  padding: 0;
  width: 26px;
  font-size: 13px;
  flex: none;
}

.sbvr-btn--danger {
  color: var(--danger);
  border-color: transparent;
  background: none;
}

.sbvr-btn--danger:hover { background: rgba(207, 67, 67, 0.08); border-color: rgba(207, 67, 67, 0.2); }

/* ── Wiersz etykiety z przyciskiem pomocy ─────────── */
.sbvr-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 3px;
}

.sbvr-label-row:first-child { margin-top: 0; }

.sbvr-help-btn {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  border-radius: 50%;
  border: 1.5px solid rgba(25, 42, 63, 0.22);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}

.sbvr-help-btn:hover,
.sbvr-help-btn--active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Sekcja pól roli ─────────────────────────────── */
.sbvr-role-section {
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(36, 99, 200, 0.2);
  background: rgba(36, 99, 200, 0.03);
}

.sbvr-role-hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.sbvr-role-hint--warn {
  color: #b07800;
  font-style: normal;
  font-weight: 600;
}

.sbvr-participants-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.sbvr-participant-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  overflow: hidden;
}

.sbvr-participant-main {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.sbvr-participant-main .sbvr-select,
.sbvr-participant-main .sbvr-input {
  min-width: 0;
}

.sbvr-participant-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.sbvr-participant-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
}

.sbvr-participant-toggle input[type="checkbox"] {
  flex: none;
}

.sbvr-participant-options .sbvr-select {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.sbvr-role-hint--participant {
  margin-top: 0;
  margin-bottom: 0;
  font-style: normal;
}

.sbvr-participant-pos {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.sbvr-readonly-note {
  margin: 2px 0 8px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(25, 42, 63, 0.04);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

/* ── Panel wyjaśnień ─────────────────────────────── */
.sbvr-help-panel {
  margin: 4px 0 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(36, 99, 200, 0.18);
  background: rgba(36, 99, 200, 0.04);
  font-size: 11px;
  line-height: 1.45;
}

.sbvr-help-dl {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.sbvr-help-dl dt {
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.sbvr-help-dl dt em {
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
}

.sbvr-help-dl dd {
  margin: 2px 0 0 0;
  color: var(--muted);
}

.sbvr-help-dl dd strong { color: var(--primary); font-weight: 700; }

/* ── Formularze SBVR ─────────────────────────────── */
.sbvr-input,
.sbvr-select,
.sbvr-textarea {
  width: 100%;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
  border: 1px solid rgba(25, 42, 63, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  outline: none;
  transition: border-color 120ms;
}

.sbvr-input:focus,
.sbvr-select:focus,
.sbvr-textarea:focus { border-color: var(--primary); }

.sbvr-textarea { resize: vertical; min-height: 52px; }

.sbvr-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin: 8px 0 3px;
}

.sbvr-label:first-child { margin-top: 0; }

.sbvr-field-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 6px;
  line-height: 1.4;
}

.sbvr-field-hint--warn {
  color: #b07d00;
}

/* Array mode toggle */
.sbvr-array-mode-wrap {
  margin: 4px 0 8px;
}

.sbvr-array-mode-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.sbvr-array-mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 10px;
  border: 1px solid var(--border, #ccc);
  border-radius: 5px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.sbvr-array-mode-btn:hover {
  border-color: var(--accent, #4a90d9);
  background: var(--hover-bg, rgba(74,144,217,0.06));
}

.sbvr-array-mode-btn--active {
  border-color: var(--accent, #4a90d9);
  background: var(--hover-bg, rgba(74,144,217,0.1));
  font-weight: 600;
}

.sbvr-array-mode-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent, #4a90d9);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.5;
  margin-left: 4px;
  vertical-align: middle;
}

/* Array empty state */
.sbvr-array-empty-state {
  padding: 10px 12px;
  border: 1px dashed var(--border, #ccc);
  border-radius: 5px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 4px;
}

/* ── Seed import ZIP modal ─────────────────────────────── */
.seed-import-modal {
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.seed-import-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 0 4px;
}

.seed-import-summary {
  font-size: 13px;
  margin-bottom: 12px;
  color: var(--muted);
}

.seed-import-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seed-import-result-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  grid-template-rows: auto auto auto;
  column-gap: 8px;
  row-gap: 2px;
  padding: 8px 10px;
  border-radius: 5px;
  border: 1px solid var(--border, #ccc);
  font-size: 12px;
}

.seed-result--ok   { border-color: #4caf50; background: rgba(76,175,80,0.06); }
.seed-result--err  { border-color: #e53935; background: rgba(229,57,53,0.06); }
.seed-result--skip { border-color: var(--border, #ccc); opacity: 0.7; }

.seed-result-icon   { grid-column: 1; grid-row: 1; font-weight: 700; align-self: center; }
.seed-result-file   { grid-column: 2; grid-row: 1; font-weight: 600; word-break: break-all; }
.seed-result-status { grid-column: 3; grid-row: 1; font-size: 11px; color: var(--muted); white-space: nowrap; }
.seed-result-vocab  { grid-column: 2 / 4; grid-row: 2; font-size: 11px; color: var(--muted); }
.seed-result-error  { grid-column: 2 / 4; grid-row: 3; font-size: 11px; color: #e53935; }
.seed-result-counts { grid-column: 2 / 4; grid-row: 3; font-size: 11px; color: var(--muted); }

.seed-result-errors {
  grid-column: 1 / 4;
  margin: 4px 0 0;
  padding-left: 20px;
  font-size: 11px;
  color: #e53935;
}

.seed-preview-toggle {
  grid-column: 1 / 4;
  margin-top: 6px;
  font-size: 11px;
  padding: 3px 8px;
  align-self: start;
  justify-self: start;
}

.seed-preview-panel {
  grid-column: 1 / 4;
  margin-top: 6px;
  overflow-x: auto;
}

.seed-preview-key {
  font-weight: 600;
  white-space: nowrap;
  color: var(--accent, #4a90d9);
}

.seed-preview-desc {
  color: var(--muted);
  min-width: 160px;
}

.seed-preview-summary {
  word-break: break-word;
}

.seed-preview-sample {
  margin: 4px 0 0;
  padding-left: 16px;
  color: var(--muted);
  list-style: disc;
}

.sbvr-desig-list,
.sbvr-roles-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.sbvr-desig-row,
.sbvr-role-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Term input — zajmuje całą wolną przestrzeń */
.sbvr-desig-row .sbvr-input {
  flex: 1 1 0;
  min-width: 0;
}

/* Select języka — stała wąska szerokość */
.sbvr-desig-row .sbvr-select {
  flex: 0 0 58px;
  width: 58px;
  padding: 5px 4px;
}

/* Checkbox preferowany — nie rozciągaj */
.sbvr-desig-row input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Przycisk usuń wiersz */
.sbvr-desig-row .sbvr-btn--icon {
  flex: none;
}

.sbvr-role-row .sbvr-input  { flex: 1 1 0; min-width: 0; }
.sbvr-role-row .sbvr-select { flex: 0 0 140px; width: 140px; }

.sbvr-checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  max-height: 100px;
  overflow-y: auto;
  padding: 4px 0;
}

.sbvr-checklist label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* ── Modal SBVR ──────────────────────────────────── */
.sbvr-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 30, 47, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.sbvr-modal {
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--panel-strong);
  border: 1px solid rgba(25, 42, 63, 0.1);
  border-radius: 16px;
  box-shadow: 0 24px 56px rgba(15, 30, 47, 0.22);
  overflow: hidden;
}

.sbvr-modal--rule-builder {
  width: min(720px, calc(100vw - 32px));
}

.sbvr-modal--data-model {
  width: min(920px, calc(100vw - 32px));
}

.bpmn-validation-modal {
  width: min(720px, calc(100vw - 32px));
}

.bpmn-validation-modal__header {
  align-items: flex-start;
  gap: 12px;
}

.bpmn-validation-modal__header-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.bpmn-validation-modal__header--checking {
  background: rgba(247, 251, 255, 0.96);
}

.bpmn-validation-modal__header--ok {
  background: rgba(231, 248, 243, 0.96);
}

.bpmn-validation-modal__header--warning {
  background: rgba(255, 247, 219, 0.96);
}

.bpmn-validation-modal__header--error {
  background: rgba(255, 235, 235, 0.96);
}

.bpmn-validation-modal__status {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.bpmn-validation-modal__status--checking {
  color: var(--primary-strong);
}

.bpmn-validation-modal__status--ok {
  color: var(--success);
}

.bpmn-validation-modal__status--warning {
  color: #8a5f00;
}

.bpmn-validation-modal__status--error {
  color: var(--danger-strong);
}

.bpmn-validation-modal__body {
  display: grid;
  gap: 16px;
}

.bpmn-validation-modal__empty {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.bpmn-validation-modal__section {
  display: grid;
  gap: 8px;
}

.bpmn-validation-modal__section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.bpmn-validation-modal__list {
  margin: 0;
  padding-right: 0;
  max-height: none;
}

.sbvr-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  flex: none;
  border-bottom: 1px solid rgba(25, 42, 63, 0.08);
}

.sbvr-modal__title {
  font-size: 14px;
  font-weight: 700;
}

.sbvr-modal__body {
  overflow-y: auto;
  padding: 12px 16px;
  max-height: 65vh;
}

.sbvr-modal__error {
  padding: 6px 16px;
  font-size: 12px;
  color: var(--error);
  background: rgba(207, 67, 67, 0.06);
  flex: none;
}

.sbvr-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 16px 14px;
  flex: none;
  border-top: 1px solid rgba(25, 42, 63, 0.08);
}

.sbvr-rule-builder-section {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(25, 42, 63, 0.03);
}

.sbvr-rule-builder-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sbvr-rule-builder-row {
  margin-bottom: 6px;
}

.sbvr-rule-builder-row:last-child {
  margin-bottom: 0;
}

.sbvr-multi-select {
  height: auto;
  min-height: 104px;
  padding: 6px 8px;
}

.sbvr-rule-preview {
  background: rgba(255, 255, 255, 0.72);
}

.sbvr-rule-warning {
  margin: 6px 0 0;
  font-size: 11px;
  color: #b07800;
  font-weight: 600;
}

.sbvr-data-create-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.sbvr-data-info-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.sbvr-data-info-row .sbvr-readonly-note {
  flex: 1;
  margin: 0;
}

.sbvr-data-info-btn {
  flex: none;
  margin-top: 0;
}

.sbvr-data-info-panel {
  margin: 6px 0 8px;
}

.sbvr-data-section {
  margin-top: 8px;
  border: 1px solid rgba(25, 42, 63, 0.1);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.4);
}

.sbvr-data-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: nowrap;
}

.sbvr-data-section__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.sbvr-data-section__title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 0;
}

.sbvr-data-section__title {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sbvr-data-section__help {
  width: 17px;
  height: 17px;
  min-width: 17px;
  min-height: 17px;
}

.sbvr-data-fields {
  display: grid;
  gap: 6px;
}

.sbvr-data-field-row {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(25, 42, 63, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.sbvr-data-field-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 180px auto auto;
  gap: 5px;
  align-items: center;
}

.sbvr-data-field-help {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.sbvr-data-field-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.sbvr-data-field-config__group {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sbvr-data-field-config__label {
  font-size: 10px;
  color: var(--muted);
}

.sbvr-data-field-readonly {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  color: var(--muted);
}

.sbvr-enum-editor {
  display: grid;
  gap: 6px;
}

.sbvr-enum-editor__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.sbvr-enum-editor__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sbvr-enum-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(25, 42, 63, 0.15);
  background: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  color: var(--text);
}

.sbvr-enum-chip__remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.sbvr-enum-chip__remove:hover {
  color: var(--danger);
}

@media (max-width: 900px) {
  .sbvr-data-field-main {
    grid-template-columns: 1fr 1fr;
  }

  .sbvr-data-field-config {
    grid-template-columns: 1fr;
  }

  .sbvr-data-field-main .sbvr-btn--icon {
    justify-self: end;
  }
}

@media (max-width: 760px) {
  .sbvr-participant-main {
    grid-template-columns: 20px minmax(0, 1fr) auto;
  }

  .sbvr-participant-main .sbvr-input {
    grid-column: 2 / 4;
  }
}

.sbvr-modal--fact-type-readonly {
  width: min(680px, calc(100vw - 32px));
}

.sbvr-ft-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sbvr-ft-view__section {
  border: 1px solid rgba(25, 42, 63, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.55);
}

.sbvr-ft-view__title {
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sbvr-ft-view__statement {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.sbvr-ft-view__text,
.sbvr-ft-view__empty,
.sbvr-ft-view__note {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.sbvr-ft-view__note {
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(25, 42, 63, 0.1);
  background: rgba(25, 42, 63, 0.04);
}

.sbvr-ft-participants,
.sbvr-ft-alternatives {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.sbvr-ft-participant {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 6px;
  align-items: flex-start;
}

.sbvr-ft-participant__idx {
  font-weight: 700;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.sbvr-ft-participant__line,
.sbvr-ft-participant__meta {
  margin: 0;
  line-height: 1.35;
}

.sbvr-ft-participant__line {
  font-size: 12px;
}

.sbvr-ft-participant__label {
  font-weight: 700;
}

.sbvr-ft-participant__arrow {
  color: var(--muted);
  margin: 0 4px;
}

.sbvr-ft-participant__meta {
  font-size: 11px;
  color: var(--muted);
}

.sbvr-ft-alternative {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
}

.sbvr-ft-alternative__lang {
  flex: none;
  font-size: 10px;
  color: var(--muted);
  border: 1px solid rgba(25, 42, 63, 0.14);
  border-radius: 999px;
  padding: 1px 6px;
}

/* ── Artifact info badge HTML tooltip ───────────────────────────────── */
.bpmn-artifact-info-tooltip-html {
  max-width: 300px;
  min-width: 120px;
  background: #ffffff;
  border: 1.4px solid #5f6f82;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 500;
  color: #1f2b38;
  line-height: 1.5;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

/* ─── Company panels (Firma / Activity / Audit) ─────────────────────────── */

#companyOverlay .database-modal,
.company-history-modal,
.company-audit-modal,
.company-login-history-modal {
  width: min(1000px, calc(100vw - 28px));
  height: min(860px, calc(100vh - 24px));
  max-height: min(860px, calc(100vh - 24px));
}

.company-join-modal {
  width: min(520px, calc(100vw - 28px));
}

#companyPanel,
#companyHistoryPanel,
#companyAuditPanel,
#companyLoginHistoryPanel {
  font-size: 14px;
}


/* Filters shared sizing */

.company-history-filters,
.company-audit-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0 4px;
  border-bottom: 1px solid #e0e7ef;
}

.company-history-filters-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 0 8px;
}

.company-history-filters-toggle i {
  font-size: 13px;
}

.company-history-filters-toggle.is-active {
  background: rgba(36, 99, 200, 0.12);
  border-color: rgba(36, 99, 200, 0.34);
}

.company-history-filters-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0 6px;
  border-bottom: 1px solid #e0e7ef;
  width: 100%;
  box-sizing: border-box;
  min-height: 214px;
}

.company-history-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 10px;
  align-items: start;
}

.company-history-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.company-history-filter-label {
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #5a6d80;
  text-transform: uppercase;
}

.company-history-filter-select {
  height: 32px;
  padding: 0 8px;
  font-size: 0.85em;
  width: 100%;
}

.company-history-filter-date {
  height: 32px;
  padding: 0 8px;
  font-size: 0.85em;
  width: 100%;
}

.company-history-filter-text {
  height: 32px;
  padding: 0 8px;
  font-size: 0.85em;
  width: 100%;
}

.company-audit-filter-user {
  height: 32px;
  padding: 0 8px;
  font-size: 0.85em;
  width: 140px;
}

.company-history-filter-sep {
  color: #8fa3b8;
  user-select: none;
}

.company-history-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.company-history-content,
.company-audit-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.company-audit-content {
  padding-right: 0;
}

.company-history-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.company-login-history-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.company-history-table {
  width: 100%;
}

.company-history-table tbody td {
  vertical-align: top;
}

.company-activity-object-name {
  font-weight: 600;
  color: #1a2d45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-activity-object-id {
  margin-top: 4px;
}

.company-activity-owner {
  margin-top: 4px;
  color: #708398;
  font-size: 0.8em;
  line-height: 1.35;
  white-space: normal;
}

.company-activity-details {
  color: #5a6d80;
  font-size: 0.82em;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.company-audit-ip {
  color: #8fa3b8;
  font-size: 0.78em;
  font-family: monospace;
  white-space: nowrap;
}

.company-login-history-table {
  width: 100%;
}

.company-login-history-table tbody td {
  vertical-align: top;
}

.company-login-history-ip {
  color: #8fa3b8;
  font-size: 0.78em;
  font-family: monospace;
  white-space: nowrap;
}

.company-login-history-user-agent {
  display: inline-block;
  padding: 1px 5px;
  background: #f0f4f8;
  color: #6a7f94;
  border-radius: 4px;
  font-size: 0.75em;
  cursor: default;
  white-space: nowrap;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-audit-ua {
  display: inline-block;
  padding: 1px 5px;
  background: #f0f4f8;
  color: #6a7f94;
  border-radius: 4px;
  font-size: 0.75em;
  cursor: default;
  white-space: nowrap;
}

.company-audit-process-name {
  font-weight: 600;
  color: #1f3750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-audit-version-label {
  font-weight: 700;
  color: #244868;
}

.company-audit-version-name {
  margin-top: 3px;
  font-size: 0.7rem;
  color: #6b829a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-audit-details-modal {
  width: min(760px, calc(100vw - 28px));
  height: min(640px, calc(100vh - 24px));
}

.company-audit-details-content {
  flex: 1;
  overflow: auto;
  padding: 2px 4px 0;
}

.company-audit-details-grid {
  display: grid;
  gap: 8px;
}

.company-audit-details-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid #e1e9f3;
  border-radius: 8px;
  background: #f9fcff;
}

.company-audit-details-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #4f6780;
}

.company-audit-details-value {
  font-size: 0.78rem;
  color: #223c57;
  word-break: break-word;
  white-space: pre-wrap;
}

.company-history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0 2px;
  border-top: 1px solid #e0e7ef;
}

.company-history-page-info {
  font-size: 0.85em;
  color: #5a6d80;
  min-width: 80px;
  text-align: center;
}

.company-login-history-page-info {
  font-size: 0.85em;
  color: #5a6d80;
  min-width: 80px;
  text-align: center;
}

.pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.pagination-page-input {
  width: 56px;
  padding: 3px 6px;
  font-size: 0.82em;
  border: 1px solid #c8d4e0;
  border-radius: 6px;
  text-align: center;
  background: var(--panel-strong);
  color: var(--text);
}

.pagination-page-input:focus {
  outline: none;
  border-color: #2463c8;
  box-shadow: 0 0 0 2px rgba(36, 99, 200, 0.18);
}

/* ─── Process Lifecycle Graph overlay ─────────────────────────────────────── */

.process-lifecycle-modal {
  width: min(1100px, calc(100vw - 28px));
  height: min(880px, calc(100vh - 24px));
  max-height: min(880px, calc(100vh - 24px));
  display: flex;
  flex-direction: column;
}

/* ── Diagram picker ── */
.lifecycle-picker {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 10px;
  padding: 6px 0 0;
}

.lifecycle-picker-search-row {
  padding: 0 2px;
}

.lifecycle-search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  font-size: 0.9rem;
  border-radius: 8px;
}

.lifecycle-diagram-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lifecycle-diagram-list-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border: 1px solid #d9e6f3;
  border-radius: 10px;
  background: #f5faff;
  cursor: pointer;
  transition: background 100ms, border-color 100ms;
}

.lifecycle-diagram-list-item:hover,
.lifecycle-diagram-list-item:focus {
  background: #e3f0fc;
  border-color: #90c4f3;
  outline: none;
}

.lifecycle-diagram-list-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a3355;
}

.lifecycle-diagram-list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lifecycle-diagram-list-uploader {
  font-size: 0.78rem;
  color: #5a6d80;
}

.lifecycle-diagram-list-date {
  font-size: 0.78rem;
  color: #8fa3b8;
}

.lifecycle-list-loading,
.lifecycle-list-empty {
  padding: 20px 0;
  text-align: center;
}

/* ── Graph view ── */
.lifecycle-graph-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 8px;
}

.lifecycle-graph-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 196px;
  gap: 10px;
  align-items: stretch;
}

.lifecycle-graph-canvas-wrap {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.lifecycle-graph-diagram-name {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 5;
  max-width: min(52%, 420px);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  color: #18314f;
  text-align: right;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.lifecycle-sidepanel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.lifecycle-sidecard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 12px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.96));
  border: 1px solid rgba(27, 49, 79, 0.12);
  box-shadow: 0 8px 18px rgba(15, 31, 48, 0.06);
  overflow: auto;
}

.lifecycle-sidecard-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: #18314f;
}

.lifecycle-legend-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lifecycle-legend-title {
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #60758b;
}

.lifecycle-legend-badges {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.lifecycle-legend-badge {
  cursor: help;
  font-size: 0.63rem;
  min-height: 20px;
  padding: 2px 8px;
  justify-content: center;
  text-align: center;
}

.lifecycle-graph {
  position: relative;
  flex: 1;
  min-height: 560px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 252, 0.98)),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  background-position: 0 0, 0 0, 0 0;
  border-radius: 14px;
  border: 1px solid rgba(27, 49, 79, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.lifecycle-graph-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}

.lifecycle-overlay-item {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: center center;
  will-change: transform, left, top;
}

.lifecycle-card {
  position: relative;
  width: 148px;
  max-width: 148px;
  padding: 6px 7px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(27, 49, 79, 0.16);
  box-shadow: 0 8px 16px rgba(15, 31, 48, 0.09);
  backdrop-filter: blur(4px);
  color: #18314f;
}

.lifecycle-card-accent {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--lifecycle-tone, #5c6b7a);
}

.lifecycle-card--state {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.99));
}

.lifecycle-card--action {
  width: 140px;
  max-width: 140px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 253, 0.98));
  box-shadow: 0 6px 12px rgba(15, 31, 48, 0.07);
}

.lifecycle-card--inferred {
  border-style: dashed;
  background:
    linear-gradient(180deg, rgba(250, 252, 255, 0.94), rgba(244, 247, 251, 0.94));
}

.lifecycle-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 3px;
}

.lifecycle-card-date {
  font-size: 0.41rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #697f94;
  text-align: left;
  line-height: 1.1;
  min-height: 10px;
  flex: 1;
}

.lifecycle-card-corner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(24, 49, 79, 0.08);
  border: 1px solid rgba(24, 49, 79, 0.14);
  font-size: 0.44rem;
  font-weight: 900;
  color: #35506c;
  flex: 0 0 auto;
}

.lifecycle-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lifecycle-card-badge-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 18px;
}

.lifecycle-card-grid {
  display: table;
  width: 100%;
  border-collapse: collapse;
}

.lifecycle-card-row {
  display: table-row;
}

.lifecycle-card-key,
.lifecycle-card-value {
  display: table-cell;
  vertical-align: top;
  padding: 1px 0;
}

.lifecycle-card-key {
  width: 52px;
  padding-right: 5px;
  font-size: 0.43rem;
  font-weight: 800;
  color: #60758b;
  white-space: nowrap;
}

.lifecycle-card-value {
  min-width: 0;
  font-size: 0.46rem;
  font-weight: 600;
  line-height: 1.18;
  color: #18314f;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

.lifecycle-card-note {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(27, 49, 79, 0.12);
  font-size: 0.42rem;
  font-weight: 700;
  color: #62788e;
  text-align: center;
  line-height: 1.1;
}

.lifecycle-card-diagram {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(27, 49, 79, 0.08);
  font-size: 0.42rem;
  font-weight: 700;
  line-height: 1.15;
  color: #526a83;
  text-align: center;
  word-break: break-word;
}

.lifecycle-card .action-badge {
  min-height: 14px;
  max-width: 100%;
  padding: 1px 6px;
  font-size: 0.44rem;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
}

.lifecycle-card--tone-success {
  --lifecycle-tone: #1b5e20;
}

.lifecycle-card--tone-violet {
  --lifecycle-tone: #6d4c41;
}

.lifecycle-card--tone-error {
  --lifecycle-tone: #b3261e;
}

.lifecycle-card--tone-blue {
  --lifecycle-tone: #1565c0;
}

.lifecycle-card--tone-amber {
  --lifecycle-tone: #ef6c00;
}

.lifecycle-card--tone-neutral {
  --lifecycle-tone: #60758b;
}

.lifecycle-loading-graph {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.lifecycle-graph-status {
  padding: 4px 0 0;
  text-align: left;
}

.lifecycle-tooltip {
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

@media (max-width: 1180px) {
  .lifecycle-graph-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .lifecycle-sidecard {
    max-height: 180px;
  }
}

@media print {
  #processLifecycleOverlay {
    position: static !important;
    inset: auto !important;
    background: #fff !important;
    overflow: visible !important;
  }

  #processLifecycleOverlay .process-lifecycle-modal {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  #processLifecycleOverlay .panel-close,
  #processLifecycleOverlay .secondary-button,
  #processLifecycleOverlay #lifecyclePicker {
    display: none !important;
  }

  #processLifecycleOverlay #lifecycleGraphView {
    display: flex !important;
    overflow: visible !important;
  }

  #processLifecycleOverlay .lifecycle-graph-layout {
    grid-template-columns: minmax(0, 1fr) 196px;
    align-items: start;
  }

  #processLifecycleOverlay .lifecycle-graph {
    min-height: 920px;
    background: #fff !important;
    border: 1px solid rgba(27, 49, 79, 0.18);
  }

  #processLifecycleOverlay .lifecycle-sidecard {
    box-shadow: none;
    border-color: rgba(27, 49, 79, 0.18);
    break-inside: avoid;
  }

  #processLifecycleOverlay .lifecycle-card {
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
}

/* Button styling for lifecycle overlay */
#processLifecycleOverlay .secondary-button {
  border: 1px solid rgba(25, 42, 63, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  box-shadow: none;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transition: background 120ms, border-color 120ms, color 120ms;
}

#processLifecycleOverlay .secondary-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(25, 42, 63, 0.28);
}

/* Match Menu button styling across Database/Repository/Company-related panels */
#databaseOverlay .secondary-button,
#databaseOverlay .primary-button,
#repositoryOverlay .secondary-button,
#repositoryOverlay .primary-button,
#repoFullArchiveOverlay .secondary-button,
#repoDiffOverlay .secondary-button,
#repoDiffOverlay .primary-button,
#repoAuditOverlay .secondary-button,
#repoProcessHistoryOverlay .secondary-button,
#repoProcessDescriptionOverlay .secondary-button,
#companyOverlay .secondary-button,
#companyOverlay .primary-button,
#companyOverlay .danger-button,
#companyHistoryOverlay .secondary-button,
#companyHistoryOverlay .primary-button,
#companyAuditOverlay .secondary-button,
#companyAuditOverlay .primary-button,
#companyAuditDetailsOverlay .secondary-button {
  border: 1px solid rgba(25, 42, 63, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  box-shadow: none;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transition: background 120ms, border-color 120ms, color 120ms;
}

#repositoryOverlay .secondary-button,
#repositoryOverlay .primary-button,
#repoFullArchiveOverlay .secondary-button,
#repoDiffOverlay .secondary-button,
#repoDiffOverlay .primary-button,
#repoAuditOverlay .secondary-button,
#repoProcessHistoryOverlay .secondary-button,
#repoProcessDescriptionOverlay .secondary-button {
  min-height: 0;
  padding: 4px 7px;
  font-size: 0.8em;
  line-height: 1.05;
  border-radius: 6px;
}

#repositoryOverlay .database-close-button,
#repoFullArchiveOverlay .database-close-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 10px;
  line-height: 1;
}

#repositoryOverlay .repo-ver-actions button,
#repositoryOverlay .repository-diagram-actions .secondary-button,
#repositoryOverlay .repository-archive-toggle-button,
#repositoryOverlay .repo-perm-del-confirm-btn,
#repositoryOverlay .repo-perm-del-actions .secondary-button {
  min-height: 0;
  padding: 4px 7px;
  font-size: 0.8em;
  line-height: 1.05;
  border-radius: 6px;
}

#databaseOverlay .secondary-button:hover:not(:disabled),
#databaseOverlay .primary-button:hover:not(:disabled),
#repositoryOverlay .secondary-button:hover:not(:disabled),
#repositoryOverlay .primary-button:hover:not(:disabled),
#repoFullArchiveOverlay .secondary-button:hover:not(:disabled),
#repoDiffOverlay .secondary-button:hover:not(:disabled),
#repoDiffOverlay .primary-button:hover:not(:disabled),
#repoAuditOverlay .secondary-button:hover:not(:disabled),
#repoProcessHistoryOverlay .secondary-button:hover:not(:disabled),
#repoProcessDescriptionOverlay .secondary-button:hover:not(:disabled),
#companyOverlay .secondary-button:hover:not(:disabled),
#companyOverlay .primary-button:hover:not(:disabled),
#companyOverlay .danger-button:hover:not(:disabled),
#companyHistoryOverlay .secondary-button:hover:not(:disabled),
#companyHistoryOverlay .primary-button:hover:not(:disabled),
#companyAuditOverlay .secondary-button:hover:not(:disabled),
#companyAuditOverlay .primary-button:hover:not(:disabled),
#companyAuditDetailsOverlay .secondary-button:hover:not(:disabled) {
  background: rgba(36, 99, 200, 0.07);
  border-color: rgba(36, 99, 200, 0.3);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

#databaseOverlay .primary-button,
#repositoryOverlay .primary-button,
#repoDiffOverlay .primary-button,
#companyOverlay .primary-button,
#companyHistoryOverlay .primary-button,
#companyAuditOverlay .primary-button {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

#databaseOverlay .primary-button:hover:not(:disabled),
#repositoryOverlay .primary-button:hover:not(:disabled),
#repoDiffOverlay .primary-button:hover:not(:disabled),
#companyOverlay .primary-button:hover:not(:disabled),
#companyHistoryOverlay .primary-button:hover:not(:disabled),
#companyAuditOverlay .primary-button:hover:not(:disabled) {
  background: var(--primary-strong);
  color: #fff;
  border-color: var(--primary-strong);
}

/* ── System config tab ──────────────────────────────────────────────────────── */

#adminTabPanelConfig {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#adminConfigContainer {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.config-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.config-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.config-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.config-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #6b7c93);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border, #e4eaf0);
}

.config-section-title i {
  font-size: 0.9rem;
}

.config-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem;
}

.config-cards-grid--paths {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.config-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #fff;
  border: 1px solid var(--border, #dde5ef);
  border-radius: 8px;
  padding: 0.65rem 0.75rem 0.6rem;
  box-shadow: 0 1px 3px rgba(14, 30, 55, 0.05);
}

.config-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
  min-height: 2.2em;
}

.config-card-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.config-restart-note {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: #b35c00;
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 3px;
  padding: 1px 4px;
  cursor: help;
  white-space: nowrap;
}

.config-suggestion-select {
  font-size: 0.78rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--border, #cdd7e2);
  border-radius: 5px;
  background: var(--bg-alt, #f5f8fb);
  color: var(--text);
  width: 100%;
  cursor: pointer;
}

.config-card-input-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.config-card-input-row--path {
  flex-direction: column;
  align-items: stretch;
}

.config-input {
  width: 80px;
  padding: 0.25rem 0.4rem;
  font-size: 0.82rem;
  border: 1px solid var(--border, #cdd7e2);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  -moz-appearance: textfield;
}

.config-input::-webkit-outer-spin-button,
.config-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.config-input--path {
  width: 100%;
  font-family: inherit;
}

.config-input:focus {
  outline: none;
  border-color: var(--primary, #2463c8);
  box-shadow: 0 0 0 2px rgba(36, 99, 200, 0.15);
}

.config-card-meta {
  font-size: 0.7rem;
  color: var(--muted, #8a9bb0);
  white-space: nowrap;
}

.config-card-help {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted, #728399);
}

.config-form-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--bg-alt, #f5f8fb);
  border-top: 1px solid var(--border, #e0e6ec);
}

.config-status {
  font-size: 0.8rem;
  color: var(--muted, #6b7c93);
  flex: 1;
}

.config-status--ok {
  color: var(--success, #1f8f66);
  font-weight: 500;
}

.config-status--error {
  color: var(--danger, #cf4343);
  font-weight: 500;
}

/* ── Backup panel ─────────────────────────────────────────────────────────── */

.backup-modal {
  width: calc(100vw - 16px);
  max-width: none;
  max-height: calc(100vh - 16px);
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.backup-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-alt, #f5f8fb);
  border: 1px solid var(--border, #e0e6ec);
  border-radius: 6px;
  font-size: 0.85rem;
}

.backup-scope-info {
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.backup-scope-info strong {
  color: var(--text);
  font-weight: 800;
}

.backup-settings-input {
  width: 80px;
  padding: 0.2rem 0.4rem;
  font-size: 0.85rem;
}

.backup-settings-input[type="text"] {
  width: 120px;
}

.backup-list-container {
  overflow-x: auto;
}

.backup-list-empty {
  color: var(--muted, #8a9bb0);
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
}

.backup-list-table .table-actions-row {
  display: inline-flex !important;
  flex-direction: row !important;
  gap: 4px !important;
  align-items: center !important;
  grid-template-rows: unset !important;
  grid-auto-flow: unset !important;
  grid-auto-columns: unset !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  width: auto !important;
}

.backup-list-table .table-actions-row > * {
  width: auto !important;
  justify-self: unset !important;
}

.backup-contents-badge {
  cursor: help;
  position: relative;
}

.backup-contents-badge[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 4px);
  background: #1a2a3a;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.5;
  font-weight: 400;
  white-space: pre-line;
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 50;
  text-align: left;
  pointer-events: none;
  min-width: max-content;
}

.backup-list-table th:last-child,
.backup-list-table td:last-child {
  white-space: nowrap;
}
.repository-audit-sortable-header {
  cursor: pointer;
}

.repository-audit-sort-button {
  appearance: auto;
}

/* ── RBAC Roles Modal ─────────────────────────────────────────────────────── */
#rbacRolesOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.rbac-roles-modal {
  width: min(500px, 95vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rbac-roles-modal .database-modal-body {
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.rbac-modal-desc {
  font-size: 0.9rem;
  color: var(--muted, #8a9bb0);
  margin-bottom: 1rem;
}

.rbac-modal-loading,
.rbac-modal-error,
.rbac-modal-empty {
  font-size: 0.9rem;
  color: var(--muted, #8a9bb0);
  padding: 1rem 0;
}

.rbac-roles-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rbac-roles-list-item {
  border: 1px solid var(--border, #e0e7ef);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}

.rbac-role-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}

.rbac-role-checkbox {
  margin-top: 2px;
  flex-shrink: 0;
}

.rbac-role-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.rbac-role-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--muted, #8a9bb0);
  margin-top: 1px;
}

/* ── RBAC Manager Modal ───────────────────────────────────────────────────── */
#rbacManagerOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.rbac-manager-modal {
  width: min(1180px, calc(100vw - 28px));
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rbac-manager-modal .database-modal-body {
  overflow-y: auto;
  padding: 1rem 1.2rem 1.2rem;
}

.rbac-manager-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rbac-manager-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(25, 42, 63, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(244, 248, 252, 0.98), rgba(248, 250, 252, 0.92));
}

.rbac-manager-summary-copy {
  min-width: 0;
}

.rbac-manager-eyebrow,
.rbac-panel-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary, #2463c8);
}

.rbac-manager-title,
.rbac-panel-title {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.2;
}

.rbac-manager-lead,
.rbac-panel-note {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted, #687b90);
  max-width: 70ch;
}

.rbac-manager-summary-stats,
.rbac-role-editor-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
}

.rbac-summary-pill,
.rbac-role-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 28px;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(25, 42, 63, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted, #5c6f86);
  font-size: 0.78rem;
  font-weight: 700;
}

.rbac-panel {
  border: 1px solid rgba(25, 42, 63, 0.12);
  border-radius: 14px;
  background: var(--surface, #fff);
  box-shadow: 0 8px 22px rgba(25, 42, 63, 0.05);
}

.rbac-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid rgba(25, 42, 63, 0.08);
}

.rbac-panel-header-copy {
  min-width: 0;
}

.rbac-panel-header .rbac-panel-title {
  font-size: 0.98rem;
}

.rbac-create-role-panel {
  padding-bottom: 1rem;
}

.rbac-create-role-form {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.rbac-create-role-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(260px, 1.6fr);
  gap: 0.75rem;
}

.rbac-create-role-form .auth-form-input {
  width: 100%;
  min-width: 0;
  padding: 0.6rem 0.8rem;
  font-size: 0.92rem;
}

.rbac-create-role-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rbac-create-role-hint,
.rbac-role-permissions-note,
.rbac-permission-category-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted, #738398);
}

.rbac-manager-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.rbac-role-list-panel,
.rbac-role-editor-panel {
  min-width: 0;
  overflow: hidden;
}

.rbac-role-list-panel {
  display: flex;
  flex-direction: column;
}

.rbac-role-system-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(36, 99, 200, 0.12);
  color: var(--primary, #2463c8);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}

.rbac-role-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem;
}

.rbac-role-list-item {
  display: flex;
  width: 100%;
  border: 1px solid rgba(25, 42, 63, 0.12);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.rbac-role-list-item:hover,
.rbac-role-list-item:focus-visible {
  border-color: rgba(36, 99, 200, 0.35);
  box-shadow: 0 10px 24px rgba(36, 99, 200, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.rbac-role-list-item.is-active {
  border-color: rgba(36, 99, 200, 0.45);
  background: rgba(239, 246, 252, 0.95);
}

.rbac-role-list-item-main {
  display: grid;
  gap: 0.35rem;
  width: 100%;
}

.rbac-role-list-item-name {
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.2;
}

.rbac-role-list-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.rbac-role-list-item-desc {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted, #738398);
}

.rbac-role-editor-panel {
  display: flex;
  flex-direction: column;
}

.rbac-role-editor-panel .rbac-panel-header {
  align-items: center;
}

.rbac-role-permissions-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.rbac-role-permissions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
  min-height: 0;
}

.rbac-permission-category {
  border: 1px solid rgba(25, 42, 63, 0.1);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 1));
}

.rbac-permission-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rbac-permission-category-title {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.3;
  font-weight: 800;
  color: var(--text);
}

.rbac-permission-category-count {
  display: inline-flex;
  min-width: 2rem;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(36, 99, 200, 0.12);
  color: var(--primary, #2463c8);
  font-size: 0.75rem;
  font-weight: 800;
}

.rbac-permission-category-note {
  margin-top: 0.35rem;
}

.rbac-permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.rbac-permission-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(25, 42, 63, 0.08);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.rbac-permission-item input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.rbac-permission-item-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.rbac-permission-item-title {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.rbac-permission-item-meta {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted, #738398);
  word-break: break-word;
}

.rbac-role-permissions-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0 1rem 1rem;
}

.rbac-role-delete-btn {
  margin-left: auto;
  flex-shrink: 0;
}

.rbac-create-role-panel .rbac-panel-header,
.rbac-role-list-panel .rbac-panel-header {
  padding-bottom: 0.9rem;
}

.rbac-create-role-panel .rbac-panel-header-copy,
.rbac-role-list-panel .rbac-panel-header-copy,
.rbac-role-editor-panel .rbac-panel-header-copy {
  flex: 1;
}

.rbac-manager-modal .rbac-modal-loading,
.rbac-manager-modal .rbac-modal-error,
.rbac-manager-modal .rbac-modal-empty {
  margin: 0;
  padding: 0.9rem 1rem;
}

.rbac-role-permissions-note {
  flex: 1 1 240px;
}

.rbac-perms-save-btn {
  margin-top: 0;
}

@media (max-width: 1040px) {
  .rbac-manager-layout {
    grid-template-columns: 1fr;
  }

  .rbac-manager-summary,
  .rbac-panel-header,
  .rbac-role-permissions-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .rbac-manager-summary-stats,
  .rbac-role-editor-badges {
    justify-content: flex-start;
  }

  .rbac-create-role-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .rbac-manager-modal {
    width: min(100vw - 14px, 1000px);
  }

  .rbac-manager-modal .database-modal-body {
    padding: 0.75rem;
  }

  .rbac-role-list,
  .rbac-role-permissions-grid {
    padding: 0.75rem;
  }

  .rbac-permission-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Canvas watermark ─────────────────────────── */
.canvas-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
.canvas-watermark-img {
  height: 180px;
  width: auto;
  opacity: 0.18;
}

/* Pool fills semi-transparent so watermark bleeds through */
#canvas svg rect {
  fill-opacity: 0.88 !important;
}
