/* ── Reset ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #0d1117;
  color: #e6edf3;
}

/* ── Buttons ── */
.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: #238636; color: #fff; }
.btn-primary:hover { background: #2ea043; }
.btn-ghost { background: #21262d; color: #c9d1d9; border: 1px solid #30363d; }
.btn-ghost:hover { background: #30363d; }
.btn-danger { background: #21262d; color: #f85149; border: 1px solid #f8514966; }
.btn-danger:hover { background: #f8514922; }

.hidden { display: none !important; }

/* ═══════ PASTE MODE ═══════ */
#pasteMode { display: flex; flex-direction: column; height: 100%; }
#pasteMode.hidden { display: none; }

.paste-header {
  padding: 16px 20px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.paste-header h1 { font-size: 1.1rem; font-weight: 700; }
.paste-header h1 span { color: #58a6ff; }
.paste-actions { display: flex; gap: 8px; flex-wrap: wrap; }

textarea {
  flex: 1;
  width: 100%;
  border: 0;
  outline: 0;
  resize: none;
  padding: 20px;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', ui-monospace, monospace;
  font-size: .9rem;
  line-height: 1.7;
  tab-size: 2;
  background: #0d1117;
  color: #e6edf3;
}
textarea::placeholder { color: #484f58; font-family: system-ui, sans-serif; }

.paste-footer {
  padding: 10px 20px;
  background: #161b22;
  border-top: 1px solid #30363d;
  font-size: .78rem;
  color: #8b949e;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ═══════ PREVIEW MODE ═══════ */
#previewMode { display: flex; flex-direction: column; height: 100%; }
#previewMode.hidden { display: none; }

.preview-header {
  padding: 12px 20px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.title-filename { font-size: .85rem; font-weight: 600; color: #8b949e; }
.title-filename span { color: #e6edf3; }

.preview-body { flex: 1; background: #fff; }
.preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1f2937;
  color: #e6edf3;
  font-size: .85rem;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  z-index: 99;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Mobile ── */
@media (max-width: 600px) {
  .paste-header { flex-direction: column; align-items: stretch; text-align: center; }
  .paste-actions { justify-content: center; }
  .btn { flex: 1; text-align: center; }
}
