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

:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #f0fdfa;
  --text: #1a1b1e;
  --text-light: #495057;
  --text-muted: #868e96;
  --bg: #f8f9fa;
  --white: #ffffff;
  --border: #dee2e6;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text); background: var(--bg); line-height: 1.6;
}

header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
nav { max-width: 1000px; margin: 0 auto; padding: 0.75rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.15rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.nav-links { display: flex; gap: 1.25rem; }
.nav-links a { color: var(--text-light); text-decoration: none; font-size: 0.85rem; font-weight: 500; }
.nav-links a:hover { color: var(--primary); }

.hero { text-align: center; padding: 2.5rem 1.5rem 1rem; }
.hero h1 { font-size: 2.25rem; font-weight: 800; }
.hero-sub { font-size: 1.05rem; color: var(--text-light); margin-top: 0.5rem; }

.ad-slot { max-width: 728px; margin: 1.5rem auto; text-align: center; }

.calculator-section { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }

.calc-container { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.mode-toggle { display: flex; border-bottom: 1px solid var(--border); }
.mode-btn {
  flex: 1; padding: 0.75rem; border: none; background: var(--bg); cursor: pointer;
  font-size: 0.9rem; font-weight: 600; color: var(--text-muted); transition: all 0.2s;
}
.mode-btn.active { background: var(--white); color: var(--primary); border-bottom: 2px solid var(--primary); }
.mode-btn:hover:not(.active) { color: var(--text-light); }

.calc-grid { display: grid; grid-template-columns: 320px 1fr; }

.input-panel { padding: 1.5rem; border-right: 1px solid var(--border); }
.input-group { margin-bottom: 1rem; }
.input-group.hidden { display: none; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-light); margin-bottom: 0.3rem; }
.input-group input {
  width: 100%; padding: 0.55rem 0.75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1rem; color: var(--text); background: var(--white);
}
.input-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,0.1); }
.input-with-prefix { position: relative; }
.input-with-prefix .prefix { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-weight: 500; }
.input-with-prefix input { padding-left: 1.75rem; }
.input-note { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }

.results-panel { padding: 1.5rem; }

.pay-breakdown { margin-bottom: 1.25rem; }
.pay-row { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0.75rem; border-bottom: 1px solid #f1f3f5; }
.pay-row:last-child { border-bottom: none; }
.pay-row.highlight { background: var(--primary-light); border-radius: var(--radius-sm); margin-bottom: 0.25rem; }
.pay-period { font-size: 0.85rem; color: var(--text-light); font-weight: 500; }
.pay-amount { font-size: 1.05rem; font-weight: 700; color: var(--text); font-family: 'SF Mono', 'Consolas', monospace; }
.pay-row.highlight .pay-period { color: var(--primary-dark); font-weight: 600; }
.pay-row.highlight .pay-amount { color: var(--primary-dark); font-size: 1.2rem; }

.work-info { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.work-stat { background: var(--bg); border-radius: var(--radius-sm); padding: 0.75rem; text-align: center; }
.stat-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: 1.1rem; font-weight: 800; color: var(--text); }

.info-section { max-width: 1000px; margin: 0 auto; padding: 3rem 1.5rem; }
.info-section.alt-bg { max-width: none; background: var(--white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.info-section.alt-bg > * { max-width: 1000px; margin-left: auto; margin-right: auto; }
.info-section h2 { font-size: 1.6rem; font-weight: 800; text-align: center; margin-bottom: 0.5rem; }
.section-desc { text-align: center; color: var(--text-light); margin-bottom: 1.5rem; }

.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.55rem 0.75rem; text-align: center; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
th { background: var(--bg); font-weight: 700; font-size: 0.75rem; }
td:first-child { font-weight: 600; }

.formula-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2rem; }
.formula-card { background: var(--white); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.formula-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; }
.formula { background: var(--primary-light); padding: 0.75rem; border-radius: var(--radius-sm); font-family: monospace; font-size: 0.85rem; color: var(--primary-dark); margin-bottom: 0.75rem; font-weight: 600; }
.example { font-size: 0.85rem; color: var(--text-light); }

.faq-list { max-width: 800px; margin: 2rem auto 0; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.6rem; background: var(--white); }
.faq-item summary { padding: 0.9rem 1.1rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; font-size: 0.9rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--text-muted); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: 0 1.1rem 0.9rem; font-size: 0.85rem; color: var(--text-light); line-height: 1.6; }

footer { background: var(--white); border-top: 1px solid var(--border); padding: 2rem 1.5rem; margin-top: 2rem; }
.footer-content { max-width: 800px; margin: 0 auto; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1rem; }
.footer-links a { color: var(--text-light); text-decoration: none; font-size: 0.85rem; }
.disclaimer { font-size: 0.72rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 0.5rem; }
.copyright { font-size: 0.72rem; color: var(--text-muted); }

@media (max-width: 700px) {
  .calc-grid { grid-template-columns: 1fr; }
  .input-panel { border-right: none; border-bottom: 1px solid var(--border); }
  .formula-cards { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.6rem; }
}
