:root {
  --bg: #0b1020;
  --panel: #121933;
  --muted: #7a88b8;
  --text: #e7ecff;
  --brand: #6ea8fe;
  --accent: #2dd4bf;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Helvetica, Arial;
  background: linear-gradient(180deg, #0b1020, #0a0f1f 60%);
  color: var(--text);
}

.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 16px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: radial-gradient(
      120% 120% at 10% 10%,
      var(--accent),
      transparent 50%
    ),
    radial-gradient(120% 120% at 90% 90%, var(--brand), transparent 50%),
    #0e1530;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) inset,
    0 10px 30px rgba(46, 118, 255, 0.2);
}
h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.3px;
}
.muted {
  color: var(--muted);
}

.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
}

.row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.row > * {
  flex: 1 1 280px;
  min-width: 0;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
input[type="file"],
textarea,
input[type="text"] {
  width: 100%;
  padding: 12px 12px;
  border-radius: 10px;
  background: #0e1530;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  outline: none;
}
textarea {
  min-height: 160px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
}

.btn {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, var(--brand), #3b6bd6);
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(80, 120, 255, 0.35);
  transition: 0.15s transform ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.secondary {
  background: linear-gradient(180deg, #1f2a54, #18234a);
  color: #cdd8ff;
  box-shadow: none;
}
.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cdd8ff;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: #0d1430;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  width: max-content;
}
.tab {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: #b9c6ff;
  user-select: none;
}
.tab.active {
  background: linear-gradient(180deg, #18234a, #121a3c);
  color: #fff;
}
.tab.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(40%);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.keyline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
  background: #0e1530;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  padding: 10px 12px;
  border-radius: 10px;
  overflow: auto;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
#maskedKey {
  max-width: 100%;
}
.hint {
  font-size: 12px;
  color: var(--muted);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #081027;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: #cfe0ff;
  font-size: 12px;
}
.footer {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
[hidden] {
  display: none !important;
}

/* Context menu */
.context-menu {
  position: fixed;
  z-index: 1000;
  min-width: 180px;
  background: #0d1430;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  padding: 6px;
}
.context-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #e7ecff;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.context-menu button:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Header layout helpers */
.header-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.header-title {
  grid-column: 1;
}
.header-center {
  grid-column: 2;
  text-align: center;
  line-height: 1.2;
  font-size: 12px;
}
.header-right {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.header-actions {
  gap: 8px;
  align-items: center;
}
