html {
  color-scheme: dark;
}

body {
  background:
    radial-gradient(circle at 15% 8%, rgba(192, 132, 252, 0.22), transparent 28rem),
    radial-gradient(circle at 90% 18%, rgba(244, 114, 182, 0.1), transparent 24rem),
    linear-gradient(135deg, #10081f 0%, #170d29 44%, #211337 100%);
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

.icon-btn,
.copy-field {
  display: inline-flex;
  height: 2rem;
  width: 2rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  border: 1px solid #4b2e72;
  background: #10081f;
  color: #cbd5e1;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.icon-btn:hover,
.copy-field:hover {
  border-color: #c084fc;
  color: #d8b4fe;
  background: #1a102d;
}

.action-btn,
.secondary-btn {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #4b2e72;
  background: #24163d;
  padding: 0.55rem 0.8rem;
  color: #f8fafc;
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.action-btn:hover:not(:disabled),
.secondary-btn:hover {
  transform: translateY(-1px);
  border-color: #c084fc;
  background: #322052;
}

.action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tab-btn {
  min-width: 5.75rem;
  border-radius: 0.25rem;
  padding: 0.5rem 0.8rem;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 700;
  transition: color 140ms ease, background 140ms ease;
}

.tab-btn:hover {
  color: #f8fafc;
}

.tab-btn.active {
  background: #2b1b49;
  color: #d8b4fe;
}

.field-card {
  min-width: 0;
  border-radius: 0.5rem;
  border: 1px solid #4b2e72;
  background: #24163d;
  padding: 1rem;
}

.security-high {
  border-color: rgba(244, 114, 182, 0.58);
}

.security-medium,
.security-low {
  border-color: rgba(216, 180, 254, 0.58);
}

.field-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.field-label {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.4rem;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field-value {
  margin-top: 0.7rem;
  overflow-wrap: anywhere;
  color: #f8fafc;
  font-size: 0.98rem;
  line-height: 1.55;
}

.prompt-card .field-value {
  max-height: 15rem;
  overflow: auto;
  white-space: pre-wrap;
}

.tooltip-icon {
  position: relative;
  display: inline-flex;
  color: #64748b;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  position: absolute;
  z-index: 60;
  bottom: calc(100% + 0.55rem);
  left: 50%;
  width: max-content;
  max-width: min(18rem, 80vw);
  transform: translateX(-50%) translateY(4px);
  border: 1px solid #4b2e72;
  border-radius: 0.375rem;
  background: #10081f;
  color: #e2e8f0;
  content: attr(data-tooltip);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0;
  padding: 0.5rem 0.65rem;
  pointer-events: none;
  text-transform: none;
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: normal;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tree-node {
  border-left: 1px solid #4b2e72;
  margin-left: 0.35rem;
  padding-left: 0.75rem;
}

.tree-leaf,
.tree-summary {
  align-items: start;
  display: flex;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.28rem 0;
}

.tree-summary {
  cursor: pointer;
  color: #d8b4fe;
  font-weight: 700;
}

.tree-key {
  color: #f0abfc;
  flex: none;
  max-width: 16rem;
  overflow-wrap: anywhere;
}

.tree-value {
  color: #e2e8f0;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.drag-active {
  border-color: #d8b4fe !important;
  background: #322052 !important;
}

@media (max-width: 640px) {
  .tab-btn {
    min-width: 0;
    flex: 1;
    padding-inline: 0.45rem;
  }
}
