:root {
  --bg: #0b0e14;
  --bg-soft: #11151f;
  --card: #141926;
  --border: #232b3d;
  --text: #e6e9f0;
  --text-dim: #8b93a7;
  --accent: #4f8cff;
  --accent-strong: #3d7bff;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

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

.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 18px; }
.brand-mark {
  font-family: var(--mono);
  background: var(--accent);
  color: #0b0e14;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}
.brand-accent { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 14px; }
.header-link { color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 500; }
.header-link:hover { color: var(--text); }

.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text-dim);
}
.balance-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.balance-chip.low .balance-dot { background: var(--amber); }
.balance-chip.empty .balance-dot { background: var(--red); }
#balanceText { font-family: var(--mono); font-weight: 600; color: var(--text); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  text-decoration: none;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn[hidden] { display: none !important; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent); border-color: transparent; padding: 6px 10px; font-size: 13px; }
.btn-ghost:hover { text-decoration: underline; }
.btn-small { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Hero */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 { font-size: 42px; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 18px; }
.hero .accent { color: var(--accent); }
.hero-sub { color: var(--text-dim); font-size: 17px; max-width: 620px; margin: 0 auto 34px; }
.hero-stats { display: flex; justify-content: center; gap: 44px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--accent); }
.stat-label { color: var(--text-dim); font-size: 13px; margin-top: 2px; }

/* Tool card */
.tool-section { padding: 16px 0 48px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  margin-bottom: 24px;
}
.tool-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.tool-header h2 { font-size: 20px; }

.field-label { display: block; font-size: 13px; color: var(--text-dim); margin: 14px 0 6px; }
.text-input, .code-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.text-input:focus, .code-input:focus { border-color: var(--accent); }
.code-input {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 220px;
  white-space: pre;
  overflow: auto;
}
.tool-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.credit-note { color: var(--text-dim); font-size: 13px; }
.trust-note {
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  background: var(--bg-soft);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
}
.tool-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.optional-label { font-weight: 400; }
.status-line { margin-top: 14px; font-size: 14px; color: var(--amber); }
.status-line.error { color: var(--red); }

/* Preview banner */
.preview-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--accent);
  background: rgba(79, 140, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.preview-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
}
.preview-banner span:nth-child(2) { flex: 1; color: var(--text); font-size: 14px; }
.dim-item { color: var(--text-dim); font-size: 14px; list-style: none; }

/* Results */
.results-card { display: block; }
.results-card[hidden] { display: none; }
.results-header { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 22px; }
.score-box {
  flex: 0 0 104px;
  width: 104px; height: 104px;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 5px solid var(--accent);
  background: var(--bg);
}
.score-num { font-family: var(--mono); font-size: 34px; font-weight: 700; }
.score-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.summary-box h3 { font-size: 14px; color: var(--text-dim); margin-bottom: 6px; }
.summary-box p { font-size: 15px; }

.section-title { font-size: 15px; margin: 20px 0 10px; color: var(--text-dim); }

.issue {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg-soft);
}
.issue-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge.critical { background: rgba(248, 113, 113, 0.15); color: var(--red); }
.badge.warning { background: rgba(251, 191, 36, 0.15); color: var(--amber); }
.badge.info { background: rgba(79, 140, 255, 0.15); color: var(--accent); }
.issue-title { font-weight: 600; font-size: 14px; }
.issue-line { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-left: auto; }
.issue-detail { color: var(--text-dim); font-size: 14px; margin-bottom: 8px; }
.issue-suggestion { font-size: 14px; border-left: 3px solid var(--accent); padding-left: 10px; }
.issue-suggestion::before { content: "Fix: "; font-weight: 600; color: var(--accent); }

.positives-list { list-style: none; }
.positives-list li {
  padding: 6px 0 6px 22px;
  position: relative;
  color: var(--text);
  font-size: 14px;
}
.positives-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

.results-footer { margin-top: 20px; display: flex; justify-content: flex-end; }

/* How it works */
.how-section { padding: 20px 0 40px; }
.how-section h2 { font-size: 28px; text-align: center; margin-bottom: 28px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.how-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.how-num {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #0b0e14;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.how-step p { font-size: 14px; color: var(--text); }
.how-step strong { display: block; margin-bottom: 2px; }

/* Privacy */
.privacy-section { padding: 8px 0 64px; }
.privacy-section h2 { font-size: 28px; text-align: center; }
.privacy-copy {
  max-width: 640px;
  margin: 12px auto 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 15px;
}

/* FAQ */
.faq-section { padding: 20px 0 40px; }
.faq-section h2 { font-size: 28px; text-align: center; margin-bottom: 22px; }
.faq-list { max-width: 720px; margin: 0 auto; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 15px 18px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  position: relative;
  padding-right: 40px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p {
  padding: 0 18px 16px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

/* Pricing */
.pricing-section { padding: 20px 0 40px; }
.pricing-section h2 { font-size: 28px; text-align: center; }
.section-sub { text-align: center; color: var(--text-dim); margin: 6px 0 28px; }
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }.pack {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.pack.popular { border-color: var(--accent); }
.pack-popular-tag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pack-name { font-weight: 700; font-size: 16px; }
.pack-blurb { color: var(--text-dim); font-size: 13px; }
.pack-price { font-family: var(--mono); font-size: 30px; font-weight: 700; margin: 6px 0 4px; }
.pack-price span { font-size: 14px; color: var(--text-dim); font-weight: 400; }
.pack .btn { margin-top: 10px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 20px 0; color: var(--text-dim); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-fine { max-width: 460px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  z-index: 50;
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Responsive */
@media (max-width: 640px) {
  .hero h1 { font-size: 30px; }
  .hero { padding: 40px 0 24px; }
  .results-header { flex-direction: column; align-items: center; }
  .summary-box { text-align: center; }
  .tool-actions { flex-direction: column; align-items: stretch; }
}
