:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #eef2f6;
  --ink: #111827;
  --muted: #667085;
  --line: #d9e0e8;
  --accent: #176b5b;
  --accent-dark: #0f5145;
  --positive: #16794f;
  --negative: #a43b3b;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(23, 107, 91, 0.09), transparent 28rem),
    var(--bg);
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 40px;
}

.hero {
  max-width: 760px;
  margin-bottom: 36px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.method-section h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(2.35rem, 7vw, 4.8rem);
}

.hero p {
  max-width: 670px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.calculator-card {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel,
.result-panel {
  padding: clamp(26px, 5vw, 46px);
}

.input-panel {
  border-right: 1px solid var(--line);
}

.input-panel h2 {
  margin: 0 0 24px;
  font-size: 1.5rem;
}

label {
  display: block;
  margin: 18px 0 8px;
  font-size: 0.9rem;
  font-weight: 750;
}

.money-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #b8c3cf;
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.money-input:focus-within,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(23, 107, 91, 0.11);
}

.money-input span {
  color: var(--muted);
  font-weight: 800;
}

.money-input input {
  width: 100%;
  padding: 14px 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1.1rem;
  font-weight: 750;
}

select {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid #b8c3cf;
  border-radius: var(--radius-sm);
  outline: 0;
  color: var(--ink);
  background: var(--surface);
  font-weight: 650;
}

.hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

button {
  width: 100%;
  margin-top: 24px;
  padding: 14px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  color: white;
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
  transition:
    background 0.16s ease,
    transform 0.16s ease;
}

button:hover {
  background: var(--accent-dark);
}

button:active {
  transform: translateY(1px);
}

.error {
  min-height: 1.35em;
  margin: 10px 0 0;
  color: var(--negative);
  font-size: 0.84rem;
  font-weight: 650;
}

.result-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #111827;
  color: white;
}

.result-label {
  margin: 0;
  color: #c4ceda;
  font-size: 0.9rem;
  font-weight: 700;
}

.annual-net {
  margin: 4px 0 20px;
  font-size: clamp(2.6rem, 8vw, 5.1rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.045em;
}

.monthly-box,
.relief-box {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px 16px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
}

.monthly-box span,
.relief-box span {
  color: #d5dde7;
  font-size: 0.88rem;
}

.monthly-box strong,
.relief-box strong {
  font-size: 1.35rem;
}

.monthly-box small {
  flex-basis: 100%;
  color: #9ba8b7;
}

.relief-box {
  margin-top: 10px;
}

.relief-box strong {
  color: #84dfc2;
}

.result-note {
  margin: 18px 0 0;
  color: #aab5c3;
  font-size: 0.82rem;
}

.breakdown-section,
.method-section {
  margin-top: 58px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-heading h2,
.method-section h2 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
}

.section-heading p {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: right;
}

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

.breakdown-card {
  min-height: 156px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.breakdown-card span {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.breakdown-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.55rem;
  letter-spacing: -0.025em;
}

.breakdown-card.negative strong {
  color: var(--negative);
}

.breakdown-card small {
  color: var(--muted);
  font-size: 0.76rem;
}

.detail-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.detail-box summary {
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 800;
}

.detail-rows {
  padding: 0 20px 12px;
}

.detail-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.detail-rows span {
  color: var(--muted);
}

.total-row {
  font-size: 1.03rem;
  font-weight: 800;
}

.total-row span,
.total-row strong {
  color: var(--ink);
}

.method-section {
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.method-section ul {
  margin: 24px 0;
  padding-left: 22px;
  color: #3d4754;
}

.method-section li + li {
  margin-top: 8px;
}

.formula-box {
  padding: 18px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.formula-box h3 {
  margin: 0 0 8px;
  font-size: 0.93rem;
}

.formula-box code {
  color: #344054;
  white-space: normal;
  font-size: 0.88rem;
}

.disclaimer {
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

footer {
  padding: 8px 16px 36px;
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
}

@media (max-width: 820px) {
  .page-shell {
    padding-top: 40px;
  }

  .calculator-card {
    grid-template-columns: 1fr;
  }

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .breakdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .section-heading p {
    text-align: left;
  }
}

@media (max-width: 540px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
  }

  .breakdown-grid {
    grid-template-columns: 1fr;
  }

  .breakdown-card {
    min-height: auto;
  }

  .detail-rows > div {
    flex-direction: column;
    gap: 3px;
  }
}


.sources-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfd;
}

.sources-box summary {
  padding: 15px 18px;
  cursor: pointer;
  font-weight: 800;
}

.sources-box ul {
  margin: 0;
  padding: 0 36px 18px;
}

.sources-box a {
  color: var(--accent-dark);
  text-underline-offset: 3px;
}


.portfolio-intro{padding:24px;margin-bottom:36px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md)}
.portfolio-intro h2{font-size:clamp(1.4rem,4vw,2rem);line-height:1.2;margin:20px 0 12px}
.portfolio-intro p{color:var(--muted);max-width:78ch}
.portfolio-intro a{color:var(--accent-dark);font-weight:700;text-underline-offset:4px}
[hidden]{display:none!important}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
