/* ══════════════════════════════════════════════════════════
   Report Writer — Gen-Z Neon Glassmorphism Theme
   ══════════════════════════════════════════════════════════ */

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

:root {
  --bg: #0a0a0f;
  --bg2: #12121c;
  --bg3: #1a1a2e;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --text: #eaeaef;
  --text-dim: #7a7a9a;
  --accent: #8b5cf6;
  --accent2: #06b6d4;
  --accent-glow: rgba(139, 92, 246, 0.4);
  --accent2-glow: rgba(6, 182, 212, 0.3);
  --gradient: linear-gradient(135deg, #8b5cf6, #06b6d4);
  --gradient-reverse: linear-gradient(135deg, #06b6d4, #8b5cf6);
  --gradient-hot: linear-gradient(135deg, #f43f5e, #8b5cf6, #06b6d4);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --warning: #f59e0b;
  --danger: #f43f5e;
  --danger-glow: rgba(244, 63, 94, 0.3);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 50px;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Glassmorphism ────────────────────────────────────── */
.glass {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  position: relative;
}

.glass::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0), rgba(6, 182, 212, 0));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: background 0.5s ease;
  z-index: 1;
}

.glass:hover::before {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(6, 182, 212, 0.5));
}

.glass:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

/* ── Password Gate ────────────────────────────────────── */
.gate-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1000;
  overflow: hidden;
}

/* Animated mesh gradient background */
.gate-overlay::before {
  content: '';
  position: absolute;
  width: 150vmax;
  height: 150vmax;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(244, 63, 94, 0.1) 0%, transparent 50%);
  animation: meshRotate 20s linear infinite;
  z-index: 0;
}

@keyframes meshRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Floating particles */
.gate-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.gate-particles span {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(139, 92, 246, 0.6);
  border-radius: 50%;
  animation: floatParticle 15s infinite linear;
}

.gate-particles span:nth-child(1)  { left:  5%; animation-delay: 0s;   animation-duration: 18s; width: 3px; height: 3px; }
.gate-particles span:nth-child(2)  { left: 15%; animation-delay: 1s;   animation-duration: 14s; background: rgba(6, 182, 212, 0.5); }
.gate-particles span:nth-child(3)  { left: 25%; animation-delay: 2s;   animation-duration: 20s; width: 5px; height: 5px; }
.gate-particles span:nth-child(4)  { left: 35%; animation-delay: 0.5s; animation-duration: 16s; background: rgba(244, 63, 94, 0.4); }
.gate-particles span:nth-child(5)  { left: 45%; animation-delay: 3s;   animation-duration: 22s; }
.gate-particles span:nth-child(6)  { left: 55%; animation-delay: 1.5s; animation-duration: 13s; background: rgba(6, 182, 212, 0.5); width: 6px; height: 6px; }
.gate-particles span:nth-child(7)  { left: 65%; animation-delay: 4s;   animation-duration: 17s; }
.gate-particles span:nth-child(8)  { left: 75%; animation-delay: 2.5s; animation-duration: 19s; background: rgba(244, 63, 94, 0.4); }
.gate-particles span:nth-child(9)  { left: 85%; animation-delay: 0.8s; animation-duration: 15s; width: 3px; height: 3px; }
.gate-particles span:nth-child(10) { left: 92%; animation-delay: 3.5s; animation-duration: 21s; background: rgba(6, 182, 212, 0.5); }
.gate-particles span:nth-child(11) { left: 10%; animation-delay: 5s;   animation-duration: 16s; background: rgba(139, 92, 246, 0.3); width: 7px; height: 7px; }
.gate-particles span:nth-child(12) { left: 30%; animation-delay: 6s;   animation-duration: 23s; }
.gate-particles span:nth-child(13) { left: 50%; animation-delay: 4.5s; animation-duration: 12s; background: rgba(6, 182, 212, 0.4); }
.gate-particles span:nth-child(14) { left: 70%; animation-delay: 7s;   animation-duration: 18s; width: 5px; height: 5px; }
.gate-particles span:nth-child(15) { left: 88%; animation-delay: 2s;   animation-duration: 25s; background: rgba(244, 63, 94, 0.3); }

@keyframes floatParticle {
  0%   { transform: translateY(110vh) scale(0); opacity: 0; }
  10%  { opacity: 1; transform: translateY(90vh) scale(1); }
  90%  { opacity: 1; }
  100% { transform: translateY(-10vh) scale(0.5); opacity: 0; }
}

.gate-card {
  text-align: center;
  padding: 56px 48px;
  max-width: 440px;
  width: 90%;
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  z-index: 10;
  background: rgba(10, 10, 15, 0.7) !important;
  border: 1px solid rgba(139, 92, 246, 0.2) !important;
  box-shadow:
    0 0 60px rgba(139, 92, 246, 0.08),
    0 25px 50px rgba(0, 0, 0, 0.5);
}

.gate-card::before {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.3)) !important;
}

