:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #7c3aed;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.875rem; }
.text-success { color: var(--success); }

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 17, 32, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 36px; height: 36px; border-radius: 8px; }
.brand-name { display: block; font-weight: 700; font-size: 1.05rem; }
.brand-tag { display: block; font-size: 0.72rem; color: var(--success); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* Hero */
.hero {
  text-align: center;
  padding: 28px 0 18px;
}
.pill {
  display: inline-block;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(37, 99, 235, 0.4);
  color: #93c5fd;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 8px;
}
.hero p {
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.95rem;
}

/* Ad Slots */
.ad-slot {
  margin: 16px 0;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.45);
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Tabs */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0 14px;
}
.tab {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}
.tab:hover { border-color: var(--primary); color: var(--text); }
.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Tool Card */
.tool-card {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}
.tool-card.active { display: block; }
.tool-header { margin-bottom: 16px; }
.tool-header h2 { font-size: 1.25rem; margin-bottom: 4px; }
.tool-header p { color: var(--muted); font-size: 0.9rem; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  background: rgba(30, 41, 59, 0.4);
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 16px;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
}
.dropzone-icon { font-size: 2rem; margin-bottom: 6px; }

/* Presets & Fields */
.preset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.preset-row .label { font-size: 0.85rem; color: var(--muted); }
.chip {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
}
.chip.active, .chip:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.2);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.field label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 5px; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: 0.15s ease;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.1); }
.btn-success { background: var(--success); color: #042f2e; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }

/* Lists & Progress */
.list-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.file-list {
  list-style: none;
  max-height: 210px;
  overflow-y: auto;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.86rem;
}
.file-item button {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-weight: 700;
  padding: 2px 6px;
}

.progress-wrap { margin-bottom: 14px; }
.progress-bar {
  width: 100%;
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 0.2s;
}

.result-box {
  margin-top: 18px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: 12px;
}
.result-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.preview-img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  margin: 0 auto 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.status-msg {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.9rem;
}
.status-msg.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

/* Digital Store */
.store-section { padding: 28px 0; }
.section-head { text-align: center; margin-bottom: 20px; }
.section-head h2 { font-size: 1.5rem; margin-bottom: 6px; }
.section-head p { color: var(--muted); font-size: 0.92rem; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.product-badge {
  align-self: flex-start;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-green { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.badge-purple { background: rgba(124, 58, 237, 0.2); color: #c4b5fd; }
.product-card h3 { font-size: 1.05rem; }
.product-card p { color: var(--muted); font-size: 0.86rem; flex: 1; }
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.price { font-size: 1.2rem; font-weight: 800; color: var(--success); }

/* FAQ & Footer */
.faq-section { padding: 14px 0 36px; }
.faq-section h2 { font-size: 1.3rem; margin-bottom: 14px; text-align: center; }
.faq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.faq-item h3 { font-size: 1rem; margin-bottom: 6px; }
.faq-item p { font-size: 0.86rem; color: var(--muted); }

.footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.footer-links { display: flex; gap: 14px; }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; text-decoration: underline; font-size: 0.85rem; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  padding: 20px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.close-btn { background: none; border: none; color: var(--text); font-size: 1.2rem; cursor: pointer; }
.modal-body { color: var(--muted); font-size: 0.9rem; display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 768px) {
  .tabs { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .product-grid, .faq-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
