*, *::before, *::after { box-sizing: border-box; }
:root {
  --navy:#0f172a;
  --navy2:#1e293b;
  --navy3:#334155;
  --panel:#111c30;
  --panel2:#1b2a44;
  --gold:#f59e0b;
  --teal:#0891b2;
  --green:#059669;
  --text:#e2e8f0;
  --muted:#94a3b8;
  --dim:#64748b;
  --danger:#f87171;
}
body.legacy-modern {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--navy);
  color: var(--text);
  line-height: 1.6;
}
.legacy-modern a { color: var(--gold); text-decoration: none; }
.legacy-modern a:hover { text-decoration: underline; }
.site-header {
  background: var(--navy);
  border-bottom: 1px solid var(--navy3);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.site-header .logo { color: var(--gold); font-weight: bold; font-size: 1.15rem; }
.site-header .tagline { color: var(--dim); font-size: .85rem; text-align: right; }
.tool-hero {
  background: linear-gradient(150deg, #0f172a 0%, #11233d 60%, #082536 100%);
  border-bottom: 3px solid var(--teal);
  padding: 38px 24px 30px;
}
.tool-hero-inner { max-width: 1080px; margin: 0 auto; }
.breadcrumb { color: var(--muted); font-size: .86rem; margin-bottom: 14px; }
.tool-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
  margin: 0 0 12px;
}
.tool-hero .sub { color: var(--muted); max-width: 760px; font-size: 1.05rem; margin: 0; }
.tool-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.hero-btn {
  align-items: center;
  background: var(--teal);
  border-radius: 6px;
  color: #fff !important;
  display: inline-flex;
  font-weight: bold;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  text-decoration: none !important;
}
.hero-btn:hover { background: #0e7490; }
.hero-btn.secondary {
  background: transparent;
  border: 1px solid var(--navy3);
  color: var(--text) !important;
}
.hero-btn.secondary:hover { border-color: var(--teal); }
.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.hero-proof span {
  background: rgba(8,145,178,.12);
  border: 1px solid rgba(8,145,178,.32);
  border-radius: 999px;
  color: var(--text);
  font-size: .78rem;
  font-weight: bold;
  padding: 6px 10px;
}
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.tool-body { padding: 36px 0; }
.tool-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
.tool-grid.wide-left { grid-template-columns: 420px minmax(0, 1fr); }
.panel {
  background: var(--navy2);
  border: 1px solid var(--navy3);
  border-radius: 10px;
  overflow: hidden;
}
.panel-header { background: var(--panel2); border-bottom: 1px solid var(--navy3); padding: 16px 20px; }
.panel-header h2, .panel-header h3 { margin: 0; color: #fff; font-size: 1rem; }
.panel-body { padding: 18px 20px; }
.field { margin-bottom: 14px; }
.field label {
  display: block;
  color: var(--muted);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: .76rem;
  margin-bottom: 5px;
}
.field input, .field select {
  width: 100%;
  background: var(--navy);
  border: 1px solid var(--navy3);
  border-radius: 5px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: bold;
}
.field input:focus, .field select:focus { outline: 2px solid var(--teal); border-color: transparent; }
.field .hint { color: var(--dim); font-size: .75rem; margin-top: 4px; }
.submit-btn, .action-btn {
  width: 100%;
  background: var(--teal);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}
.submit-btn:hover, .action-btn:hover { background: #0e7490; }
.result-primary {
  background: var(--navy2);
  border: 1px solid var(--teal);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.result-primary .label { color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-size: .76rem; }
.result-primary .value { color: var(--teal); font-size: clamp(2rem, 5vw, 3rem); font-weight: bold; line-height: 1.05; margin-top: 4px; }
.result-stack { min-width: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.metric {
  background: var(--navy2);
  border: 1px solid var(--navy3);
  border-radius: 8px;
  padding: 14px 16px;
}
.metric .label { color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-size: .72rem; }
.metric .value { color: #fff; font-weight: bold; font-size: 1.25rem; margin-top: 3px; }
.content-section {
  border-top: 1px solid var(--navy3);
  margin-top: 34px;
  padding-top: 28px;
}
.content-section h2 { color: #fff; margin: 0 0 10px; font-size: 1.35rem; }
.content-section h3 { color: var(--gold); margin: 22px 0 8px; font-size: 1rem; }
.content-section p, .content-section li { color: var(--muted); font-size: .96rem; }
.content-section ul { padding-left: 22px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--navy3); border-radius: 8px; background: var(--navy2); }
.table-wrap table, table.modern-table { width: 100%; border-collapse: collapse; color: var(--muted); font-size: .9rem; }
.table-wrap th, .table-wrap td, table.modern-table th, table.modern-table td { padding: 10px 12px; border-bottom: 1px solid rgba(51,65,85,.5); text-align: right; }
.table-wrap th:first-child, .table-wrap td:first-child, table.modern-table th:first-child, table.modern-table td:first-child { text-align: left; }
.table-wrap th, table.modern-table th { color: var(--text); background: #0b1527; }
.site-footer {
  border-top: 1px solid var(--navy3);
  padding: 24px;
  text-align: center;
  color: var(--dim);
  font-size: .82rem;
}
.site-footer a { color: var(--dim); }
.tool-note {
  background: rgba(245,158,11,.08);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--muted);
}
.formula-note {
  margin-top: 16px;
}
.formula-note .label {
  color: var(--muted);
  display: block;
  font-size: .72rem;
  font-weight: bold;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.formula-note .formula {
  color: #fff;
  display: block;
  font-size: 1.05rem;
  font-weight: bold;
  margin: 3px 0 4px;
  overflow-wrap: anywhere;
}
.chart-fallback {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.35);
  border-radius: 8px;
  color: var(--muted);
  margin: 12px 0 0;
  padding: 12px 14px;
  text-align: left;
}
@media (max-width: 780px) {
  .site-header { align-items: flex-start; }
  .site-header .tagline { max-width: 145px; }
  .tool-grid, .tool-grid.wide-left { grid-template-columns: 1fr; }
  .tool-hero { padding: 30px 24px 24px; }
  .tool-hero-actions a { flex: 1 1 150px; }
  .pvifa-page .result-stack { order: -1; }
}
@media (max-width: 420px) {
  .site-header { padding: 12px 18px; }
  .site-header .logo { font-size: 1rem; }
  .site-header .tagline { font-size: .75rem; }
}
