:root{
  --erc-ink:#0f172a;
  --erc-muted:#475569;
  --erc-navy:#083141;
  --erc-navy2:#0a4a5f;
  --erc-green:#2e7d32;
  --erc-green2:#1b5e20;
  --erc-red:#b91c1c;
  --erc-bg:#ffffff;
  --erc-card:#ffffff;
  --erc-border:#e2e8f0;
  --erc-shadow:0 18px 50px rgba(2,6,23,.10);
}

/* Do not apply global overflow rules here. We contain overflow on the calculator wrapper instead. */

.erc-app{
  width: 100%;
}

/* Break out of narrow theme containers (stable alignfull pattern) */
#erc-root.erc-app{
  width: auto;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  box-sizing: border-box;
  padding: 0 14px;
  /* Prevent full-width section causing page-level horizontal scroll on desktop browsers. */
  overflow-x: hidden;
  overflow-y: visible;
}

.erc-shell{
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 18px 30px;
  box-sizing: border-box;
  font-family: inherit;
  color: var(--erc-ink);
  background: var(--erc-bg);
  border: 2px solid rgba(8,49,65,.18);
  border-radius: 22px;
  box-shadow: 0 22px 70px rgba(2,6,23,.10);
}

.erc-hero{
  background: radial-gradient(1200px 420px at 10% 0%, rgba(46,125,50,.12), transparent 58%),
              radial-gradient(1200px 420px at 90% 0%, rgba(8,49,65,.13), transparent 58%),
              linear-gradient(135deg, #ffffff 0%, #f6fbf8 52%, #eef8f0 100%);
  border: 1px solid rgba(46,125,50,.22);
  border-radius: 18px;
  padding: 22px 22px 20px;
  box-shadow: var(--erc-shadow);
}

.erc-title{
  margin: 0 0 10px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--erc-navy);
  font-size: clamp(1.35rem, 3.6vw, 2.0rem);
  line-height: 1.18;
}

.erc-subtitle{
  margin: 0;
  color: var(--erc-muted);
  font-size: 1.03rem;
  line-height: 1.6;
  font-weight: 500;
}

.erc-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

.erc-card{
  background: var(--erc-card);
  border: 1px solid var(--erc-border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 28px rgba(2,6,23,.06);
}

.erc-card-wide{
  margin-top: 16px;
}

.erc-card-title{
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--erc-navy);
  letter-spacing: -0.01em;
}

.erc-fields{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.erc-fields-cta{
  margin-top: 12px;
}

.erc-target{
  border: 2px solid rgba(46,125,50,.32);
  background: radial-gradient(900px 300px at 50% 0%, rgba(46,125,50,.14), transparent 55%),
              linear-gradient(135deg, #ffffff 0%, #f6fbf8 55%, #eef8f0 100%);
}

.erc-target__title{
  margin: 0 0 10px;
  font-weight: 950;
  letter-spacing: -0.02em;
  color: var(--erc-navy);
  font-size: clamp(1.25rem, 3.2vw, 1.7rem);
}

.erc-target__sub{
  margin: 0 0 14px;
  color: var(--erc-muted);
  font-weight: 650;
  line-height: 1.6;
  font-size: 1.02rem;
}

.erc-field{
  display: grid;
  gap: 6px;
}

.erc-label{
  font-size: .92rem;
  color: var(--erc-muted);
  font-weight: 700;
}

.erc-input{
  width: 100%;
  box-sizing: border-box;
  padding: 12px 12px;
  border-radius: 12px;
  border: 2px solid rgba(8,49,65,.20);
  font-size: 1rem;
  font-weight: 650;
  color: var(--erc-ink);
  outline: none;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.erc-input:focus{
  border-color: rgba(46,125,50,.55);
  box-shadow: 0 0 0 5px rgba(46,125,50,.14);
}

.erc-badge{
  border-radius: 12px;
  padding: 12px 12px;
  font-weight: 650;
  line-height: 1.5;
  font-size: .95rem;
}

.erc-badge-warn{
  background: rgba(185,28,28,.07);
  border: 1px solid rgba(185,28,28,.22);
  color: #7f1d1d;
}

.erc-badge-ok{
  background: rgba(46,125,50,.08);
  border: 1px solid rgba(46,125,50,.22);
  color: #145214;
}

.erc-results-head{
  display: grid;
  gap: 10px;
}

.erc-mini{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.erc-results-context{
  margin-top: 14px;
  padding: 16px 14px;
  border-radius: 16px;
  border: 1px solid rgba(8,49,65,.14);
  background: linear-gradient(135deg, rgba(8,49,65,.04), rgba(46,125,50,.05));
}

.erc-results-context__title{
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 950;
  color: var(--erc-navy);
  letter-spacing: -0.01em;
}

.erc-mini-item{
  border: 1px solid rgba(8,49,65,.14);
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.92), rgba(232, 245, 233, 0.78));
  border-radius: 14px;
  padding: 12px 12px;
}

.erc-mini-label{
  font-size: .86rem;
  font-weight: 800;
  color: var(--erc-muted);
}

.erc-mini-value{
  margin-top: 6px;
  font-size: 1.12rem;
  font-weight: 950;
  color: var(--erc-navy);
}

.erc-mini-note{
  margin: 12px 0 0;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(8,49,65,.14);
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.25), rgba(187, 247, 208, 0.25));
  color: #0f172a;
  font-size: 0.95rem;
  line-height: 1.55;
  font-weight: 650;
}

