/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.15s ease;

  /* Dracula palette */
  --drac-bg:        #282a36;
  --drac-current:   #44475a;
  --drac-fg:        #ffffff;
  --drac-comment:   #8f9ec7;
  --drac-purple:    #bd93f9;
  --drac-pink:      #ff79c6;
  --drac-cyan:      #8be9fd;
  --drac-green:     #50fa7b;
  --drac-red:       #ff5555;
  --drac-yellow:    #f1fa8c;
  --drac-orange:    #ffb86c;

  /* Ghostbit brand — Cyber-Violet */
  --brand-primary:  #BC13FE;
  --brand-light:    #D067FF;
  --brand-ghost:    #F3E5FF;
  --brand-bg:       #0D0B14;
  --brand-gradient: linear-gradient(135deg, #BC13FE 0%, #7A18FF 100%);
  --brand-glow:     drop-shadow(0 0 8px rgba(188, 19, 254, 0.6)) drop-shadow(0 0 20px rgba(188, 19, 254, 0.35));
}

/* ── Dark theme (Dracula) ───────────────────────────────────────────────────── */
:root {
  --bg-page:      #21222c;
  --card:         #282a36;
  --card-2:       #323445;
  --code-bg:      #363a50;
  --border:       #44475a;
  --border-focus: #BC13FE;
  --text:         #f8f8f2;
  --text-muted:   #8b9cc8;
  --text-sub:     #a8b2d4;
  --accent:       #BC13FE;
  --accent-hover: #D067FF;
  --accent-dim:   rgba(188, 19, 254, 0.15);
  --danger:       #ff5555;
  --danger-hover: #ff7070;
  --toggle-off:   #44475a;
  --toggle-on:    #BC13FE;
  --shadow:       0 4px 24px rgba(0,0,0,0.6);
  --shadow-card:  0 4px 20px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04);
  --header-bg:    rgba(14, 14, 20, 0.85);

  /* Cyber-Violet dark gradient */
  --bg-gradient: linear-gradient(150deg, #0D0B14 0%, #110720 45%, #080f1a 75%, #0a0810 100%);
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
html { height: 100%; }

body {
  font-family: var(--font-ui);
  color: var(--text);
  min-height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
}

/* ── Page backgrounds ───────────────────────────────────────────────────────── */
.page-bg {
  flex: 1;
  background: var(--bg-gradient);
  background-attachment: scroll;
}

.page-plain {
  flex: 1;
  background: var(--bg-gradient);
  background-attachment: scroll;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 12px;

  /* Gradient text */
  background: linear-gradient(135deg, #BC13FE 0%, #D067FF 60%, #F3E5FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  /* Neon glow on the text */
  filter: drop-shadow(0 0 6px rgba(188, 19, 254, 0.7)) drop-shadow(0 0 14px rgba(188, 19, 254, 0.4));
  transition: filter var(--transition);
}
.logo span { -webkit-text-fill-color: transparent; }
.logo img {
  height: 44px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(188, 19, 254, 0.7)) drop-shadow(0 0 18px rgba(188, 19, 254, 0.4));
  transition: filter var(--transition);
}
.logo:hover {
  filter: drop-shadow(0 0 10px rgba(188, 19, 254, 0.9)) drop-shadow(0 0 22px rgba(188, 19, 254, 0.55));
}
.logo:hover img {
  filter: drop-shadow(0 0 12px rgba(188, 19, 254, 0.9)) drop-shadow(0 0 24px rgba(188, 19, 254, 0.55));
}

.header-actions { display: flex; align-items: center; gap: 8px; }


/* ── New paste button in header ─────────────────────────────────────────────── */
.btn-new {
  background: rgba(189,147,249,0.15);
  border: 1px solid rgba(189,147,249,0.3);
  border-radius: var(--radius-sm);
  color: var(--drac-purple);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
  font-family: var(--font-ui);
}
.btn-new:hover { background: rgba(189,147,249,0.25); }

/* ── Index page layout ──────────────────────────────────────────────────────── */
.index-layout {
  flex: 1;
  height: calc(100vh - 70px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.index-hero {
  text-align: center;
  flex-shrink: 0;
  padding: 24px 20px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: padding var(--transition);
}

.index-hero.hero-hidden .terminal-hero { display: none; }
.index-hero.hero-hidden { padding: 6px 20px; }

.hero-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  transition: border-color var(--transition), color var(--transition);
}
.hero-toggle svg { transition: transform 0.2s ease; }
.hero-toggle:hover { border-color: var(--brand-primary); color: var(--brand-light); }

.terminal-hero {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2.2vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
}

.terminal-prompt {
  color: var(--brand-primary);
  filter: drop-shadow(0 0 6px rgba(188,19,254,0.5));
  user-select: none;
}

#terminalText {
  color: #f8f8f2;
  min-width: 2ch;
}

.terminal-cursor {
  color: var(--brand-light);
  animation: blink 1s step-end infinite;
  margin-left: 1px;
  filter: drop-shadow(0 0 4px rgba(188,19,254,0.7));
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.index-sub {
  margin-top: 8px;
  font-size: 0.9rem;
  color: rgba(248,248,242,0.45);
  letter-spacing: 0.01em;
}

.index-form {
  width: 100%;
  padding: 0 80px 16px;
  display: flex;
  flex-direction: row;
  gap: 25px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.card-editor {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.index-sidebar {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.form-actions .btn-primary {
  width: 13em;
  justify-content: center;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255,255,255,0.1);
}

.card-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-sub {
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-top: 2px;
  font-weight: 400;
}

/* ── Code editor card ───────────────────────────────────────────────────────── */
.card-editor { padding: 0; overflow: hidden; }

.editor-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.18);
}

.editor-dots { display: flex; gap: 6px; }
.editor-dots span {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.editor-dots span:nth-child(1) { background: #ff5f57; }
.editor-dots span:nth-child(2) { background: #febc2e; }
.editor-dots span:nth-child(3) { background: #28c840; }

.lang-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.lang-picker-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.lang-picker {
  font-size: 0.75rem;
  padding: 3px 22px 3px 8px;
  min-width: 0;
  border-color: rgba(255,255,255,0.1);
  background-position: right 6px center;
  color: var(--text-muted);
}
.lang-picker:focus { color: var(--text); }

.editor-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--code-bg);
}

.editor-gutter {
  padding: 16px 12px 16px 14px;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  text-align: right;
  user-select: none;
  white-space: pre;
  min-width: 44px;
  opacity: 0.7;
  flex-shrink: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ── Editor code wrap (highlight overlay) ───────────────────────────────────── */
.editor-code-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.editor-highlight {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  padding: 16px 20px;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  tab-size: 2;
  word-break: normal;
  /* base text uses default fg so untagged nodes stay visible when hl-active */
  color: var(--drac-fg);
  background: transparent;
  margin: 0;
}
.editor-highlight .hljs { background: transparent; }

/* ── Textarea ───────────────────────────────────────────────────────────────── */
textarea {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 16px 20px;
  outline: none;
  resize: none;
  line-height: 1.7;
  display: block;
  tab-size: 2;
  overflow-y: auto;
  /* when highlighting active — text transparent, caret stays visible */
  transition: color 0.1s;
}
textarea.hl-active { color: transparent; caret-color: var(--drac-fg); }
textarea::placeholder { color: var(--text-sub); opacity: 0.5; }

.char-counter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.char-counter.warn  { color: var(--drac-orange); }
.char-counter.error { color: var(--danger); }

/* ── Options card rows ──────────────────────────────────────────────────────── */
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  gap: 12px;
}
.option-row:last-child { border-bottom: none; padding-bottom: 0; }
.option-row:first-child { padding-top: 0; }

/* Expiration row: stacks label + select vertically */
.option-row-column {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.option-row-column select { width: auto; min-width: 120px; }

.input-small {
  background: var(--card-2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  padding: 5px 10px;
  outline: none;
  width: 80px;
  transition: border-color var(--transition);
  -moz-appearance: textfield;
  appearance: textfield;
}
.input-small::-webkit-outer-spin-button,
.input-small::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.input-small:focus { border-color: var(--border-focus); }

.number-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}
.number-wrap:focus-within { border-color: var(--border-focus); }
.number-wrap .input-small {
  border: none;
  border-radius: 0;
  width: 52px;
  text-align: center;
  padding: 5px 4px;
}
.number-wrap .input-small:focus { border-color: transparent; }
.number-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 100%;
  min-height: 30px;
  background: var(--card-2);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-mono);
  transition: background var(--transition), color var(--transition);
  user-select: none;
  padding: 0;
}
.number-btn:hover { background: var(--border); color: var(--text); }
.number-btn:active { background: var(--accent-dim); color: var(--accent); }
.number-btn-minus { border-right: 1px solid rgba(255,255,255,0.07); }
.number-btn-plus  { border-left: 1px solid rgba(255,255,255,0.07); }
.option-row-webhook  { border-bottom: none; }

.option-text { flex: 1; min-width: 0; }
.option-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.option-desc {
  font-size: 0.74rem;
  color: var(--text-sub);
  margin-top: 3px;
  line-height: 1.4;
}

/* Select */
select {
  background: var(--card-2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  padding: 6px 28px 6px 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: border-color var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236272a4' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 110px;
}
select:focus { border-color: var(--border-focus); }

/* Password input (revealed on toggle) */
.password-input-wrap {
  display: none;
  padding-top: 12px;
  margin-top: 2px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.password-input-wrap.visible { display: block; }
.password-input-wrap input {
  width: 100%;
  background: var(--card-2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  padding: 7px 12px;
  outline: none;
  transition: border-color var(--transition);
}
.password-input-wrap input:focus { border-color: var(--border-focus); }

/* Webhook input (revealed on toggle) */
.webhook-input-wrap {
  display: none;
  padding-top: 12px;
  margin-top: 2px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.webhook-input-wrap.visible { display: block; }
.webhook-input-wrap input {
  width: 100%;
  background: var(--card-2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  padding: 7px 12px;
  outline: none;
  transition: border-color var(--transition);
  box-sizing: border-box;
}
.webhook-input-wrap input:focus { border-color: var(--border-focus); }

/* ── Toggle switch ──────────────────────────────────────────────────────────── */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: var(--toggle-off);
  cursor: pointer;
  transition: background 0.2s ease;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.toggle input:checked ~ .toggle-track { background: var(--toggle-on); }
.toggle input:checked ~ .toggle-track::after { transform: translateX(18px); }

/* ── Form actions ───────────────────────────────────────────────────────────── */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shortcut-hint {
  font-size: 0.75rem;
  color: rgba(248,248,242,0.3);
  display: flex;
  align-items: center;
  gap: 3px;
}

kbd {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(248,248,242,0.5);
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-ui);
  line-height: 1.4;
}
.btn svg { flex-shrink: 0; }

.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  border-color: var(--brand-primary);
  box-shadow: 0 2px 14px rgba(188, 19, 254, 0.35);
}
.btn-primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 2px 20px rgba(188, 19, 254, 0.5);
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding: 6px 12px;
}
.btn-ghost:hover { color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--border);
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-sm { padding: 5px 12px; font-size: 0.8rem; font-weight: 500; }

/* ── Notices ────────────────────────────────────────────────────────────────── */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 0.845rem;
  border: 1px solid;
  line-height: 1.5;
}
.notice svg { flex-shrink: 0; margin-top: 1px; }
.notice-warning { background: rgba(241,250,140,0.07); border-color: rgba(241,250,140,0.3);  color: var(--drac-yellow); }
.notice-info    { background: rgba(139,233,253,0.07); border-color: rgba(139,233,253,0.25); color: var(--drac-cyan); }
.notice-error   { background: rgba(255,85,85,0.08);   border-color: rgba(255,85,85,0.3);   color: #ff6e6e; }

/* ── Paste view page ────────────────────────────────────────────────────────── */
.page-plain {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-gradient);
  background-attachment: scroll;
}

.paste-layout {
  flex: 1;
  padding-top: 28px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
  padding-bottom: 40px;
}

.paste-info { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(188, 19, 254, 0.12);
  color: var(--brand-light);
  border: 1px solid rgba(188, 19, 254, 0.25);
  letter-spacing: 0.02em;
}
.badge-neutral {
  background: rgba(98,114,164,0.12);
  color: var(--text-sub);
  border-color: rgba(98,114,164,0.2);
}
.badge-condition {
  background: rgba(188, 19, 254, 0.08);
  color: var(--brand-light);
  border-color: rgba(188, 19, 254, 0.2);
}
.paste-conditions-sep {
  color: var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0 6px;
  user-select: none;
}

/* Inbar — meta + actions inside the code block */
.paste-inbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
  gap: 8px;
  flex-wrap: wrap;
}

.paste-inbar-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding-left: 16px;
}

.paste-inbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.paste-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-right: 10px;
  border-right: 1px solid var(--border);
  margin-right: 2px;
  letter-spacing: 0.03em;
  opacity: 0.7;
}

/* Icon-only action buttons */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  padding: 0;
}
.icon-btn:hover {
  background: rgba(188, 19, 254, 0.12);
  color: var(--brand-light);
  border-color: rgba(188, 19, 254, 0.25);
}
.icon-btn-danger:hover {
  background: rgba(255, 85, 85, 0.12);
  color: var(--danger);
  border-color: rgba(255, 85, 85, 0.25);
}