.gate-icon {
  font-size: 72px;
  margin-bottom: 20px;
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.gate-card h1 {
  font-size: 32px;
  margin-bottom: 8px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gate-card p.gate-subtitle {
  color: var(--text-dim);
  margin-bottom: 32px;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.gate-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gate-card input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-pill);
  padding: 16px 24px;
  font-size: 16px;
  color: var(--text);
  text-align: center;
  letter-spacing: 6px;
  outline: none;
  transition: all 0.3s ease;
}

.gate-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.error-text { color: var(--danger); font-size: 13px; margin-top: 8px; }

/* ── Header ───────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  margin: 16px 20px;
  position: sticky;
  top: 10px;
  z-index: 100;
  background: rgba(10, 10, 15, 0.6) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header-left { display: flex; align-items: center; gap: 14px; }
.header-left .logo { font-size: 28px; filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5)); }
.header-left h1 {
  font-size: 20px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-right { display: flex; align-items: center; gap: 12px; }

.badge {
  background: var(--gradient);
  color: white;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ── Tabs ─────────────────────────────────────────────── */
.tab-bar {
  padding: 0 20px;
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab-bar-inner {
  display: inline-flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 5px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
}

.tab {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.tab-icon { font-size: 15px; }

.tab:hover {
  color: var(--text);
  background: rgba(139, 92, 246, 0.1);
}

.tab.active {
  color: white;
  background: var(--gradient);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.tab-content {
  display: none;
  padding: 0 20px 40px;
  animation: fadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab-content.active { display: block; }

/* ── Bento Grid ───────────────────────────────────────── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.bento-card {
  padding: 32px;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.card-animate {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.card-animate:nth-child(1) { animation-delay: 0s; }
.card-animate:nth-child(2) { animation-delay: 0.08s; }
.card-animate:nth-child(3) { animation-delay: 0.16s; }
.card-animate:nth-child(4) { animation-delay: 0.24s; }
.card-animate:nth-child(5) { animation-delay: 0.32s; }

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.full-width { grid-column: 1 / -1; }

.bento-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.desc { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }

/* ── Upload Zone ──────────────────────────────────────── */
.upload-zone {
  border: 2px dashed rgba(139, 92, 246, 0.3);
  border-radius: var(--radius);
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  background: rgba(139, 92, 246, 0.02);
  animation: pulseBorder 3s ease-in-out infinite;
}

@keyframes pulseBorder {
  0%, 100% { border-color: rgba(139, 92, 246, 0.2); }
  50% { border-color: rgba(6, 182, 212, 0.4); }
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.upload-zone:hover::before,
.upload-zone.dragover::before { opacity: 1; }

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.06);
  transform: scale(1.01);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.1);
}

.upload-zone.dragover {
  animation: bounce 0.6s;
}

@keyframes bounce {
  0%, 100% { transform: scale(1.01); }
  30% { transform: scale(1.03); }
  60% { transform: scale(0.99); }
}

.upload-icon {
  margin-bottom: 16px;
}

.upload-icon-inner {
  font-size: 52px;
  display: inline-block;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.4));
  animation: floatIcon 3s ease-in-out infinite;
}

.upload-text-main {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.divider-text {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin: 28px 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-size: 14px;
  color: var(--text);
  resize: vertical;
  font-family: inherit;
  line-height: 1.7;
  outline: none;
  transition: all 0.3s ease;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  background: rgba(139, 92, 246, 0.03);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-sm);
  margin-top: 14px;
  font-size: 13px;
}

.file-info span:first-child { font-weight: 700; flex: 1; }

.options-row {
  margin: 20px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s;
}

.checkbox-label:hover { color: var(--text); }

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 16px 36px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow), 0 4px 15px var(--accent2-glow);
}

.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

.btn-lg { padding: 18px 36px; font-size: 17px; }

.btn-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.15);
}

.btn-sm.danger {
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--danger);
}

.btn-sm.danger:hover {
  background: rgba(244, 63, 94, 0.1);
  box-shadow: 0 0 16px var(--danger-glow);
}

.btn-glow { position: relative; }

.btn-icon { font-size: 14px; }

/* ── Length Options ────────────────────────────────────── */
.option-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}

.length-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.length-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.length-emoji { font-size: 24px; margin-bottom: 2px; }
.length-text { font-weight: 700; color: var(--text); font-size: 13px; }
.length-btn small { font-size: 11px; color: var(--text-dim); }

.length-btn:hover {
  border-color: rgba(139, 92, 246, 0.4);
  color: var(--text);
  background: rgba(139, 92, 246, 0.06);
  transform: translateY(-2px);
}

.length-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.15));
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 24px var(--accent-glow);
}

.length-btn.active .length-text { color: white; }
.length-btn.active small { color: rgba(255, 255, 255, 0.7); }

.length-btn.active::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── Pipeline Steps ───────────────────────────────────── */
.pipeline-grid {
  grid-template-columns: 1fr;
  max-width: 800px;
  position: relative;
}

.pipeline-line {
  position: absolute;
  left: 47px;
  top: 60px;
  bottom: 60px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent2), var(--accent));
  opacity: 0.2;
  border-radius: 1px;
  z-index: 0;
}

