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

:root {
  --brand:    #0F4C81;
  --brand-lt: #1a6ab8;
  --bg:       #f8fafc;
  --card-bg:  #ffffff;
  --text:     #1e293b;
  --muted:    #64748b;
  --border:   #e2e8f0;
  --result:   #0F4C81;
}

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

/* Header */
.site-header {
  background: var(--brand);
  padding: 12px 24px;
}
.brand-link {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .03em;
}

/* Main layout */
.main-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

h1 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
}
.subtitle {
  color: var(--muted);
  margin-bottom: 28px;
}

/* Calculator card */
.calculator-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 36px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.input-group {
  margin-bottom: 18px;
}
.input-group label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 6px;
}
.input-group .help {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.input-group input,
.input-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s;
}
.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--brand);
}

.calc-btn {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background .15s;
}
.calc-btn:hover { background: var(--brand-lt); }

/* Result */
.result-box {
  margin-top: 20px;
  padding: 20px;
  background: #eff6ff;
  border: 2px solid var(--brand);
  border-radius: 10px;
  display: none;
}
.result-box.visible { display: block; }
.result-main {
  font-size: 2rem;
  font-weight: 800;
  color: var(--result);
  margin-bottom: 6px;
}
.result-label {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.result-breakdown {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: .88rem;
  padding: 4px 0;
}
.breakdown-row .val { font-weight: 600; }

/* How to section */
.how-to {
  margin-bottom: 32px;
}
.how-to h2 { font-size: 1.2rem; margin-bottom: 12px; }
.how-to ol { padding-left: 20px; }
.how-to li { margin-bottom: 8px; font-size: .95rem; }

/* FAQ */
.faq { margin-bottom: 32px; }
.faq h2 { font-size: 1.2rem; margin-bottom: 16px; }
.faq-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q::after { content: "+"; font-size: 1.2rem; color: var(--muted); }
.faq-item.open .faq-q::after { content: "−"; }
.faq-a {
  font-size: .9rem;
  color: var(--muted);
  margin-top: 8px;
  display: none;
}
.faq-item.open .faq-a { display: block; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px;
  font-size: .82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--brand); }
.footer-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .82rem;
}
.footer-nav a:hover { color: var(--brand); text-decoration: underline; }

/* Legal pages */
.legal-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}
.legal-content h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.legal-content .updated { font-size: .85rem; color: var(--muted); margin-bottom: 32px; }
.legal-content h2 { font-size: 1.1rem; font-weight: 700; margin: 28px 0 10px; }
.legal-content p { margin-bottom: 14px; font-size: .95rem; line-height: 1.7; }
.legal-content a { color: var(--brand); }
.contact-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  margin-top: 24px;
}
.contact-card .contact-email {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  display: block;
  margin-top: 12px;
}
.contact-card .contact-email:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 480px) {
  h1 { font-size: 1.4rem; }
  .calculator-card { padding: 20px; }
  .result-main { font-size: 1.6rem; }
}