/* Paste action buttons (copy / delete) */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn-action-url {
  background: rgba(139, 233, 253, 0.1);
  border-color: rgba(139, 233, 253, 0.3);
  color: var(--drac-cyan);
}
.btn-action-url:hover { background: rgba(139, 233, 253, 0.2); }
.btn-action-copy {
  background: rgba(80, 250, 123, 0.1);
  border-color: rgba(80, 250, 123, 0.3);
  color: var(--drac-green);
}
.btn-action-copy:hover { background: rgba(80, 250, 123, 0.2); }
.btn-action-raw {
  background: rgba(255, 184, 108, 0.1);
  border-color: rgba(255, 184, 108, 0.3);
  color: var(--drac-orange);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-action-raw:hover { background: rgba(255, 184, 108, 0.2); }
.btn-action-download {
  background: rgba(241, 250, 140, 0.1);
  border-color: rgba(241, 250, 140, 0.3);
  color: var(--drac-yellow);
}
.btn-action-download:hover { background: rgba(241, 250, 140, 0.2); }
.btn-action-delete {
  background: rgba(255, 85, 85, 0.1);
  border-color: rgba(255, 85, 85, 0.3);
  color: var(--danger);
}
.btn-action-delete:hover { background: rgba(255, 85, 85, 0.2); }

/* Paste content */
.paste-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card), 0 0 30px rgba(188, 19, 254, 0.07);
}
.paste-body { display: flex; overflow: auto; background: var(--code-bg); }