.step-card {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.step-num {
  width: 36px;
  height: 36px;
  background: rgba(139, 92, 246, 0.1);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  color: var(--accent);
  transition: all 0.4s ease;
}

.step-header h3 { flex: 1; font-size: 17px; font-weight: 700; }

.step-status {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
}

.step-status.waiting {
  background: rgba(122, 122, 154, 0.15);
  color: var(--text-dim);
}

.step-status.running {
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  animation: pulseGlow 1.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; box-shadow: 0 0 16px var(--accent-glow); }
  50% { opacity: 0.7; box-shadow: 0 0 24px var(--accent-glow); }
}

.step-status.done {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  box-shadow: 0 0 12px var(--success-glow);
}

.step-status.error {
  background: rgba(244, 63, 94, 0.2);
  color: var(--danger);
  box-shadow: 0 0 12px var(--danger-glow);
}

.step-card.active {
  border-color: rgba(139, 92, 246, 0.4) !important;
  box-shadow: 0 0 32px var(--accent-glow);
}

.step-card.active::before {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(6, 182, 212, 0.4)) !important;
}

.step-card.active .step-num {
  background: var(--gradient);
  border-color: transparent;
  color: white;
  animation: pulseNum 2s ease-in-out infinite;
}

@keyframes pulseNum {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.step-card.completed .step-num {
  background: var(--success);
  border-color: var(--success);
  color: white;
  box-shadow: 0 0 16px var(--success-glow);
}

/* Particle burst on completion */
.step-card.completed::after {
  content: '';
  position: absolute;
  top: 24px;
  left: 48px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow:
    12px -8px 0 var(--accent),
    -10px -12px 0 var(--accent2),
    15px 5px 0 var(--success),
    -8px 10px 0 var(--warning),
    20px -3px 0 var(--danger);
  animation: confettiBurst 0.8s ease-out forwards;
  opacity: 0;
}

@keyframes confettiBurst {
  0% { opacity: 1; transform: scale(0); }
  50% { opacity: 1; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(2); }
}

.step-output {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-dim);
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
  line-height: 1.7;
}

.step-output:empty {
  display: none;
}

/* ── Result ───────────────────────────────────────────── */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.report-content {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 36px;
  min-height: 300px;
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}

.placeholder {
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 48px;
  font-size: 15px;
}

/* ── History ──────────────────────────────────────────── */
.history-list { display: flex; flex-direction: column; gap: 10px; }

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.history-item:hover {
  background: rgba(139, 92, 246, 0.06);
  border-color: rgba(139, 92, 246, 0.25);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.history-item .date { font-weight: 700; font-size: 14px; }
.history-item .files { font-size: 12px; color: var(--text-dim); }

/* ── History Sections ──────────────────────────────────── */
.history-section {
  margin-bottom: 20px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.history-section.main {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.05);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.05);
}

.history-section-title {
  font-size: 13px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
}

.history-section-content {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  max-height: 400px;
  overflow-y: auto;
}

.history-section.main .history-section-content {
  max-height: none;
}

/* ── PDF Button ────────────────────────────────────────── */
.btn-pdf {
  background: rgba(244, 63, 94, 0.08) !important;
  border-color: rgba(244, 63, 94, 0.3) !important;
  color: var(--danger) !important;
}

.btn-pdf:hover {
  background: rgba(244, 63, 94, 0.15) !important;
  box-shadow: 0 0 16px var(--danger-glow) !important;
}

/* ── Animations ───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.5); }

/* ── Footer ───────────────────────────────────────────── */
.app-footer {
  margin-top: 60px;
  padding: 28px 20px;
  border-top: 1px solid var(--glass-border);
  text-align: center;
  position: relative;
}

.app-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 1px;
  background: var(--gradient);
  opacity: 0.4;
}

.footer-inner { max-width: 800px; margin: 0 auto; }

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gradient);
  transition: width 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-links a:hover::after { width: 100%; }
.footer-links .sep { color: rgba(255, 255, 255, 0.1); font-size: 12px; }

.footer-copy {
  color: rgba(255, 255, 255, 0.25);
  font-size: 12px;
  letter-spacing: 0.3px;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .bento-grid { grid-template-columns: 1fr; }
  .app-header { margin: 8px 10px; padding: 12px 16px; }
  .tab-bar { padding: 0 10px; }
  .tab { padding: 8px 14px; font-size: 13px; }
  .tab-label { display: none; }
  .tab-icon { font-size: 18px; }
  .bento-card { padding: 22px; }
  .gate-card { padding: 36px 28px; }
  .report-content { padding: 22px; font-size: 14px; }
  .length-options { grid-template-columns: repeat(2, 1fr); }
  .result-header { flex-direction: column; align-items: flex-start; }
  .result-actions { width: 100%; }
  .result-actions .btn-sm { flex: 1; justify-content: center; }
  .pipeline-line { left: 39px; }
  .tab-content { padding: 0 10px 32px; }
  .gate-card h1 { font-size: 26px; }
}

@media (max-width: 480px) {
  .length-options { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .length-btn { padding: 10px 8px; }
  .upload-zone { padding: 36px 16px; }
  .bento-card h2 { font-size: 19px; }
}
