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

:root {
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --bg: #f9fafb;
  --surface: #fff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 64px 0 48px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 17px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

/* Tool */
.tool-section { padding-bottom: 64px; }

/* Upload */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 52px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-icon {
  color: var(--muted);
  margin-bottom: 16px;
}

.upload-area:hover .upload-icon,
.upload-area.drag-over .upload-icon { color: var(--accent); }

.upload-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.upload-sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

.upload-link {
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
}

.upload-hint {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  display: inline-block;
  margin-top: 8px;
}

/* Error */
.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 14px;
  margin-top: 16px;
}

/* Results */
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 36px 0 24px;
}

.results-header h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.results-meta { font-size: 13px; color: var(--muted); }

.results-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.btn:hover { opacity: 0.85; }

.btn-primary { background: var(--accent); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Chart */
.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

/* Table */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.ctr-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.ctr-table thead { background: var(--bg); }

.ctr-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.ctr-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.ctr-table tbody tr:last-child td { border-bottom: none; }

.ctr-table tbody tr:hover { background: var(--bg); }

.ctr-badge {
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
}

/* How it works */
.how-section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.how-section h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 36px;
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.step h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-size: 13px;
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); }

/* Static pages (about, privacy-policy) */
.static-section { padding: 48px 0 80px; }

.static-back {
  display: inline-block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
  text-decoration: none;
}
.static-back:hover { text-decoration: underline; }

.static-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
}

.static-card h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.static-card h2 { font-size: 17px; font-weight: 700; margin: 28px 0 8px; }
.static-card p, .static-card li { font-size: 15px; color: var(--muted); margin-bottom: 8px; line-height: 1.7; }
.static-card ul { padding-left: 20px; margin-bottom: 8px; }
.static-card section { margin-top: 8px; }
.static-meta { font-size: 13px; color: var(--muted); margin-bottom: 28px; }

.static-intro {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.static-intro img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.social-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.social-links a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.social-links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

@media (max-width: 600px) {
  .results-header { flex-direction: column; }
  .ctr-table th:nth-child(4),
  .ctr-table td:nth-child(4) { display: none; }
  .static-card { padding: 24px; }
}