.line-gutter {
  padding: 16px 12px 16px 14px;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  text-align: right;
  user-select: none;
  white-space: pre;
  min-width: 44px;
  opacity: 0.7;
  flex-shrink: 0;
}

.paste-body pre {
  margin: 0;
  padding: 16px 20px;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre;
  tab-size: 2;
  color: var(--drac-fg);
  min-width: 0;
  overflow-x: auto;
}

/* ── Password page ──────────────────────────────────────────────────────────── */
.password-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-gradient);
  background-attachment: scroll;
}
.password-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.lock-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(189,147,249,0.1);
  border: 1px solid rgba(189,147,249,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--drac-purple);
}
.password-card h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.password-card .sub { font-size: 0.83rem; color: var(--text-sub); margin-bottom: 24px; display: block; }
.password-card input {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 9px 14px;
  outline: none;
  transition: border-color var(--transition);
  margin-bottom: 12px;
  text-align: left;
}
.password-card input:focus { border-color: var(--border-focus); }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 0.72rem;
  color: rgba(248,248,242,0.5);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.site-footer a {
  color: inherit;
  text-decoration: none;
}
.site-footer a:hover { color: var(--accent); }
.site-footer .sep { opacity: 0.4; }
.footer-star {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand-light) !important;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.footer-star:hover { opacity: 1 !important; }

