:root{
  --pn-green:#4CAF50;
  --pn-green-hover:#388E3C;
  --pn-green-deep:#2E7D32;

  --pn-text:#1f2937;
  --pn-muted:#4b5563;
  --pn-card:#ffffff;
  --pn-border:rgba(0,0,0,0.10);
  --pn-danger-soft:#fff5f5;
}

*{ box-sizing:border-box; }

body{
  font-family:Arial,sans-serif;
  background:url('background.webp') no-repeat center center fixed;
  background-size:cover;
  margin:0;
  padding:0;
  color:var(--pn-text);
}

nav{
  text-align:center;
  margin:10px 0 0 0;
  font-size:1.15em;
}
nav a{
  margin:0 12px;
  text-decoration:none;
  color:#0077ff;
}

.wrap,.content-wrap{
  max-width:960px;
  margin:0 auto;
  padding:10px 20px 30px;
}

.box,.hero-box,.info-box,.calculator-box{
  background:var(--pn-card);
  border-radius:12px;
  padding:20px;
  box-shadow:0 4px 10px rgba(0,0,0,0.10);
  border:1px solid var(--pn-border);
  margin:0 0 15px;
}

h1{margin:0 0 10px;}
h2{margin:0 0 10px;}
h3{margin:12px 0 6px;}

.muted{color:var(--pn-muted);line-height:1.45;}
.small{font-size:0.95em;}

/* === INPUT GRID STANDARD (LOCKED GLOBAL SYSTEM) === */
.input-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin:8px 0 8px;
}

.input-grid > div{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.input-grid label{
  margin-bottom:6px;
  font-weight:500;
}

.input-grid input{
  width:100%;
  box-sizing:border-box;
}

/* Legacy fallback for older pages still using .inputs */
.inputs{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin:8px 0 8px;
}

.inputs label{
  display:block;
  margin-bottom:6px;
  font-weight:500;
}

/* Base form controls */
input, select{
  width:100%;
  padding:11px 12px;
  margin:0;
  border-radius:10px;
  border:1px solid rgba(0,0,0,0.16);
  background:#fff;
  outline:none;
  transition:border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus{
  border-color:rgba(76,175,80,0.65);
  box-shadow:0 0 0 4px rgba(76,175,80,0.18);
}

.btn-row{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:10px;
  margin-top:6px;
}

.btn-primary{
  border:0;
  border-radius:10px;
  cursor:pointer;
  padding:12px 12px;
  background:linear-gradient(135deg, var(--pn-green) 0%, #43A047 100%);
  color:#fff;
  font-size:1.02em;
  font-weight:800;
  letter-spacing:0.2px;
  box-shadow:0 10px 20px rgba(76,175,80,0.28);
  transition:transform 0.08s ease, box-shadow 0.18s ease, background 0.18s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  user-select:none;
}

.btn-primary:hover{
  background:linear-gradient(135deg, var(--pn-green-hover) 0%, var(--pn-green-deep) 100%);
  box-shadow:0 14px 28px rgba(56,142,60,0.35);
}
.btn-primary:active{
  transform:translateY(1px);
  box-shadow:0 6px 12px rgba(56,142,60,0.25);
}
.btn-primary:focus-visible{
  outline:3px solid rgba(76,175,80,0.35);
  outline-offset:3px;
}

.btn-secondary{
  border:1px solid rgba(0,0,0,0.14);
  border-radius:10px;
  cursor:pointer;
  padding:12px 12px;
  background:#fff;
  color:var(--pn-text);
  font-size:1.02em;
  font-weight:800;
  transition:transform 0.08s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  user-select:none;
}
.btn-secondary:hover{
  border-color:rgba(76,175,80,0.45);
  box-shadow:0 10px 20px rgba(0,0,0,0.06);
}
.btn-secondary:active{ transform:translateY(1px); }
.btn-secondary:focus-visible{
  outline:3px solid rgba(76,175,80,0.22);
  outline-offset:3px;
}

.result,.calc-result{
  margin-top:10px;
  padding:10px 12px;
  border-radius:10px;
  background:#f6f8ff;
  border:1px solid var(--pn-border);
  font-weight:800;
  min-height:22px;
  word-break:break-word;
  transition:background 0.2s ease, border-color 0.2s ease;
}
.result.is-error,.calc-result.is-error{
  background:var(--pn-danger-soft);
  border-color:rgba(220, 38, 38, 0.25);
  color:#7f1d1d;
}
.result.pulse,.calc-result.pulse{
  animation:pnPulse 650ms ease-out;
  background:rgba(76,175,80,0.10);
  border-color:rgba(76,175,80,0.45);
}

@keyframes pnPulse{
  0%{transform:scale(1); box-shadow:0 0 0 rgba(76,175,80,0.0);}
  35%{transform:scale(1.01); box-shadow:0 14px 30px rgba(76,175,80,0.18);}
  100%{transform:scale(1); box-shadow:0 0 0 rgba(76,175,80,0.0);}
}

.hint{margin-top:8px;font-size:0.92em;color:var(--pn-muted);}

.two-col{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(320px, 1fr));
  gap:15px;
}

.calculator-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(380px, 1fr));
  gap:20px;
  padding:10px 20px 30px;
  max-width:960px;
  margin:auto;
}

