:root {
  --bg-top: #eff7f6;
  --bg-bottom: #fff9ef;
  --panel: #ffffff;
  --panel-soft: #f8faf8;
  --text-main: #163133;
  --text-soft: #516a6e;
  --line: #d6e3e1;
  --accent: #0a9396;
  --accent-strong: #005f73;
  --highlight: #ee9b00;
  --positive: #2f9e44;
  --shadow: 0 16px 42px rgba(3, 43, 45, 0.12);
  --radius-xl: 24px;
  --radius-md: 14px;
  --page-width: 1440px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 24px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text-main);
  background: linear-gradient(165deg, var(--bg-top), var(--bg-bottom));
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 340px;
  aspect-ratio: 1;
  border-radius: 50%;
  z-index: 0;
  filter: blur(0.5px);
  pointer-events: none;
  animation: drift 12s ease-in-out infinite alternate;
}

.bg-orb.one {
  top: -120px;
  left: -80px;
  background: radial-gradient(circle at 35% 35%, rgba(10, 147, 150, 0.34), rgba(10, 147, 150, 0));
}

.bg-orb.two {
  right: -120px;
  bottom: -100px;
  background: radial-gradient(circle at 45% 45%, rgba(238, 155, 0, 0.28), rgba(238, 155, 0, 0));
  animation-delay: 1.8s;
}

