:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --secondary: #0f766e;
  --danger: #b91c1c;
  --border: #e5e7eb;
  --success-bg: #ecfdf5;
  --success-text: #166534;
  --error-bg: #fef2f2;
  --error-text: #991b1b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.container { max-width: 1180px; margin: 0 auto; padding: 24px; }
.hero {
  display: flex; justify-content: space-between; gap: 20px; align-items: flex-start;
  margin-bottom: 24px; padding: 24px; background: linear-gradient(135deg, #1d4ed8, #0f766e); color: white;
  border-radius: 20px; box-shadow: 0 10px 35px rgba(0,0,0,.12);
}
.hero h1 { margin: 0 0 8px; font-size: 32px; }
.hero p { margin: 0; max-width: 720px; opacity: .95; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge { background: rgba(255,255,255,.2); padding: 10px 14px; border-radius: 999px; font-weight: bold; }
.badge-soft { background: rgba(255,255,255,.12); }
.grid { display: grid; gap: 20px; }
.stats { grid-template-columns: repeat(3, 1fr); margin-bottom: 20px; }
.main-grid { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.card h2 { margin-top: 0; font-size: 20px; }
.wide { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.field span { font-weight: bold; }
input[type="text"], input[type="file"] {
  width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: white;
}
.btn {
  display: inline-block; border: 0; border-radius: 12px; padding: 12px 18px; background: var(--primary); color: white;
  font-weight: bold; cursor: pointer; text-decoration: none;
}
.btn-secondary { background: var(--secondary); }
.btn-primary { background: #111827; }
.btn-danger { background: var(--danger); }
.btn-small { padding: 8px 12px; font-size: 13px; }
.grid-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; align-items: end; }
.grid-form.three-cols { grid-template-columns: 1fr 1fr auto; }
.alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 16px; }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--error-bg); color: var(--error-text); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: left; }
th { background: #f8fafc; }
.hint { color: var(--muted); }
.inline-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.result-box { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 18px; }
.result-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 14px 0; }
pre {
  background: #0f172a; color: #e5e7eb; padding: 16px; border-radius: 14px; overflow-x: auto; white-space: pre-wrap;
}
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.pill { background: #eef2ff; color: #4338ca; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: bold; }
.depara-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; margin-bottom: 16px; }
.download-list { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.preview-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tab-btn {
  border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 12px; padding: 10px 14px; cursor: pointer; font-weight: bold;
}
.tab-btn.active { background: #111827; color: #fff; border-color: #111827; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.action-col { width: 120px; }
@media (max-width: 900px) {
  .stats, .main-grid, .grid-form, .result-grid, .depara-grid, .grid-form.three-cols { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .hero { flex-direction: column; }
}