.erc-mini-note strong{
  color: var(--erc-navy);
  font-weight: 950;
}

.erc-charts{
  margin-top: 16px;
}

.erc-chart-card{
  background: var(--erc-card);
  border: 1px solid var(--erc-border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 28px rgba(2,6,23,.06);
}

.erc-help{
  margin: 0 0 10px;
  color: var(--erc-muted);
  line-height: 1.55;
  font-size: .98rem;
}

.erc-list{
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--erc-ink);
  line-height: 1.6;
}

.erc-list li{
  margin: 6px 0;
}

.erc-alt{
  margin-top: 14px;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(8,49,65,.14);
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.16), rgba(187, 247, 208, 0.16));
}

.erc-alt__title{
  font-weight: 950;
  color: var(--erc-navy);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.erc-alt__text{
  margin: 0 0 10px;
  color: var(--erc-muted);
  font-weight: 650;
  line-height: 1.55;
}

.erc-alt__link{
  display: inline-block;
  font-weight: 950;
  color: #0b3b4a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.erc-alt__link:hover{
  color: #062a36;
}

.erc-chart-wrap{
  height: 340px;
}

.erc-table{
  margin-top: 12px;
}

.erc-table-wrap{
  overflow-x: auto;
  border: 1px solid var(--erc-border);
  border-radius: 14px;
}

.erc-table-el{
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: .92rem;
}

.erc-table-el th,
.erc-table-el td{
  border: 1px solid var(--erc-border);
  padding: 10px 10px;
  text-align: left;
}

.erc-table-el th{
  background: #f1f5f9;
  font-weight: 900;
  color: var(--erc-navy);
  position: sticky;
  top: 0;
  z-index: 2;
}

.erc-td-num{
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.erc-td-good{
  color: var(--erc-green2);
  font-weight: 900;
}

.erc-export{
  margin-top: 22px;
  padding: 22px 18px 20px;
  border-radius: 18px;
  border: 2px solid rgba(46,125,50,.32);
  background: radial-gradient(900px 300px at 50% 0%, rgba(46,125,50,.14), transparent 55%),
              linear-gradient(135deg, #ffffff 0%, #e8f5e9 100%);
  text-align: center;
}

.erc-export-title{
  margin: 0 0 10px;
  color: var(--erc-navy);
  font-weight: 950;
  letter-spacing: -0.02em;
  font-size: clamp(1.2rem, 3.0vw, 1.6rem);
}

.erc-export-sub{
  margin: 0 auto 16px;
  max-width: 620px;
  color: var(--erc-muted);
  font-weight: 600;
  line-height: 1.55;
}

.erc-export-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 460px;
  padding: 18px 22px;
  font-size: 1.08rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #43a047 0%, #2e7d32 55%, #1b5e20 100%);
  box-shadow: 0 6px 0 #145214, 0 16px 34px rgba(46,125,50,.40);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
  font-family: inherit;
}

.erc-export-btn:hover{
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 8px 0 #145214, 0 20px 42px rgba(46,125,50,.50);
}

.erc-export-btn:active{
  transform: translateY(2px);
  box-shadow: 0 3px 0 #145214, 0 10px 24px rgba(46,125,50,.34);
}

.erc-disclaimer{
  margin-top: 14px;
  color: var(--erc-muted);
  font-size: .92rem;
  line-height: 1.6;
}

/* Modal */
.erc-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 20px;
  box-sizing: border-box;
}

.erc-modal{
  background: #fff;
  border: 3px solid var(--erc-navy);
  border-radius: 20px;
  box-shadow: 0 22px 70px rgba(0,0,0,.45);
  max-width: 560px;
  width: 100%;
  overflow: hidden;
}

.erc-modal-header{
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--erc-navy), var(--erc-navy2));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.erc-modal-header h3{
  margin: 0;
  color: #fff;
  font-weight: 950;
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  line-height: 1.25;
  padding-right: 10px;
}