.star-nudge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(188, 19, 254, 0.25);
  background: rgba(188, 19, 254, 0.07);
  color: var(--brand-light);
  font-size: 0.78rem;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.star-nudge:hover {
  background: rgba(188, 19, 254, 0.15);
  border-color: rgba(188, 19, 254, 0.5);
  color: var(--brand-light);
}
.star-nudge svg { flex-shrink: 0; fill: var(--brand-light); }
.star-nudge-count {
  display: none;
  font-weight: 600;
  opacity: 0.7;
  font-size: 0.72rem;
}

/* ── Tab switcher ───────────────────────────────────────────────────────────── */
.tab-switcher {
  display: flex;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.tab {
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 3px 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--surface-2, #44475a);
  color: var(--text);
}

/* ── Markdown preview ───────────────────────────────────────────────────────── */
.md-preview { }

.md-body {
  padding: 28px 36px;
  line-height: 1.75;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  max-width: 780px;
}

.md-body h1, .md-body h2, .md-body h3,
.md-body h4, .md-body h5, .md-body h6 {
  font-weight: 600;
  line-height: 1.3;
  margin: 1.4em 0 0.5em;
  color: var(--text);
}
.md-body h1 { font-size: 1.7rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.md-body h2 { font-size: 1.3rem; border-bottom: 1px solid var(--border); padding-bottom: 0.2em; }
.md-body h3 { font-size: 1.1rem; }

.md-body p { margin: 0.8em 0; }

.md-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.md-body a:hover { color: var(--accent-hover); }

.md-body code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--surface-2, #44475a);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--drac-pink);
}

.md-body pre {
  background: var(--surface-2, #44475a);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 1em 0;
}
.md-body pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 0.875rem;
}

.md-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1em 0;
  padding: 4px 0 4px 16px;
  color: var(--text-muted);
}

