:root{
  --border: #b9b9b9;
  --border-light: #d5d5d5;
  --green: #25D366;
  --green-dark: #1DA851;
  --link: #1a5fb4;
  --text: #222;
  --row-alt: #f4f4f4;
  --head-bg: #e9e9e9;
  --bg-page: #ffffff;
  --panel-bg: #ffffff;
  --footer-bg: #e5e5e5;
  --sidebar-border: #cccccc;
  --seo-text: #333;
  --input-bg: #ffffff;
  --input-border: #4a90d9;
  --input-text: #222;
}
[data-theme="dark"]{
  --border: #444;
  --border-light: #3a3a3a;
  --link: #6ea8fe;
  --text: #eaeaea;
  --row-alt: #232323;
  --head-bg: #262626;
  --bg-page: #121212;
  --panel-bg: #1b1b1b;
  --footer-bg: #1a1a1a;
  --sidebar-border: #3a3a3a;
  --seo-text: #cfcfcf;
  --input-bg: #232323;
  --input-border: #4a90d9;
  --input-text: #eaeaea;
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg-page);
  font-size:14px;
  transition: background .2s ease, color .2s ease;
}
.page-content{ padding: 30px; max-width: 1300px; margin: 0 auto; }
.breadcrumb-row{ display:flex; justify-content:space-between; align-items:center; padding: 4px 0 14px; font-size:13px; }
.breadcrumb-row .breadcrumb a{ color:#1a5fb4; text-decoration:none; }
.breadcrumb-row .breadcrumb a:hover{ text-decoration:underline; }
.breadcrumb-row .print-link{ color:#1a5fb4; font-weight:bold; font-size:15px; text-decoration:none; }
.breadcrumb-row .print-link:hover{ text-decoration:underline; }

/* ===== NAVBAR ===== */
.navbar{ background-color:#25D366; display:flex; align-items:flex-end; justify-content:space-between; padding:0 40px 10px 0; height:65px; border-bottom:3px solid #000; width:100%; position:relative; }
.logo{ font-family:Arial, sans-serif; font-weight:800; font-size:26px; white-space:nowrap; text-decoration:none; letter-spacing:.3px; padding-left:20px; }
.logo .ce{ color:#ffffff; }
.logo .online{ color:#0d3b66; }
.right-group{ display:flex; align-items:flex-end; gap:30px; margin-right:90px; }
.nav-links{ display:flex; align-items:center; gap:10px; }
.nav-links a{ color:#ffffff; text-decoration:none; font-size:12px; font-weight:bold; padding:8px 14px; white-space:nowrap; border-radius:4px; }
.nav-links a.active, .nav-links a:hover{ background-color:#FFD700; }
.signin{ color:#ffffff; font-size:14px; font-weight:bold; white-space:nowrap; text-decoration:none; padding:8px 16px; position:absolute; top:0; right:0; }
.signin:hover{ text-decoration:underline; }
.signin-wrap{ position:absolute; top:0; right:0; display:flex; align-items:center; gap:14px; padding:8px 16px; }
.signin-link{ color:#ffffff; font-size:14px; font-weight:bold; text-decoration:none; white-space:nowrap; }
.signin-link:hover{ text-decoration:underline; }
.hamburger{ display:none; background:none; border:none; cursor:pointer; padding:8px; }
.hamburger span{ display:block; width:26px; height:3px; background:#ffffff; margin:5px 0; border-radius:2px; }
.mobile-menu{ display:none; flex-direction:column; background-color:#111111; position:absolute; left:0; right:0; z-index:100; }
.mobile-menu a{ color:#ffffff; text-decoration:none; font-size:14px; padding:10px 20px; border-bottom:1px solid #333333; }
.mobile-menu.open{ display:flex; }
.mobile-search{ display:flex; gap:10px; padding:16px 20px; }
.mobile-search input{ flex:1; border:2px solid #25D366; border-radius:3px; padding:12px; font-size:15px; }
.mobile-search button{ background-color:#25D366; color:#ffffff; border:none; border-radius:3px; padding:12px 24px; font-size:18px; cursor:pointer; }
.mobile-spacer{ display:none; }

@media (max-width: 768px){
  .navbar{ padding:0 12px; justify-content:space-between; align-items:center; height:56px; }
  .nav-links, .signin, .signin-wrap{ display:none; }
  .hamburger{ display:block; position:static; flex-shrink:0; width:34px; padding:6px; }
  .mobile-spacer{ display:block; flex-shrink:0; width:34px; }
  .logo{ font-size:20px; flex:1; text-align:center; white-space:nowrap; padding-left:0; }
}

/* ===== FOOTER ===== */
.site-footer{ background-color: var(--footer-bg); text-align:center; padding:18px 20px; margin-top:40px; font-size:14px; color: var(--text); }
.site-footer a{ color:#1a5276; text-decoration:underline; }
.site-footer .footer-links{ display:inline; margin-bottom:0; }
.site-footer .footer-copyright{ display:inline; margin-left:6px; }
.site-footer .footer-row{ display:inline; }
.site-footer .footer-sep{ margin:0 6px; color:#666666; }
@media (max-width: 768px){
  .site-footer{ font-size:15px; padding:16px 15px; }
  .site-footer .footer-links{ display:block; }
  .site-footer .footer-row{ display:block; margin-bottom:2px; }
  .site-footer .row-sep{ display:none; }
  .site-footer .footer-copyright{ display:block; margin-left:0; font-size:13px; }
}

/* ===== H1 ROW + THEME TOGGLE ===== */
.h1-row{ display:flex; align-items:center; justify-content:space-between; gap:14px; margin:0 0 20px; max-width:520px; flex-wrap:wrap; }
.h1-row h1{ font-size:20px; margin:0; }
.theme-toggle{ display:flex; align-items:center; gap:6px; background: var(--panel-bg); border:1px solid var(--border); border-radius:999px; padding:7px 16px; font-size:13.5px; font-weight:bold; color: var(--text); cursor:pointer; white-space:nowrap; flex-shrink:0; }
.theme-toggle:hover{ border-color:#25D366; }
.theme-toggle #themeIcon{ font-size:16px; }

.page-wrap{ display:flex; gap:22px; align-items:flex-start; flex-wrap:wrap; }
.app{ display:flex; gap:20px; align-items:flex-start; flex-wrap:wrap; flex:1 1 600px; min-width:0; }

/* ---------- FORM ---------- */
.form-panel{ border:1px solid var(--border); border-radius:4px; padding:18px; flex:1 1 250px; min-width:250px; max-width:340px; background: var(--panel-bg); }
.row{ display:flex; align-items:center; justify-content:flex-end; gap:8px; margin-bottom:14px; }
.row label{ text-align:right; flex:1; font-size:13.5px; color:var(--text); }
.help{ display:inline-flex; align-items:center; justify-content:center; width:14px; height:14px; border-radius:50%; border:1px solid #999; color:#777; font-size:10px; margin-left:3px; cursor:default; }
.row input[type="text"], .row input[type="number"]{ border:1px solid var(--input-border); border-radius:3px; padding:6px 8px; font-size:13.5px; width:130px; background: var(--input-bg); color: var(--input-text); }
.row select{ border:1px solid var(--input-border); border-radius:3px; padding:6px 6px; font-size:13px; width:138px; background: var(--input-bg); color: var(--input-text); }
.suffix{ font-size:13px; color:var(--text); margin-left:2px; }
.unit-toggle{ display:flex; gap:6px; justify-content:flex-end; width:100%; }
.unit-toggle button{ border:1px solid var(--border); background: var(--panel-bg); color: var(--text); border-radius:4px; padding:4px 12px; font-size:12px; font-weight:bold; cursor:pointer; flex:none; }
.unit-toggle button.active{ background: var(--green); border-color: var(--green); color:#fff; }
.btn-row{ display:flex; gap:10px; margin-top:6px; }
button{ font-size:14px; padding:9px 0; border-radius:4px; border:none; cursor:pointer; flex:1; }
.btn-calc{ background: var(--green); color:#fff; }
.btn-calc:hover{ background: var(--green-dark); }
.btn-clear{ background:#c9c9c9; color:#333; }
.btn-clear:hover{ background:#bbb; }

/* ---------- RESULTS ---------- */
.results-panel{ flex:1 1 280px; min-width:280px; max-width:380px; }
.pay-banner{ background: var(--green); color:#fff; padding:14px 16px; border-radius:4px 4px 0 0; font-size:17px; }
.pay-banner .amt{ font-weight:bold; margin-left:8px; }
table.results-table{ width:100%; border-collapse:collapse; border:1px solid var(--border); border-top:none; background: var(--panel-bg); }
table.results-table th, table.results-table td{ padding:9px 12px; text-align:right; border-bottom:1px solid var(--border-light); font-size:13.5px; }
table.results-table th:first-child, table.results-table td:first-child{ text-align:left; }
table.results-table thead th{ background: var(--head-bg); font-weight:bold; }
table.results-table tr.total-row td{ font-weight:bold; background: var(--row-alt); border-bottom:none; }
table.summary-table{ width:100%; border-collapse:collapse; margin-top:14px; border:1px solid var(--border); background: var(--panel-bg); }
table.summary-table td{ padding:9px 12px; border-bottom:1px solid var(--border-light); font-size:13.5px; }
table.summary-table td:last-child{ text-align:right; font-weight:bold; }
table.summary-table tr:first-child td{ background: var(--head-bg); font-weight:bold; }
table.summary-table tr:last-child td{ border-bottom:none; }
.result-note{ font-size:12.5px; color:var(--seo-text); margin-top:10px; line-height:1.5; }
.gauge-wrap{ text-align:center; padding:16px 12px; border:1px solid var(--border); border-top:none; background:var(--panel-bg); }
.gauge-label{ font-size:26px; font-weight:bold; margin-top:6px; }
.gauge-sub{ font-size:13px; color:var(--seo-text); }

/* ---------- SIDEBAR ---------- */
.sidebar{ flex:1 1 260px; min-width:230px; max-width:300px; margin-top:45px; }
.sidebar-search{ display:flex; gap:8px; margin-bottom:16px; }
.sidebar-search input{ flex:1; border:1px solid #999999; border-radius:3px; padding:8px; background: var(--input-bg); color: var(--input-text); }
.sidebar-search button{ background-color:#25D366; color:#ffffff; border:none; border-radius:3px; padding:8px 18px; cursor:pointer; font-size:14px; }
.sidebar-box{ border:1px solid var(--sidebar-border); border-radius:4px; overflow:hidden; margin-bottom:18px; }
.sidebar-box-header{ background-color:#25D366; color:#ffffff; font-weight:bold; padding:10px 14px; font-size:15px; }
.sidebar-box-body{ display:flex; flex-direction:column; gap:2px; padding:14px; background: var(--panel-bg); }
.sidebar-box-body a{ display:block; color:#1a8f4a; text-decoration:none; font-size:14px; padding:3px 0; }
.sidebar-box-body a:hover{ text-decoration:underline; }

@media (max-width: 700px){ .app{ flex-direction:column; } .form-panel, .results-panel{ width:100%; max-width:100%; } }
@media (max-width: 900px){ .sidebar{ display:none; } }

/* ---------- PRINT ---------- */
@media print{
  .navbar, .hamburger, .mobile-menu, .sidebar, .print-link, .btn-row, .site-footer, .theme-toggle{ display:none !important; }
  *{ -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; color-adjust:exact !important; }
}

/* ---------- SEO CONTENT ---------- */
.seo-content{ max-width:900px; margin:44px auto 0; line-height:1.7; color: var(--seo-text); }
.seo-content h2{ font-size:19px; margin:34px 0 12px; color: var(--text); border-bottom:2px solid #25D366; padding-bottom:6px; }
.seo-content h2:first-child{ margin-top:0; }
.seo-content h3{ font-size:16px; margin:20px 0 8px; color: var(--text); }
.seo-content p{ margin:0 0 14px; font-size:14.5px; }
.seo-content ol, .seo-content ul{ margin:0 0 14px; padding-left:22px; font-size:14.5px; }
.seo-content li{ margin-bottom:6px; }
.seo-content .faq-item{ margin-bottom:16px; }
.seo-content .faq-item h3{ margin-bottom:4px; }
.formula-box{
  font-family:'Courier New', monospace;
  background: var(--row-alt);
  border-left:4px solid #25D366;
  padding:14px 18px;
  margin:10px 0 20px;
  font-size:14.5px;
  border-radius:4px;
  overflow-x:auto;
  white-space:pre-wrap;
  color: var(--text);
}
.seo-content table.results-table, .seo-content table.summary-table{ margin-bottom:18px; }

/* ---------- CATEGORY GRID (used by category pages) ---------- */
.cal-grid{ display:grid; grid-template-columns:repeat(2, 1fr); gap:14px; margin-bottom:34px; }
.cal-card{ background: var(--row-alt); border-radius:6px; padding:18px 16px; text-align:center; text-decoration:none; color: var(--text); font-weight:600; font-size:14.5px; border:1px solid var(--border-light); }
.cal-card:hover{ border-color: var(--green); }
@media (max-width:600px){ .cal-grid{ grid-template-columns:repeat(2, 1fr); } }