.calculator-box.active{
  border-color:rgba(76,175,80,0.55);
  box-shadow:0 10px 24px rgba(76,175,80,0.18);
  transform:translateY(-1px);
}

.card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));
  gap:15px;
}
.tool-card a{
  text-decoration:none;
  color:inherit;
  display:block;
}
.tool-card h3{margin:0 0 6px;}
.tool-card p{margin:0; line-height:1.35;}
.badge{
  display:inline-block;
  font-size:0.82em;
  font-weight:800;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,0.12);
  background:rgba(76,175,80,0.08);
  color:var(--pn-green-deep);
  margin-bottom:8px;
}

@media (max-width:760px){
  input, select{width:100%;}
  .btn-row{grid-template-columns:1fr;}
  .calculator-grid{padding-bottom:30px;}
}


/* Breadcrumbs */
.breadcrumbs{font-size:0.95em;color:var(--pn-muted);margin:0 0 12px;}
.breadcrumbs a{color:#0077ff;text-decoration:none;}
.breadcrumbs a:hover{text-decoration:underline;}
.breadcrumbs .sep{margin:0 6px;color:rgba(0,0,0,0.35);}

/* Related calculators */
.related-list{margin:0;padding-left:18px;}
.related-list li{margin:6px 0;}

/* Site footer */
.site-footer{margin-top:30px;padding:18px 0 28px;}
.footer-inner{max-width:960px;margin:0 auto;padding:0 20px;text-align:center;}
.footer-links{display:flex;gap:14px;flex-wrap:wrap;justify-content:center;margin:0 0 12px;}
.footer-links a{color:#0077ff;text-decoration:none;font-weight:700;}
.footer-links a:hover{text-decoration:underline;}
.footer-disclaimer{color:var(--pn-muted);font-size:0.95em;line-height:1.45;margin:0 auto 10px;max-width:820px;}
.footer-copy{color:rgba(0,0,0,0.55);font-size:0.92em;margin:0;}
/* Calculator disclaimer (AdSense trust signal) */
.calc-disclaimer{
  margin-top:8px;
  font-size:0.85em;
  color:#6b7280;
  line-height:1.4;
}


@media (max-width:640px){
  .input-grid,
  .inputs{
    grid-template-columns:1fr;
  }

  .btn-row{
    grid-template-columns:1fr;
  }
}

/* Calculators hub grid */
.calc-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:16px;
  margin-top:16px;
}

.calc-card{
  display:block;
  text-decoration:none;
  background:#ffffff;
  border-radius:12px;
  padding:16px;
  border:1px solid rgba(0,0,0,0.08);
  box-shadow:0 4px 10px rgba(0,0,0,0.06);
  transition:transform 0.12s ease, box-shadow 0.12s ease;
  color:inherit;
}

.calc-card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 22px rgba(0,0,0,0.10);
}

.calc-card h3{
  margin:0 0 6px;
  font-size:1.05em;
}

.calc-card p{
  margin:0;
  font-size:0.92em;
  color:#4b5563;
  line-height:1.4;
}

/* === INTERNAL LINKING SYSTEM (GLOBAL) === */
.related-links,
.next-steps,
.same-number-links {
  margin: 32px 0;
  padding: 20px;
  background: #f8fbff;
  border: 1px solid #dbe8f4;
  border-radius: 14px;
}

.related-links h2,
.next-steps h2,
.same-number-links h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
  line-height: 1.3;
}

.related-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.related-links-grid a {
  display: block;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #d9e4ee;
  border-radius: 10px;
  text-decoration: none;
  color: #123;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.related-links-grid a:hover {
  background: #eef6ff;
  border-color: #a9c8e8;
  transform: translateY(-1px);
}

/* === PERCENT-OF PAGES (UPGRADED) === */
.pn-ad {
  margin: 28px 0;
}

.faq-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px;
  border-radius: 8px;
  margin: 12px 0;
}