.site-header,
.site-footer,
.content {
  position: relative;
  z-index: 1;
  max-width: var(--page-width);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.site-header {
  border-radius: var(--radius-xl);
  margin-bottom: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: revealUp 0.6s ease-out;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  width: 40px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #123133;
  font-size: 1.02rem;
}

.site-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: #184346;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid #c9dcda;
  background: #f6fbfa;
  padding: 8px 12px;
  border-radius: 999px;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.site-nav a.active,
.site-nav a:hover {
  transform: translateY(-1px);
  color: #fff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.calculator {
  position: relative;
  z-index: 1;
  max-width: var(--page-width);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(8px);
  overflow: hidden;
  animation: revealUp 0.7s ease-out;
}

.content {
  border-radius: var(--radius-xl);
  padding: 28px;
  line-height: 1.65;
}

.site-footer {
  margin-top: 16px;
  border-radius: var(--radius-xl);
  padding: 14px 18px;
  color: var(--text-soft);
  font-size: 0.9rem;
  text-align: center;
  animation: revealUp 0.75s ease-out;
}

.site-footer a {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
}

.site-footer a:hover {
  text-decoration: underline;
}

.ad-slot {
  position: relative;
  z-index: 1;
  max-width: var(--page-width);
  margin: 14px auto;
  border: 2px dashed #9fc8c5;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #3f666a;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 10px;
  display: none;
}

.content .ad-slot {
  max-width: none;
  margin: 14px 0;
}

.ad-slot--banner {
  min-height: 96px;
}

.ad-slot--inline {
  min-height: 250px;
}

.hero {
  padding: 32px 30px 10px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.hero h1 {
  margin: 6px 0 10px;
  line-height: 1.15;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  color: #102426;
}

.hero p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.content h1 {
  margin: 0 0 8px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.content p {
  color: var(--text-soft);
  margin: 10px 0;
}

.inputs-wrap {
  padding: 24px 30px 12px;
}

.inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.input-card {
  background: linear-gradient(180deg, #ffffff, #f5fbfb);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
  animation: revealUp 0.5s ease both;
}

.input-card:nth-child(2) {
  animation-delay: 0.06s;
}

.input-card:nth-child(3) {
  animation-delay: 0.12s;
}

.input-card:nth-child(4) {
  animation-delay: 0.18s;
}

.input-card:nth-child(5) {
  animation-delay: 0.24s;
}

.input-card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(10, 147, 150, 0.8);
}

.frequency-card {
  background: linear-gradient(135deg, #ecf9f8, #fff7e9);
  border: 1px solid #b9dcd9;
}

.frequency-note {
  margin: 7px 0 0;
  font-size: 0.8rem;
  color: #355f62;
  line-height: 1.4;
}

label,
.write-form label {
  display: inline-block;
  margin-bottom: 7px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #24484b;
}

input,
select,
.write-form input,
.write-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #bfd3d1;
  padding: 10px 11px;
  font-size: 0.96rem;
  color: #0f2e31;
  background: #fff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

input,
select {
  font-weight: 600;
}

.write-form textarea {
  min-height: 140px;
  resize: vertical;
}

input:focus,
select:focus,
.write-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(10, 147, 150, 0.14);
}

.actions {
  display: flex;
  gap: 10px;
  padding: 6px 30px 30px;
  align-items: center;
  flex-wrap: wrap;
}

button,
.write-form button {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  background: linear-gradient(120deg, var(--accent-strong), var(--accent));
  color: #fff;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button {
  min-width: 210px;
}

button:hover,
.write-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 95, 115, 0.25);
  filter: saturate(1.05);
}

.write-form button {
  justify-self: start;
  padding: 10px 16px;
  font-size: 0.92rem;
}

.action-hint {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.section {
  padding: 8px 30px 30px;
  animation: revealUp 0.55s ease;
}

.section h3 {
  margin: 8px 0 14px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.44rem;
  text-align: left;
  color: #163436;
}

.summary {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 11px;
}

.summary-column {
  margin: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 10%, #f8fdfd 100%);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-column strong {
  color: #21494b;
  font-size: 0.86rem;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.summary-column span {
  font-size: 1.08rem;
  font-weight: 800;
  color: #0e2e31;
}

.summary-column:nth-child(5) span,
.summary-column:nth-child(6) span {
  color: var(--positive);
}

.table-wrapper {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

th,
td {
  border: 1px solid #d8e5e3;
  padding: 7px 6px;
  text-align: center;
  vertical-align: top;
}

th {
  background: #edf4f3;
  color: #1e4043;
  position: sticky;
  top: 0;
  z-index: 1;
}

th hr {
  margin: 2px;
  border: 0;
  border-top: 1px solid #cadad8;
}

.griding {
  display: grid;
  grid-template-columns: auto auto;
  gap: 1px 5px;
  justify-content: center;
  text-align: left;
}

.year-col {
  font-weight: 800;
  background: #eaf2f1;
  color: #153b3d;
  position: sticky;
  left: 0;
  z-index: 1;
}

.total-col {
  background: #edf9f6;
  font-weight: 700;
}

.balance-col {
  background: #fff4df;
  font-weight: 700;
}

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

.chart-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  height: 380px;
}

canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fff;
}

.card h3,
.contact-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.contact-grid {
  margin-top: 18px;
  display: none;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fff;
}

.contact-card a {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
}

.contact-card a:hover {
  text-decoration: underline;
}

.write-us {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  background: #fff;
}

.write-us h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  color: #17393c;
}

.write-us p {
  margin: 0 0 12px;
}

.write-form {
  display: grid;
  gap: 10px;
}

.form-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.form-status {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  min-height: 1.4em;
}

.form-status.is-success {
  color: #1e8a3a;
}

.form-status.is-error {
  color: #b3261e;
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(22px, -16px, 0) scale(1.07);
  }
}

@media (max-width: 1024px) {
  .summary {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    padding: 14px;
  }

  .brand-name {
    display: none;
  }

  .site-header {
    padding: 12px;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a {
    flex: 1;
    text-align: center;
  }

  .content {
    padding: 18px;
  }

  .cards,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .ad-slot--banner {
    min-height: 80px;
  }

  .ad-slot--inline {
    min-height: 180px;
  }
}

@media (max-width: 720px) {
  .hero,
  .inputs-wrap,
  .actions,
  .section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .inputs,
  .summary {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .action-hint {
    width: 100%;
  }

  .chart-card {
    height: 320px;
    padding: 10px;
  }
}

@media (max-width: 420px) {
  .chart-card {
    height: 340px;
  }
}


/* Simple Canada / USA region selector */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.region-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}

.region-picker span {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.region-picker select {
  width: auto;
  min-width: 145px;
  padding: 8px 10px;
  font-size: 0.86rem;
}

.region-note {
  display: inline-block;
  margin-top: 12px !important;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem !important;
}

@media (max-width: 760px) {
  .header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .region-picker {
    justify-content: center;
  }
}


.calculation-note {
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.summary-column span.negative-change {
  color: #b3261e;
}

.summary-column span.positive-change {
  color: var(--positive);
}
