.ps-entity-panel {
  background: linear-gradient(135deg, #112238, #0d1726);
  color: #f8fafc;
  border: 1px solid #1f2a3a;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 18px 32px rgba(7, 15, 27, 0.65);
}

.ps-entity-panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  color: #7dd3fc;
}

.ps-panel-section {
  margin-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 14px;
}

.ps-panel-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.ps-panel-section h3 {
  font-size: 16px;
  margin: 0 0 10px;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ps-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.ps-row input {
  flex: 1;
  background: #0b1420;
  color: #f8fafc;
  border: 1px solid #233044;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  caret-color: #38bdf8;
}

.ps-row input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px #38bdf8;
  background: #18283d;
  color: #e2e8f0;
}

.ps-row input::placeholder {
  color: #64748b;
}

.ps-mini-action {
  padding: 6px 10px;
  border-radius: 6px;
  background: #17263a;
  color: #7dd3fc;
  font-size: 12px;
  text-decoration: none;
}

.ps-mini-action:hover {
  background: #1f324c;
  color: #bae6fd;
}

.ps-select {
  flex: 1;
  background: #0b1420;
  color: #f8fafc;
  border: 1px solid #233044;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.ps-select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px #38bdf8;
  background: #18283d;
}

.ps-select option {
  color: #0f172a;
  background: #f1f5f9;
}

.ps-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.ps-primary {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.ps-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
}

.ps-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ps-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
}

.ps-color-swatch:hover {
  transform: scale(1.05);
}

.ps-color-active {
  box-shadow: 0 0 0 2px #f8fafc, 0 0 0 4px rgba(15, 23, 42, 0.3);
}

.ps-dialog {
  max-width: 640px;
  background: rgba(15,23,42,0.95);
  color: #f8fafc;
  padding: 0;
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.45);
  max-height: 88vh;
  overflow: hidden;
}

.ps-dialog-container {
  padding: 24px 28px 20px;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.ps-dialog-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #e2e8f0;
}

.ps-dialog-header p {
  margin: 8px 0 20px;
  color: #94a3b8;
  font-size: 14px;
}

.ps-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex: 1 1 auto;
  margin-right: -8px;
  padding-right: 8px;
}

.ps-dialog-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ps-dialog-field label {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5f5;
}

.ps-floating-actions {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 4000;
  pointer-events: none;
}

.ps-floating-btn {
  pointer-events: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, rgba(15,39,65,0.96), rgba(14,58,92,0.96));
  color: #f8fafc;
  box-shadow: 0 12px 35px rgba(2, 6, 23, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.ps-floating-icon {
  font-size: 24px;
  line-height: 1;
  font-weight: 600;
}

.ps-floating-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.65);
}

.ps-floating-btn:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

.ps-floating-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.35);
}

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

.ps-popup-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #111827;
}

.ps-popup-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.ps-popup-close:hover {
  color: #0f172a;
}

.ps-menu-item {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
}

.ps-menu-item.ps-menu-selected {
  background: #0f766e;
  color: #ecfeff !important;
}

.ps-collab-status {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.4);
  z-index: 4000;
  pointer-events: none;
}

.ps-collab-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

.ps-collab-status.is-connected .ps-collab-dot {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
}

.ps-queue-modal {
  max-width: 820px;
  background: rgba(6, 11, 23, 0.97);
  color: #e2e8f0;
  padding: 0;
  border-radius: 16px;
  box-shadow: 0 28px 60px rgba(8, 10, 23, 0.65);
  max-height: 90vh;
  overflow: hidden;
}

.ps-queue-console {
  display: flex;
  flex-direction: column;
  padding: 24px 28px;
  gap: 18px;
  max-height: 86vh;
}

.ps-queue-console-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.ps-queue-console-header h2 {
  margin: 0;
  color: #7dd3fc;
  letter-spacing: -0.01em;
}

.ps-queue-console-header p {
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 0.95rem;
}

.ps-queue-console-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ps-queue-console-body {
  background: rgba(15, 23, 42, 0.66);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 16px;
  overflow-y: auto;
  flex: 1 1 auto;
  max-height: 60vh;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.92rem;
}

.ps-queue-entry {
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.ps-queue-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ps-queue-entry .ps-queue-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #cbd5f5;
}

.ps-queue-entry .ps-queue-meta .ps-direction {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.ps-queue-entry .ps-direction.in {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.ps-queue-entry .ps-direction.out {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
}

.ps-queue-entry pre {
  margin: 8px 0 0;
  background: rgba(2, 6, 23, 0.85);
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 10px;
  color: #e0f2fe;
  white-space: pre-wrap;
  word-break: break-word;
}

.ps-dialog-field input,
.ps-dialog-field textarea,
.ps-dialog-field select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  color: #f8fafc;
  font-size: 14px;
  caret-color: #38bdf8;
}

.ps-dialog-field input:focus,
.ps-dialog-field textarea:focus,
.ps-dialog-field select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
  background: rgba(30, 41, 59, 0.95);
  color: #f8fafc;
}

.ps-dialog-field input::selection,
.ps-dialog-field textarea::selection {
  background: rgba(56, 189, 248, 0.35);
  color: #ffffff;
}

.ps-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  flex-shrink: 0;
}

.dbmv-table-editor {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dbmv-section {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.dbmv-section-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #cbd5f5;
}

.dbmv-item {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.dbmv-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #cbd5f5;
}

.dbmv-input,
.dbmv-textarea {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  color: #f8fafc;
  font-size: 14px;
}

.dbmv-input:focus,
.dbmv-textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.dbmv-textarea {
  min-height: 64px;
  resize: vertical;
}

.dbmv-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #cbd5f5;
}

.dbmv-flag {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.dbmv-description {
  display: flex;
  flex-direction: column;
}

.dbmv-row-actions {
  display: flex;
  justify-content: flex-end;
}

.dbmv-empty {
  font-size: 13px;
  color: #94a3b8;
  font-style: italic;
}

.ps-button {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.ps-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.4);
}

.ps-button.primary {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #ffffff;
}

.ps-button.secondary {
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5f5;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.ps-button.danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #ffffff;
}

.ps-button.success {
  background: linear-gradient(135deg, #059669, #34d399);
  color: #0f172a;
}

.ps-danger {
  background: linear-gradient(135deg, #dc2626, #f87171);
  color: #ffffff;
}

.ps-danger:hover {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
}

.ps-secondary {
  background: transparent;
  border: 1px solid #2f3f56;
  color: #cbd5f5;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
}

.ps-secondary:hover {
  border-color: #3f4f6b;
  color: #e0e7ff;
}

.ps-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.ps-pill {
  background: #17263a;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: #94a3b8;
}

.ps-inline-label {
  width: 90px;
  font-size: 13px;
  color: #94a3b8;
}

.ps-flex {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ps-columns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ps-empty {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

.ps-entity-modal {
  max-width: 640px;
  width: 90vw;
  padding: 0 !important;
  overflow: visible;
  top: 5vh !important;
  left: 50% !important;
  transform: translateX(-50%);
}

.ps-entity-modal .ps-entity-panel {
  max-height: 80vh;
  overflow-y: auto;
}

html,
body {
  height: 100%;
}

.off-canvas-wrap,
.inner-wrap,
.main-section {
  height: 100%;
}

#applicationView {
  height: calc(100vh - 45px);
  min-height: calc(100vh - 45px);
  overflow: hidden;
}

#display {
  height: 100%;
}

#paperScapeCanvas {
  display: block;
  width: 100%;
  height: 100%;
}
