:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --indigo: #4338ca;
  --indigo-bg: #eef2ff;
  --indigo-border: #c7d2fe;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: #0f766e; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f1f5f9; padding: 2px 6px; border-radius: 5px; font-size: 0.9em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 0; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); font-size: 1rem; }
.brand img { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 16px; font-size: 0.9rem; color: var(--muted); }

.hero { padding: 36px 0 24px; }
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--emerald); margin-bottom: 8px; }
h1 { margin: 0 0 10px; font-size: clamp(1.75rem, 3.2vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; }
.lead { margin: 0; max-width: 680px; color: var(--muted); font-size: 1.05rem; }

.grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 24px; align-items: start; margin-top: 20px; }
@media (max-width: 880px) { .grid { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.card h2 { margin: 0 0 14px; font-size: 1.15rem; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.preset-btn { border: 1px solid var(--line); background: #f8fafc; color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 0.84rem; font-weight: 600; cursor: pointer; }
.preset-btn:hover { border-color: #94a3b8; background: #f1f5f9; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 8px; margin-bottom: 18px; }
.tool-item { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; background: var(--surface); transition: border-color 0.15s, background 0.15s; }
.tool-item:hover { border-color: #94a3b8; }
.tool-item.active { border-color: var(--emerald); background: var(--emerald-bg); }
.tool-item input { margin-top: 3px; accent-color: var(--emerald); }
.tool-meta { font-size: 0.84rem; line-height: 1.3; }
.tool-meta strong { display: block; color: var(--ink); }
.tool-meta span { color: var(--muted); font-size: 0.77rem; }

.controls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 540px) { .controls { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 0.83rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input, .field select { width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 0.95rem; background: var(--surface); color: var(--ink); }
.field .hint { font-size: 0.76rem; color: var(--muted); margin-top: 4px; }

.verdict { padding: 16px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 16px; }
.verdict.selfhost { background: var(--emerald-bg); border-color: var(--emerald-border); }
.verdict.saas { background: var(--indigo-bg); border-color: var(--indigo-border); }
.verdict.close { background: var(--amber-bg); border-color: var(--amber-border); }
.verdict-badge { display: inline-block; font-size: 0.76rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.verdict.selfhost .verdict-badge { color: var(--emerald); }
.verdict.saas .verdict-badge { color: var(--indigo); }
.verdict.close .verdict-badge { color: var(--amber); }
.verdict-title { font-size: 1.3rem; font-weight: 800; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.verdict-sub { margin: 0; font-size: 0.9rem; color: var(--muted); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat { background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.stat-k { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.stat-v { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat-s { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }

.honest-box { background: #f8fafc; border-left: 3px solid #64748b; padding: 11px 14px; border-radius: 0 8px 8px 0; font-size: 0.87rem; color: var(--muted); margin-bottom: 16px; }
.honest-box strong { color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 15px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { background: #f1f5f9; text-decoration: none; }
.btn.primary { background: var(--ink); color: #ffffff; border-color: var(--ink); }
.btn.primary:hover { background: #1e293b; }
.btn.accent { background: var(--emerald); color: #ffffff; border-color: var(--emerald); }
.btn.accent:hover { background: #047857; }

.section { margin-top: 32px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: #f8fafc; }
td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.disclosure { font-size: 0.82rem; color: var(--muted); margin-top: 10px; }

.cta-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: #0f172a; color: #f8fafc; border-radius: var(--radius); padding: 24px; margin-top: 32px; }
.cta-banner h2 { margin: 0 0 6px; font-size: 1.25rem; color: #ffffff; }
.cta-banner p { margin: 0; color: #cbd5e1; max-width: 620px; font-size: 0.94rem; }

.pair-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 12px; }
.pair-link { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-size: 0.9rem; }
.pair-link:hover { border-color: var(--emerald); text-decoration: none; }
.pair-link span { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }

.faq-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { margin: 0 0 6px; font-size: 1rem; }
.faq-item p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.footer { margin-top: 48px; padding: 24px 0 36px; border-top: 1px solid var(--line); font-size: 0.84rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.muted { color: var(--muted); }