.erc-modal-close{
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  color: #fff;
  background: rgba(255,255,255,.2);
}

.erc-modal-body{
  padding: 22px 24px;
}

.erc-modal-lead{
  margin: 0 0 16px;
  color: #1e293b;
  font-weight: 550;
  font-size: 1.02rem;
  line-height: 1.6;
}

.erc-modal-label{
  display: block;
  margin: 10px 0 7px;
  font-weight: 900;
  color: #0f172a;
  font-size: .95rem;
}

.erc-modal-input{
  width: 100%;
  box-sizing: border-box;
  border: 2px solid rgba(8,49,65,.28);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 1rem;
  font-weight: 650;
  outline: none;
}

.erc-modal-input:focus{
  border-color: rgba(46,125,50,.6);
  box-shadow: 0 0 0 5px rgba(46,125,50,.14);
}

.erc-modal-trust{
  margin-top: 14px;
  background: #e8f5e9;
  border: 1px solid rgba(46,125,50,.25);
  padding: 14px 14px;
  border-radius: 14px;
  color: #145214;
  line-height: 1.45;
  font-size: .92rem;
  font-weight: 650;
}

.erc-modal-error{
  margin-top: 10px;
  color: #b91c1c;
  font-weight: 700;
  font-size: .92rem;
}

.erc-modal-footer{
  padding: 18px 24px;
  background: #f1f8f4;
  border-top: 2px solid rgba(46,125,50,.20);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.erc-modal-submit{
  flex: 1 1 auto;
  min-width: min(100%, 240px);
  min-height: 54px;
  border-radius: 14px;
  border: 2px solid #145214;
  background: linear-gradient(180deg, #43a047 0%, #2e7d32 55%, #1b5e20 100%);
  color: #fff;
  font-weight: 950;
  cursor: pointer;
  font-size: 1.02rem;
  letter-spacing: .02em;
}

.erc-modal-submit:disabled{
  opacity: .6;
  cursor: not-allowed;
}

.erc-modal-btn-secondary{
  border: 2px solid rgba(8,49,65,.25);
  background: #fff;
  color: var(--erc-navy);
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 850;
  cursor: pointer;
  min-height: 54px;
}

.erc-modal-success{
  margin: 0;
  padding: 14px 10px;
  color: var(--erc-green);
  font-weight: 950;
  font-size: 1.05rem;
  text-align: center;
}

@media (max-width: 720px){
  .erc-mini{
    grid-template-columns: 1fr;
  }
  .erc-chart-wrap{
    height: 280px;
  }
}

@media print{
  .erc-export,
  .erc-modal-overlay{
    display: none !important;
  }
  #erc-root.erc-app{
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .erc-shell{
    max-width: 100%;
    padding: 0;
  }
  .erc-hero{
    box-shadow: none;
  }
}

