:root {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --success: #22c55e;
  --danger: #ef4444;
  --secondary: #a78bfa;
  --border: #334155;
  --accent: #f59e0b;
  --focus: #fcd34d;
  --maxw: 1100px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }

.site-header { border-bottom: 1px solid var(--border); background: rgba(17,24,39,0.7); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.logo { display: inline-block; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: 0.5px; padding: 1rem 0; }
.site-nav ul { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 0.75rem 0.5rem; border-radius: 8px; }
.site-nav a.active, .site-nav a:hover { color: var(--text); background: #0b1220; }

.hero { padding: 2rem 0 1rem; }
.hero h1 { margin: 0 0 0.5rem; font-size: 2rem; }
.hero p { color: var(--muted); }

.tool { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1rem; margin: 1rem 0 2rem; }
.tool h2 { margin-top: 0; }

.instructions h3 { margin: 0.5rem 0 0.5rem; }
.instructions ol { margin: 0.5rem 0; padding-left: 1.2rem; }
.instructions li { margin: 0.25rem 0; color: var(--text); }
.instructions p { color: var(--muted); }

.uploader { margin-top: 1rem; }
#fileInput { display: none; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  background: #0b1220;
  outline: none;
}
.dropzone:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(252,211,77,0.3); }
.dropzone.dragover { border-color: var(--primary); background: rgba(59,130,246,0.08); color: var(--text); }

.actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }

.btn { border: 1px solid var(--border); background: #0b1220; color: var(--text); padding: 0.6rem 0.9rem; border-radius: 10px; cursor: pointer; transition: 0.2s ease; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn.primary { border-color: var(--primary); }
.btn.success { border-color: var(--success); }
.btn.secondary { border-color: var(--secondary); }
.btn.danger { border-color: var(--danger); }

.file-list { margin-top: 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; }
.file-card { background: #0b1220; border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.file-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.file-name { font-weight: 600; font-size: 0.95rem; word-break: break-word; }
.file-size { color: var(--muted); font-size: 0.85rem; }
.thumb { width: 100%; height: 160px; background: #0d1525; border: 1px solid var(--border); border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.thumb img { max-width: 100%; max-height: 100%; display: block; }
.page-badge { color: var(--accent); font-size: 0.85rem; }

.progress-wrap { background: #0d1525; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.progress { width: 0%; height: 8px; background: linear-gradient(90deg, var(--primary), var(--success)); transition: width 0.25s ease; }
.status { color: var(--muted); font-size: 0.85rem; }

.card-actions { display: flex; gap: 0.5rem; }
.card-actions .btn { padding: 0.4rem 0.6rem; font-size: 0.9rem; }

.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem; margin: 0.5rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }

.site-footer { border-top: 1px solid var(--border); margin-top: 2rem; padding: 1.25rem 0; background: rgba(17,24,39,0.7); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.site-footer h4 { margin: 0.25rem 0 0.5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0.25rem 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
}