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

/* Base */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Nav */
nav {
  background: #1e3a5f;
  color: #fff;
  padding: 0.875rem 0;
  position: relative;
}
nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
nav .logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
}
nav .nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
nav .nav-links a {
  color: #cbd5e1;
  font-size: 0.95rem;
  transition: color 0.2s;
}
nav .nav-links a:hover { color: #fff; text-decoration: none; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* Calculator Card */
.calculator-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 2rem;
  margin: 2rem auto;
}

/* Input Group */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.input-group label {
  font-weight: 500;
  color: #374151;
  font-size: 0.95rem;
}

input, select, textarea {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: #1e293b;
  transition: border-color 0.2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2563eb;
}

/* Button */
.btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.875rem 2rem;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}
.btn:hover { background: #1d4ed8; }

/* Result Box */
.result-box {
  background: #f0fdf4;
  border: 2px solid #16a34a;
  border-radius: 10px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #dcfce7;
}
.result-item:last-child { border-bottom: none; }
.result-label {
  color: #374151;
  font-weight: 500;
}
.result-value {
  color: #15803d;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Ad Slot */
.ad-slot {
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  color: #94a3b8;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

/* CTA Box */
.cta-box {
  background: #fff7ed;
  border: 2px solid #f97316;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
}
.cta-box h3 { color: #c2410c; margin-bottom: 0.75rem; }
.cta-btn {
  background: #f97316;
  color: #fff;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s;
}
.cta-btn:hover { background: #ea6c00; text-decoration: none; }

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 2px solid #2563eb;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}
.tab-btn.active {
  background: #2563eb;
  color: #fff;
}
.tab-btn:hover:not(.active) { background: #eff6ff; }

/* Footer */
footer {
  background: #1e3a5f;
  color: #94a3b8;
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  font-size: 0.9rem;
}
footer a { color: #93c5fd; }
footer a:hover { color: #fff; }

/* SEO Content */
.seo-content { margin: 2rem 0; }
.seo-content h2 {
  color: #1e3a5f;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
  margin: 1.5rem 0 0.75rem;
  font-size: 1.4rem;
}
.seo-content h3 {
  color: #1e3a5f;
  margin: 1.25rem 0 0.5rem;
  font-size: 1.15rem;
}
.seo-content p { margin-bottom: 0.75rem; color: #374151; }
.seo-content ul, .seo-content ol {
  margin: 0.5rem 0 0.75rem 1.5rem;
  color: #374151;
}
.seo-content li { margin-bottom: 0.3rem; }

/* Grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* SVG Diagram */
.diagram-box {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  background: #f8fafc;
  margin: 1rem 0;
  text-align: center;
}
.diagram-box svg { max-width: 100%; height: auto; }

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: #64748b; font-size: 0.9rem; }
.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 1.5rem 0 0.5rem;
}
.page-subtitle {
  color: #64748b;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 640px) {
  .container { padding: 0 0.75rem; }
  .calculator-card { padding: 1rem; margin: 1rem auto; }
  .page-title { font-size: 1.5rem; }
  .grid-2 { grid-template-columns: 1fr; }
  nav .nav-links { display: none; }
  .nav-toggle { display: flex; }
  nav .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #1e3a5f;
    padding: 1rem;
    gap: 0.75rem;
    z-index: 100;
  }
  .btn { font-size: 1rem; padding: 0.75rem 1rem; }
  .result-value { font-size: 1rem; }
}