.md-body ul, .md-body ol { padding-left: 1.5em; margin: 0.6em 0; }
.md-body li { margin: 0.25em 0; }

.md-body table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.875rem; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.md-body th { background: var(--surface-2, #44475a); font-weight: 600; }

.md-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }

.md-body img { max-width: 100%; border-radius: var(--radius-sm); }

/* ── API docs ───────────────────────────────────────────────────────────────── */
.api-header { margin-bottom: 32px; }
.api-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; }
.api-sub { font-size: 0.875rem; color: var(--text-muted); }
.api-sub code { color: var(--accent); background: var(--accent-dim); padding: 1px 6px; border-radius: 4px; }

.api-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.api-section-title { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }

.api-method-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.api-method-line code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text);
}
.method {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}
.method.post   { background: rgba(80,250,123,0.12); color: #50fa7b; border: 1px solid rgba(80,250,123,0.25); }
.method.get    { background: rgba(139,233,253,0.1);  color: #8be9fd; border: 1px solid rgba(139,233,253,0.25); }
.method.delete { background: rgba(255,85,85,0.1);   color: #ff5555; border: 1px solid rgba(255,85,85,0.25); }

.api-desc { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 16px; }
.api-desc code { color: var(--accent); background: var(--accent-dim); padding: 1px 5px; border-radius: 3px; font-family: var(--font-mono); font-size: 0.8rem; }

.api-block-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 0 6px;
}
.api-block-label .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }

.api-code {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}

.api-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.api-table tr { border-bottom: 1px solid var(--border); }
.api-table tr:last-child { border-bottom: none; }
.api-table td { padding: 10px 8px; color: var(--text-muted); }
.api-table td:first-child { width: 60px; }
.api-table td code { color: var(--accent); font-family: var(--font-mono); font-size: 0.8rem; }

/* ── Animations ─────────────────────────────────────────────────────────────── */

.fade-in { animation: fadeIn 0.2s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Toast notifications ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
.toast.toast-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.toast-error {
  background: #2a1a1a;
  border: 1px solid rgba(255, 85, 85, 0.4);
  color: #ff8080;
}
.toast svg { flex-shrink: 0; }
.toast span { flex: 1; line-height: 1.4; }
.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  padding: 2px;
  display: flex;
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.toast-close:hover { opacity: 1; }

/* ── Syntax highlighting (highlight.js — Dracula theme) ─────────────────────── */
.hljs                          { color: var(--drac-fg); background: transparent; }
.hljs-comment, .hljs-quote     { color: var(--drac-comment); font-style: italic; }
.hljs-keyword, .hljs-selector-tag,
.hljs-addition                 { color: var(--drac-pink); }
.hljs-number, .hljs-literal,
.hljs-selector-attr,
.hljs-selector-pseudo          { color: var(--drac-purple); }
.hljs-string, .hljs-doctag,
.hljs-regexp, .hljs-attribute  { color: var(--drac-yellow); }
.hljs-title, .hljs-section,
.hljs-built_in,
.hljs-title.class_             { color: var(--drac-cyan); }
.hljs-type, .hljs-variable,
.hljs-template-variable        { color: var(--drac-orange); }
.hljs-tag, .hljs-name,
.hljs-selector-id              { color: var(--drac-pink); }
.hljs-attr                     { color: var(--drac-cyan); }
.hljs-meta, .hljs-symbol,
.hljs-bullet, .hljs-link       { color: var(--drac-purple); }
.hljs-deletion                 { color: var(--drac-red); }
.hljs-emphasis                 { font-style: italic; }
.hljs-strong                   { font-weight: 700; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  /* ── Allow page to scroll ── */
  html, body { height: auto; }

  /* ── Header ── */
  header { height: 54px; padding: 0 12px; position: static; }
  .logo { font-size: 1rem; gap: 8px; }
  .logo img { height: 32px; }
  /* API button: hidden on mobile */
  .btn-api { display: none; }
  /* All labeled buttons: icon only */
  .btn-new [data-label] { display: none; }
  /* Tighter gap between header buttons */
  .header-actions { gap: 6px; }

  /* ── Index layout: scrollable instead of fixed 100vh ── */
  .index-layout { height: auto; min-height: calc(100vh - 54px); overflow: visible; }
  /* ── Form ── */
  .index-form { flex-direction: column; padding: 20px 12px 24px; flex: none; gap: 20px; }
  .index-sidebar { flex: none; width: 100%; gap: 20px; }
  /* Editor */
  .card-editor { flex: none; }
  .editor-body { flex: none; height: auto; overflow: visible; }
  .editor-code-wrap { overflow: visible; }
  textarea { min-height: 220px; height: auto; overflow: hidden; resize: none; }
  .editor-highlight { padding: 10px 12px; }
  .editor-gutter { padding: 10px 8px 10px 10px; min-width: 44px; font-size: 0.8rem; }
  textarea { padding: 10px 12px; font-size: 0.82rem; }
  .editor-topbar { padding: 7px 10px; }

  /* Hero: hidden on mobile */
  .index-hero { display: none; }

  /* ── Submit row ── */
  .shortcut-hint { display: none; }
  .form-actions { flex-direction: row; }
  .form-actions .btn-primary { flex: 1; width: 100%; justify-content: center; }

  /* ── Footer ── */
  .site-footer { display: block; text-align: center; padding: 12px 16px; line-height: 2; }

  /* ── Paste page ── */
  .paste-layout { padding-top: 16px; padding-left: 14px; padding-right: 14px; padding-bottom: 30px; }
  .line-gutter { padding: 10px 8px 10px 10px; min-width: 44px; font-size: 0.8rem; }
  .paste-body pre { padding: 10px 12px; font-size: 0.82rem; }
  .paste-inbar { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; }
  .paste-inbar-meta { flex: 1; min-width: 0; }
}

/* ── Error page ───────────────────────────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: 40px 20px;
}
.error-code {
  font-family: var(--font-mono);
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.85;
}
.error-icon {
  margin: 20px 0 16px;
  color: var(--text-muted);
}
.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.error-message {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.6;
}
