@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Onest:wght@400;500;600;700;800;900&display=swap');

:root {
  --font-sans: "Onest", "Inter", Arial, sans-serif;
  --font-display: "Onest", "Inter", Arial, sans-serif;
  --ink: #142149;
  --muted: #64708f;
  --line: #e6eafb;
  --bg: #f8faff;
  --surface: #ffffff;
  --surface-soft: #f2f5ff;
  --blue: #4a55ea;
  --blue-dark: #26389f;
  --blue-pale: #edf0ff;
  --purple: #a774ed;
  --green: #69d0af;
  --yellow: #ffce63;
  --pink: #ff7aa9;
  --red: #ff7d72;
  --cyan: #6bcdf1;
  --navy: #0d2148;
  --shadow: 0 18px 45px rgba(39, 56, 122, .09);
  --shadow-soft: 0 10px 28px rgba(28, 45, 100, .05);
  --radius: 18px;
  --radius-sm: 12px;
  --accent: #4a55ea;
}

:root[data-theme="dark"] {
  --ink: #eef3ff;
  --muted: #a8b4d4;
  --line: #25345e;
  --bg: #081126;
  --surface: #111c37;
  --surface-soft: #172443;
  --blue: #8c96ff;
  --blue-dark: #cad0ff;
  --blue-pale: #1a2750;
  --navy: #071024;
  --shadow: 0 18px 45px rgba(0, 0, 0, .28);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, .22);
  --accent: #8c96ff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% -10%, rgba(83, 95, 238, .13), transparent 32rem),
    radial-gradient(circle at 92% 12%, rgba(105, 208, 175, .16), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body,
input,
button { font-family: inherit; }

a { color: inherit; }

button,
a,
input { transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease; }

.container {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.section-space { padding: 68px 0; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 1.2px;
  line-height: 1;
}

.brand-logo {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
}

.brand-wordmark {
  display: grid;
  grid-template-rows: auto auto;
  gap: 3px;
}

.brand-mark {
  display: none;
}

.brand-name { font-size: 20px; letter-spacing: 1.3px; }

.brand small {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .1px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.main-nav a {
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.main-nav a:hover { color: var(--blue); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.outline-button,
.primary-button,
.white-outline,
.link-button,
.filter-btn,
.tab {
  font: inherit;
  cursor: pointer;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.icon-button:hover { background: var(--blue-pale); color: var(--blue); }

.outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 10px;
  background: var(--surface);
  color: var(--blue);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.outline-button:hover {
  background: var(--blue-pale);
  border-color: var(--blue);
  transform: translateY(-1px);
}

.outline-button.small {
  padding: 8px 11px;
  font-size: 11px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), #6c76ff);
  color: #fff;
  padding: 13px 22px;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(74, 85, 234, .22);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(74, 85, 234, .28);
}

.primary-button.wide { min-width: 220px; }

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 10px;
  font-size: 12px;
  font-weight: 800;
}

.link-button:hover { color: var(--blue-dark); }

.white-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 12px;
  color: #fff;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.white-outline:hover { background: rgba(255, 255, 255, .1); }

.hero { position: relative; padding-top: 64px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(430px, 1fr);
  gap: 36px;
  align-items: center;
}

.hero h1 {
  max-width: 680px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 72px);
  line-height: .97;
  letter-spacing: -.06em;
  text-wrap: balance;
}

.hero-text {
  max-width: 580px;
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.tool-search {
  width: min(100%, 620px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.tool-search:focus-within {
  border-color: color-mix(in srgb, var(--blue) 60%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent), var(--shadow-soft);
}

.tool-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 12px 10px;
  font-size: 14px;
}

.tool-search button {
  border: 0;
  border-radius: 11px;
  background: var(--navy);
  color: #fff;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.tool-search button:hover { background: var(--blue); }

.search-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.hero-visual {
  position: relative;
  min-height: 470px;
}

.visual-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: .68;
}

.glow-1 {
  width: 280px;
  height: 280px;
  right: 74px;
  top: 18px;
  background: rgba(83, 95, 238, .18);
}

.glow-2 {
  width: 210px;
  height: 210px;
  left: 36px;
  bottom: 46px;
  background: rgba(105, 208, 175, .22);
}

.dashboard-card,
.phone-card,
.calculator-card {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.dashboard-card {
  width: min(100%, 430px);
  right: 28px;
  top: 24px;
  border-radius: 26px;
  padding: 20px;
  color: var(--blue);
  transform: rotate(-2deg);
}

.dashboard-back::after {
  content: "";
  position: absolute;
  inset: 16px -14px -14px 24px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(74, 85, 234, .12), rgba(105, 208, 175, .18));
}

.dashboard-head {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.dashboard-head span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.dashboard-row {
  display: grid;
  grid-template-columns: 1fr .75fr .55fr;
  gap: 11px;
  margin-bottom: 18px;
}

.dashboard-row i {
  height: 48px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.dashboard-chart svg { width: 100%; height: 150px; display: block; }

.phone-card {
  width: 168px;
  left: 18px;
  top: 120px;
  border-radius: 28px;
  padding: 18px 16px 20px;
}

.phone-top {
  width: 54px;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 99px;
  background: var(--line);
}

.pie-chart {
  width: 106px;
  height: 106px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 72%, var(--blue-pale) 72% 100%);
  color: var(--ink);
  font-weight: 900;
}

.pie-chart::before {
  content: "";
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--surface);
}

.pie-chart span { position: relative; }

.phone-lines i {
  display: block;
  height: 9px;
  margin-top: 8px;
  border-radius: 99px;
  background: var(--surface-soft);
}

.phone-lines i:nth-child(2) { width: 72%; }
.phone-lines i:nth-child(3) { width: 48%; }

.calculator-card {
  width: 202px;
  right: 0;
  bottom: 20px;
  border-radius: 22px;
  padding: 15px;
  transform: rotate(3deg);
}

.calculator-screen {
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  padding: 12px;
  text-align: right;
  font-weight: 900;
}

.calculator-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.calculator-keys b {
  display: grid;
  place-items: center;
  min-height: 30px;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.coin {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe19a, var(--yellow));
  box-shadow: 0 8px 18px rgba(255, 206, 99, .28);
}

.coin-a { right: 44px; top: 10px; }
.coin-b { left: 210px; bottom: 64px; width: 24px; height: 24px; }
.coin-c { right: 230px; top: 330px; width: 18px; height: 18px; }

.plant {
  position: absolute;
  right: 210px;
  bottom: 6px;
  width: 90px;
  height: 108px;
}

.plant span {
  position: absolute;
  left: 31px;
  bottom: 0;
  width: 28px;
  height: 42px;
  border-radius: 0 0 12px 12px;
  background: var(--blue-pale);
}

.plant i {
  position: absolute;
  bottom: 36px;
  width: 34px;
  height: 48px;
  border-radius: 32px 32px 4px 32px;
  background: var(--green);
  transform-origin: bottom center;
}

.plant i:nth-child(1) { left: 16px; transform: rotate(-34deg); }
.plant i:nth-child(2) { left: 38px; transform: rotate(24deg); }
.plant i:nth-child(3) { left: 25px; bottom: 52px; transform: rotate(-8deg); }
.plant i:nth-child(4) { left: 46px; bottom: 58px; transform: rotate(40deg); }

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: -16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.trust-strip > div {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.trust-strip > div:last-child { border-right: 0; }

.trust-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--blue-pale);
  color: var(--blue);
  font-weight: 900;
}

.trust-strip p { margin: 0; display: grid; line-height: 1.25; }
.trust-strip strong { font-size: 14px; }
.trust-strip small { color: var(--muted); font-size: 11px; }

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

.section-heading h2,
.tool-title-row h1,
.how-it-works h2,
.schedule-heading h2,
.article-strip h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -.04em;
  line-height: 1.1;
  text-wrap: balance;
}

.section-heading h2 { font-size: 32px; }

.text-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.text-link:hover { color: var(--blue-dark); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.tool-card {
  position: relative;
  min-height: 215px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.tool-card::after {
  content: "";
  position: absolute;
  inset: auto -28px -42px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--blue-pale);
  opacity: .72;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  box-shadow: var(--shadow);
}

.tool-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  font-weight: 900;
}

.icon-blue { background: var(--blue); }
.icon-purple { background: var(--purple); }
.icon-green { background: var(--green); }
.icon-yellow { background: var(--yellow); color: #624a09; }
.icon-indigo { background: #6978ff; }
.icon-cyan { background: var(--cyan); }
.icon-pink { background: var(--pink); }
.icon-red { background: var(--red); }

.tool-card h3 {
  margin: 18px 0 8px;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.22;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.card-arrow {
  position: relative;
  z-index: 1;
  margin-top: auto;
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
}

.dark-categories {
  border-radius: 28px;
  background:
    radial-gradient(circle at 14% 8%, rgba(105, 208, 175, .22), transparent 24rem),
    linear-gradient(135deg, #0d2148, #101a37);
  color: #fff;
  padding: 42px;
}

.dark-heading .eyebrow { color: #9fe6cb; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.category-grid a {
  min-height: 150px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 18px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  text-decoration: none;
}

.category-grid a:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, .1);
}

.category-grid span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .13);
  color: #9fe6cb;
}

.category-grid h3 { margin: 0 0 6px; font-size: 17px; }
.category-grid p { margin: 0; color: rgba(255, 255, 255, .68); font-size: 12px; }

.article-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  padding: 34px;
  box-shadow: var(--shadow-soft);
}

.article-strip h2 { font-size: 30px; }
.article-strip p:not(.eyebrow) { max-width: 670px; margin: 12px 0 0; color: var(--muted); }

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  color: var(--muted);
  font-size: 12px;
}

.footer-grid p { margin: 10px 0 0; }
.footer-grid > p { margin: 0; align-self: flex-end; }

.calculator-page { padding: 23px 0 62px; }

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
}

.breadcrumbs a { color: var(--blue); text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue-dark); }
.breadcrumbs b { color: var(--muted); font-weight: 700; }

.tool-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 25px;
  margin-bottom: 25px;
}

.tool-title-row h1 {
  max-width: 820px;
  font-size: clamp(32px, 4vw, 44px);
}

.tool-title-row p:not(.eyebrow) {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.tool-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  padding-bottom: 5px;
}

.calculator-layout,
.tool-workarea {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .96fr);
  gap: 17px;
}

.calculator-panel,
.results-panel,
.schedule-card,
.related-card,
.tool-form-panel,
.tool-results-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.calculator-panel,
.tool-form-panel { padding: 20px; }

.results-panel,
.tool-results-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 25px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.tab {
  flex: 1;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 850;
}

.tab.active {
  background: var(--surface);
  color: var(--blue);
  box-shadow: 0 6px 14px rgba(28, 45, 100, .07);
}

.field-group { margin-bottom: 20px; }

.field-group label {
  display: block;
  margin: 0 0 7px;
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
  font-size: 11px;
  font-weight: 850;
}

.input-unit {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-soft));
}

.input-unit:focus-within {
  border-color: color-mix(in srgb, var(--blue) 58%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent);
}

.input-unit input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
}

.input-unit span {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  border-left: 1px solid var(--line);
  color: var(--muted);
  padding: 0 12px;
  font-size: 11px;
  white-space: nowrap;
}

.date-input input { font-size: 12px; }

.range {
  width: 100%;
  height: 28px;
  margin: 10px 0 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: 0;
  background: transparent;
  --range-progress: 0%;
}

.range::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid color-mix(in srgb, var(--blue) 16%, var(--line));
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--blue) 0 var(--range-progress), transparent var(--range-progress) 100%),
    linear-gradient(90deg, color-mix(in srgb, var(--blue) 10%, var(--surface-soft)), var(--surface-soft));
  box-shadow: inset 0 1px 2px rgba(20, 33, 73, .06);
}

.range::-moz-range-track {
  height: 8px;
  border: 1px solid color-mix(in srgb, var(--blue) 16%, var(--line));
  border-radius: 999px;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 2px rgba(20, 33, 73, .06);
}

.range::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), #7b84ff);
}

.range::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -8px;
  appearance: none;
  -webkit-appearance: none;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #7882ff);
  box-shadow: 0 8px 18px rgba(74, 85, 234, .28), 0 0 0 1px color-mix(in srgb, var(--blue) 24%, transparent);
}

.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #7882ff);
  box-shadow: 0 8px 18px rgba(74, 85, 234, .28), 0 0 0 1px color-mix(in srgb, var(--blue) 24%, transparent);
}

.range:hover::-webkit-slider-thumb {
  transform: scale(1.08);
  box-shadow: 0 10px 22px rgba(74, 85, 234, .34), 0 0 0 1px color-mix(in srgb, var(--blue) 30%, transparent);
}

.range:hover::-moz-range-thumb {
  transform: scale(1.08);
  box-shadow: 0 10px 22px rgba(74, 85, 234, .34), 0 0 0 1px color-mix(in srgb, var(--blue) 30%, transparent);
}

.range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 8px 18px rgba(74, 85, 234, .28), 0 0 0 5px color-mix(in srgb, var(--blue) 18%, transparent);
}

.range:focus-visible::-moz-range-thumb {
  box-shadow: 0 8px 18px rgba(74, 85, 234, .28), 0 0 0 5px color-mix(in srgb, var(--blue) 18%, transparent);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.local-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.results-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.results-top h2,
.panel-label h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.02em;
}

.panel-sub { margin: 4px 0 0; color: var(--muted); font-size: 11px; }

.result-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.result-summary > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 14px;
}

.result-summary > div:last-child { grid-column: 1 / -1; }
.result-summary span,
.metrics span { display: block; color: var(--muted); font-size: 11px; }
.result-summary strong { display: block; margin-top: 6px; font-size: 24px; letter-spacing: -.03em; }
.result-summary b { display: block; margin-top: 6px; font-size: 19px; }

.summary-line {
  height: 8px;
  margin: 18px 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.metrics > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}

.metrics b { display: block; margin-top: 4px; font-size: 13px; }

.chart-card {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 12px 6px;
  overflow: hidden;
}

.chart-card h3 { margin: 0 0 8px; font-size: 14px; }

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}

.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; }
.legend-principal { background: var(--green); }
.legend-interest { background: var(--blue); }

#paymentChart { width: 100%; height: auto; display: block; }
.chart-grid line { stroke: var(--line); stroke-width: 1; }
.chart-grid text,
#chartLabels text { fill: var(--muted); font-size: 12px; }
.principal-line,
.interest-line { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.principal-line { stroke: var(--green); }
.interest-line { stroke: var(--blue); }
.principal-area { fill: color-mix(in srgb, var(--green) 18%, transparent); }
.interest-area { fill: color-mix(in srgb, var(--blue) 12%, transparent); }

.schedule-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 17px;
  margin-top: 17px;
}

.schedule-card { padding: 20px; }

.schedule-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 14px;
}

.schedule-heading h2 { font-size: 24px; }

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

table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--line); font-size: 12px; }
th:first-child, td:first-child,
th:nth-child(2), td:nth-child(2) { text-align: left; }
thead th { background: var(--surface-soft); color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
tbody tr:last-child td { border-bottom: 0; }

.related-card {
  padding: 20px;
  align-self: start;
}

.related-card h3 { margin: 0 0 12px; font-size: 17px; }

.related-card a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
}

.related-card a:last-child { border-bottom: 0; }
.related-card a:hover { color: var(--blue-dark); }

.how-it-works {
  margin-top: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.how-it-works h2 { font-size: 26px; }
.how-it-works p:not(.eyebrow) { max-width: 820px; margin: 12px 0 0; color: var(--muted); }

.calculator-panel,
.results-panel,
.tool-section,
.how-it-works,
.catalog-card,
.tool-card {
  font-variant-numeric: tabular-nums;
}

.source-note {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 13px 14px;
  font-size: 12px;
}

.source-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.source-note span { display: block; margin-top: 4px; }

.source-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.source-meta div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px;
}

.source-meta dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.source-meta dd { margin: 0; font-size: 12px; font-weight: 800; }

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

.source-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 12px;
  text-decoration: none;
}

.source-link:hover {
  border-color: color-mix(in srgb, var(--blue) 40%, var(--line));
  transform: translateY(-2px);
}

.source-link strong { font-size: 13px; }
.source-link span { color: var(--muted); font-size: 11px; }

.block-button {
  width: 100%;
  margin-top: 16px;
}

.seo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
  margin-top: 17px;
}

.tool-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.tool-section h2 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -.035em;
}

.tool-section p,
.tool-section li {
  color: var(--muted);
  font-size: 13px;
}

.tool-section p { margin: 0; }

.tool-section ul {
  margin: 0;
  padding-left: 18px;
}

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

.faq-section {
  margin-top: 17px;
}

.faq-section details {
  border-top: 1px solid var(--line);
  padding: 13px 0;
}

.faq-section details:last-child { padding-bottom: 0; }

.faq-section summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
}

.faq-section details p {
  margin-top: 8px;
  max-width: 820px;
}

#resultContent { flex: 1; min-height: 120px; }

.result-placeholder {
  display: flex;
  min-height: 166px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.result-placeholder p { margin: 0; font-size: 12px; }
.result-icon { font-size: 32px; opacity: .45; }

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.result-item:last-child { border-bottom: 0; }
.result-label { color: var(--muted); font-size: 12px; }
.result-value { color: var(--ink); font-size: 18px; font-weight: 900; text-align: right; }
.result-section-header { margin: 12px 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }

.result-item.is-text {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
}

.result-item.is-text .result-value {
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 9px;
}

.filter-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
}

.filter-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.filter-btn:hover:not(.active) { background: var(--blue-pale); border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); }

.catalog-count {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.tool-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.catalog-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 16px;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.catalog-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  box-shadow: var(--shadow);
}

.catalog-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.catalog-card h3, .catalog-card-title { margin: 0; font-size: 14px; line-height: 1.3; }
.catalog-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.catalog-category { color: var(--muted); font-size: 10px; font-weight: 800; }
.catalog-badge { border-radius: 8px; background: var(--blue-pale); color: var(--blue); padding: 4px 8px; font-size: 9px; font-weight: 900; white-space: nowrap; }

.tool-page { padding: 16px 0 60px; }
.tool-header { margin-bottom: 24px; }
.tool-header-info h1 { margin: 0 0 9px; font-size: 34px; letter-spacing: -.045em; line-height: 1.08; }
.tool-header-info > p { max-width: 690px; margin: 0; color: var(--muted); font-size: 14px; }
.tool-badges { display: flex; gap: 6px; margin-bottom: 11px; }
.tag { display: inline-block; border-radius: 7px; background: var(--blue-pale); color: var(--blue); padding: 4px 8px; font-size: 9px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }

.print-header { display: none; }

@media print {
  body { background: #fff; color: #111; }
  .print-header { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid #edf0f7; margin-bottom: 20px; font-size: 12px; color: #71809c; }
  .print-header strong { font-size: 14px; }
  .site-header,
  .tool-actions,
  .theme-toggle,
  .icon-button,
  .form-actions,
  #printPdf,
  .outline-button { display: none !important; }
  .calculator-layout { grid-template-columns: 1fr; }
  .calculator-panel,
  .results-panel,
  .schedule-card,
  .how-it-works { box-shadow: none; }
}

@media (max-width: 1020px) {
  .main-nav { gap: 16px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 620px; margin: 0 auto; }
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); row-gap: 23px; }
  .calculator-layout,
  .tool-workarea,
  .schedule-section { grid-template-columns: 1fr; }
  .related-card { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 20px; }
  .related-card h3 { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 30px, 1180px); }
  .nav-wrap { min-height: 70px; }
  .header-actions .outline-button:not(.theme-toggle) { display: none; }
  .hero { padding-top: 34px; }
  .hero-grid { gap: 0; }
  .hero h1,
  .tool-title-row h1 { font-size: 34px; }
  .hero-text { font-size: 15px; }
  .hero-visual { min-height: 310px; margin-top: 15px; transform: scale(.9); transform-origin: top center; }
  .dashboard-card { right: 8px; }
  .trust-strip { grid-template-columns: repeat(2, 1fr); margin-top: -4px; }
  .trust-strip > div { border-bottom: 1px solid var(--line); padding: 14px 13px; }
  .trust-strip > div:nth-child(2) { border-right: 0; }
  .section-space { padding: 42px 0; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 25px; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tool-card { min-height: 190px; padding: 15px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .dark-categories { padding: 27px 18px; border-radius: 22px; }
  .article-strip,
  .tool-title-row,
  .footer-grid { align-items: flex-start; flex-direction: column; }
  .article-strip { gap: 18px; padding: 24px; }
  .tool-actions { padding-bottom: 0; flex-wrap: wrap; }
  .calculator-page { padding-top: 18px; }
  .calculator-layout { gap: 14px; }
  .result-summary { grid-template-columns: 1fr 1fr; }
  .result-summary > div:last-child { grid-column: auto; }
  .metrics,
  .source-meta { grid-template-columns: 1fr 1fr; }
  .seo-grid { grid-template-columns: 1fr; }
  .calculator-panel,
  .results-panel,
  .schedule-card,
  .related-card { border-radius: 14px; }
  .related-card { display: block; }
  .form-actions { gap: 9px; }
  .primary-button.wide { min-width: 0; flex: 1; }
  .footer-grid { gap: 16px; }
  .footer-grid > p { font-size: 11px; }
}

@media (max-width: 520px) {
  .tool-search { align-items: stretch; flex-direction: column; }
  .tool-search input { width: 100%; }
  .tool-search button { width: 100%; }
  .tabs { flex-direction: column; }
  .source-meta { grid-template-columns: 1fr; }
  .source-links { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .hero h1,
  .tool-title-row h1 { font-size: 30px; }
  .hero-text { font-size: 14px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 160px; }
  .trust-strip { grid-template-columns: 1fr; }
  .trust-strip > div { border-right: 0; }
  .dashboard-card { transform: scale(.82) rotate(-2deg); transform-origin: right top; }
  .phone-card { left: 0; }
  .calculator-card { right: -17px; }
  .plant { right: 135px; }
  .tool-actions .outline-button { padding: 8px; font-size: 10px; }
  .result-summary { grid-template-columns: 1fr; }
  .result-summary strong { font-size: 18px; }
  .metrics { grid-template-columns: 1fr; }
  .chart-card { padding: 12px 7px 4px; }
  .tool-catalog-grid { grid-template-columns: 1fr; }
  .catalog-card { padding: 12px; }
}

/* Premium UI layer */
:root {
  --ink: #07113f;
  --muted: #596387;
  --line: #dfe6f6;
  --bg: #f7f9fe;
  --surface: #ffffff;
  --surface-soft: #f5f7ff;
  --blue: #335cff;
  --blue-dark: #142bc2;
  --blue-pale: #eef3ff;
  --purple: #8d5cff;
  --green: #63d4aa;
  --navy: #07113f;
  --shadow: 0 26px 70px rgba(30, 45, 96, .11);
  --shadow-soft: 0 16px 44px rgba(30, 45, 96, .075);
  --radius: 24px;
  --radius-sm: 16px;
}

:root[data-theme="dark"] {
  --ink: #f3f6ff;
  --muted: #aab7da;
  --line: #2a3862;
  --bg: #070d20;
  --surface: #101a34;
  --surface-soft: #17223f;
  --blue: #8ba0ff;
  --blue-dark: #dbe2ff;
  --blue-pale: #1a2850;
  --navy: #f5f7ff;
}

body {
  background:
    radial-gradient(circle at 12% -14%, rgba(51, 92, 255, .18), transparent 34rem),
    radial-gradient(circle at 92% 6%, rgba(99, 212, 170, .15), transparent 31rem),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 92%, #fff), var(--bg));
  font-size: 16px;
}

.container { width: min(1220px, calc(100% - 56px)); }

.site-header {
  border-bottom-color: color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  box-shadow: 0 10px 34px rgba(19, 31, 76, .045);
}

.nav-wrap { min-height: 78px; }

.brand { letter-spacing: 1px; }
.brand-mark { font-size: 29px; }
.brand-name { font-size: 22px; letter-spacing: 1.3px; }
.brand small { color: color-mix(in srgb, var(--muted) 88%, var(--blue)); font-size: 9px; }

.main-nav a {
  position: relative;
  padding: 10px 0;
  font-size: 13px;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 2px;
  border-radius: 99px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s ease;
}

.main-nav a:hover::after { transform: scaleX(1); }

.icon-button,
.outline-button,
.primary-button,
.link-button,
.filter-btn,
.tab,
.tool-search button {
  border-radius: 14px;
}

.icon-button {
  background: color-mix(in srgb, var(--surface) 74%, var(--surface-soft));
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  font-size: 22px;
}

.outline-button {
  min-height: 42px;
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface-soft) 55%, var(--surface)));
  box-shadow: 0 8px 22px rgba(30, 45, 96, .055);
}

.primary-button {
  min-height: 46px;
  background: linear-gradient(135deg, #234cff 0%, #586dff 50%, #7c4dff 100%);
  box-shadow: 0 16px 34px rgba(51, 92, 255, .28);
}

.primary-button:hover { box-shadow: 0 20px 42px rgba(51, 92, 255, .34); }

.hero h1,
.tool-title-row h1,
.section-heading h2,
.how-it-works h2,
.tool-section h2,
.schedule-heading h2,
.article-strip h2 {
  letter-spacing: -.055em;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(44px, 6.2vw, 78px);
}

.hero-text { color: color-mix(in srgb, var(--muted) 92%, var(--ink)); }

.tool-search,
.calculator-panel,
.results-panel,
.schedule-card,
.related-card,
.tool-form-panel,
.tool-results-panel,
.how-it-works,
.tool-section,
.article-strip,
.catalog-card,
.tool-card {
  border-color: color-mix(in srgb, var(--line) 86%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 98%, #fff), color-mix(in srgb, var(--surface-soft) 30%, var(--surface))),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.tool-card,
.catalog-card,
.calculator-panel,
.results-panel,
.schedule-card,
.related-card,
.tool-section,
.how-it-works { border-radius: var(--radius); }

.tool-card::after {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, color-mix(in srgb, var(--blue) 18%, transparent), transparent 68%);
}

.tool-card:hover,
.catalog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.catalog-card {
  position: relative;
  min-height: 150px;
  padding: 18px;
  overflow: hidden;
}

.catalog-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -56px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  pointer-events: none;
}

.catalog-card h3,
.catalog-card-title {
  position: relative;
  z-index: 1;
  font-size: 16px;
  letter-spacing: -.025em;
}

.catalog-card p,
.catalog-category,
.catalog-badge { position: relative; z-index: 1; }

.calculator-page { padding: 30px 0 74px; }

.breadcrumbs {
  margin-bottom: 22px;
  font-size: 12px;
}

.tool-title-row {
  align-items: flex-start;
  margin-bottom: 28px;
}

.tool-title-row h1 {
  max-width: 920px;
  font-size: clamp(38px, 4.4vw, 56px);
}

.tool-title-row p:not(.eyebrow) {
  max-width: 820px;
  color: color-mix(in srgb, var(--muted) 92%, var(--ink));
  font-size: 17px;
}

.calculator-layout,
.tool-workarea {
  grid-template-columns: minmax(0, .94fr) minmax(420px, 1fr);
  gap: 22px;
  align-items: start;
}

.calculator-panel,
.tool-form-panel,
.results-panel,
.tool-results-panel { padding: 24px; }

.calculator-panel {
  position: relative;
  overflow: hidden;
}

.calculator-panel::before,
.results-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--purple), var(--green));
  opacity: .85;
}

.results-panel { position: relative; overflow: hidden; }

@media (min-width: 1021px) {
  .results-panel { position: sticky; top: 102px; }
}

.tabs {
  gap: 8px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 18px;
}

.tab { min-height: 42px; }
.tab.active { box-shadow: 0 10px 24px rgba(30, 45, 96, .09); }

.field-group { margin-bottom: 22px; }

.field-group label {
  margin-bottom: 9px;
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
  font-size: 12px;
  letter-spacing: .01em;
}

.input-unit {
  min-height: 52px;
  border-color: color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 80%, var(--surface-soft));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}

.input-unit input {
  padding: 14px 15px;
  font-size: 16px;
  font-weight: 800;
}

.input-unit span {
  padding: 0 15px;
  font-size: 12px;
  font-weight: 750;
}

.range { height: 34px; margin-top: 12px; }
.range::-webkit-slider-runnable-track { height: 10px; }
.range::-moz-range-track,
.range::-moz-range-progress { height: 10px; }
.range::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -8px; }
.range::-moz-range-thumb { width: 16px; height: 16px; }

.results-top {
  align-items: flex-start;
  margin-bottom: 20px;
}

.results-top h2,
.panel-label h2 {
  font-size: 22px;
  letter-spacing: -.035em;
}

#resultContent {
  display: grid;
  gap: 10px;
  min-height: 136px;
}

.result-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 15px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-soft) 62%, var(--surface));
}

.result-item:last-child { border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }

.result-label {
  font-size: 12px;
  font-weight: 700;
}

.result-value {
  color: var(--blue);
  font-size: 21px;
  letter-spacing: -.035em;
}

.result-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result-summary > div,
.metrics > div,
.source-meta div {
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface-soft) 62%, var(--surface));
}

.result-summary > div {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 18px;
  padding: 18px;
}

.result-summary strong,
.result-summary b {
  color: var(--blue);
  font-size: clamp(22px, 2.3vw, 30px);
}

.metrics { gap: 10px; }
.metrics > div { border-radius: 15px; padding: 13px; }
.metrics b { font-size: 14px; }

.chart-card,
.table-wrap {
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 80%, var(--surface-soft));
}

.source-note {
  border-color: color-mix(in srgb, var(--blue) 16%, var(--line));
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue-pale) 72%, var(--surface)), color-mix(in srgb, var(--surface) 78%, var(--purple) 4%));
}

.source-meta div,
.source-link { border-radius: 16px; }

.form-actions { margin-top: 30px; }
.local-note { font-size: 12px; line-height: 1.55; }

.result-export-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.print-report { display: none; }

.print-report {
  --print-ink: #07113f;
  --print-muted: #4f5a7c;
  --print-line: #d9e1f2;
  --print-blue: #335cff;
  --print-soft: #f6f8ff;
  background: #fff;
  color: var(--print-ink);
  font-family: "Onest", "Inter", Arial, sans-serif;
}

.print-report * { box-sizing: border-box; }

.print-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--print-ink);
  font-weight: 900;
  letter-spacing: 1.2px;
  line-height: 1;
}

.print-brand-logo { width: 32px; height: 32px; border-radius: 8px; }
.print-brand-mark { display: none; }
.print-brand-name { font-size: 23px; letter-spacing: 1.3px; }
.print-brand small { color: var(--print-muted); font-size: 9px; font-weight: 700; letter-spacing: .05px; }

.print-divider { height: 1px; margin: 18px 0 28px; background: var(--print-line); }
.print-report h1 { margin: 0 0 22px; font-size: 34px; line-height: 1.08; letter-spacing: -.045em; }
.print-report h2 { margin: 24px 0 12px; font-size: 18px; line-height: 1.15; letter-spacing: -.025em; }

.print-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.print-meta-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.print-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--print-line);
  border-radius: 10px;
  background: #fff;
  color: var(--print-blue);
  font-weight: 900;
}

.print-meta-label { display: block; color: var(--print-muted); font-size: 12px; }
.print-meta-value { display: block; margin-top: 3px; font-size: 14px; font-weight: 850; }

.print-box {
  border: 1px solid var(--print-line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.print-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(130px, auto);
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px dashed var(--print-line);
}

.print-row:last-child { border-bottom: 0; }
.print-row .print-icon { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
.print-row-label { color: var(--print-muted); font-size: 13px; }
.print-row-value { text-align: right; font-size: 14px; font-weight: 850; }

.print-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.print-section-header {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
  color: var(--print-blue);
  margin: 4px 0 0;
  padding: 8px 0 2px;
  border-bottom: 1px solid var(--print-line);
}

.print-result-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--print-line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  min-height: 0;
}

.print-result-card .print-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0f3ff, #f7f4ff);
  border: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.print-result-label { display: block; color: var(--print-muted); font-size: 10px; line-height: 1.2; }
.print-result-value { display: block; margin-top: 3px; color: var(--print-blue); font-size: 16px; font-weight: 900; letter-spacing: -.02em; word-break: break-word; }

.print-chart {
  border: 1px solid var(--print-line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  overflow: hidden;
}

.print-chart svg { width: 100%; height: 190px; display: block; }

.print-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  border: 1px solid var(--print-line);
  border-radius: 14px;
  overflow: hidden;
}

.print-table th,
.print-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--print-line);
  color: var(--print-ink);
  font-size: 11px;
  text-align: right;
}

.print-table th {
  background: var(--print-soft);
  color: var(--print-muted);
  font-weight: 750;
  text-transform: none;
  letter-spacing: 0;
}

.print-table th:first-child,
.print-table td:first-child,
.print-table th:nth-child(2),
.print-table td:nth-child(2) { text-align: left; }

.print-table tr:last-child td { border-bottom: 0; }

.print-disclaimer {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0f3ff, #f8f6ff);
  padding: 16px 20px;
  color: var(--print-muted);
  font-size: 11px;
}

.print-disclaimer .print-icon { border-radius: 50%; background: #fff; font-size: 18px; }
.print-disclaimer strong { display: block; margin-bottom: 4px; color: var(--print-ink); font-size: 12px; }

.print-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--print-line);
  color: var(--print-muted);
  font-size: 12px;
}

.print-footer-site { color: var(--print-blue); font-weight: 800; }

@media (max-width: 1020px) {
  .results-panel { position: relative; top: auto; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 28px, 1220px); }
  body { font-size: 15px; }
  .nav-wrap { min-height: 66px; }
  .brand-mark { font-size: 25px; }
  .brand-name { font-size: 19px; }
  .brand small { font-size: 8px; }
  .hero h1,
  .tool-title-row h1 { font-size: clamp(32px, 10.5vw, 42px); }
  .tool-title-row p:not(.eyebrow) { font-size: 15px; line-height: 1.55; }
  .tool-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .tool-actions .outline-button { width: 100%; }
  .calculator-panel,
  .tool-form-panel,
  .results-panel,
  .tool-results-panel,
  .schedule-card,
  .related-card,
  .tool-section,
  .how-it-works { padding: 18px; border-radius: 20px; }
  .input-unit { min-height: 50px; }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .form-actions .primary-button { grid-column: 1 / -1; width: 100%; }
  .form-actions .outline-button,
  .form-actions .link-button { width: 100%; justify-content: center; }
  .result-summary,
  .metrics { grid-template-columns: 1fr; }
  .result-summary > div { min-height: auto; }
  .result-item { grid-template-columns: 1fr; gap: 5px; }
  .result-value { text-align: left; font-size: 20px; }
  .results-top { flex-direction: column; }
  .result-export-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .result-export-actions .outline-button { width: 100%; }
  .tool-catalog-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .container { width: min(100% - 22px, 1220px); }
  .calculator-page { padding-top: 16px; }
  .breadcrumbs { font-size: 11px; }
  .tool-title-row { gap: 18px; margin-bottom: 20px; }
  .tool-actions { grid-template-columns: 1fr; }
  .tabs { grid-template-columns: 1fr; }
  .source-meta { grid-template-columns: 1fr; }
  .schedule-heading { align-items: flex-start; flex-direction: column; }
  .schedule-heading .outline-button { width: 100%; }
  .table-wrap { margin-inline: -2px; }
}

@media print {
  @page { size: A4; margin: 10mm; }

  html,
  body {
    width: auto;
    min-height: 0;
    background: #fff !important;
  }

  body > :not(.print-report) { display: none !important; }

  .print-report {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    font-size: 12px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-report h1,
  .print-report h2,
  .print-box,
  .print-result-grid,
  .print-chart,
  .print-table,
  .print-disclaimer { break-inside: avoid; page-break-inside: avoid; }

  .print-result-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* Responsive hardening */
html,
body { max-width: 100%; overflow-x: hidden; }

svg,
img { max-width: 100%; }

.calculator-panel,
.results-panel,
.schedule-card,
.related-card,
.tool-section,
.how-it-works,
.catalog-card,
.tool-card { min-width: 0; }

.input-unit,
.tool-search,
.table-wrap { min-width: 0; }

@media (max-width: 1180px) {
  .container { width: min(100% - 40px, 1220px); }
  .main-nav { gap: 18px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr); }
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-catalog-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 900px) {
  .container { width: min(100% - 32px, 1220px); }
  .hero { padding-top: 42px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-visual {
    min-height: 360px;
    width: min(100%, 560px);
    overflow: hidden;
  }
  .dashboard-card { right: 18px; width: min(100% - 36px, 430px); }
  .phone-card { left: 6px; }
  .calculator-card { right: 10px; }
  .trust-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-strip > div:nth-child(2n) { border-right: 0; }
  .trust-strip > div { border-bottom: 1px solid var(--line); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-strip { align-items: flex-start; flex-direction: column; }
  .seo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-header { position: sticky; }
  .nav-wrap { gap: 12px; }
  .header-actions { margin-left: auto; }
  .icon-button,
  .theme-toggle { width: 40px; min-width: 40px; height: 40px; padding: 0; }
  .theme-toggle { font-size: 0; }
  .theme-toggle::before { content: attr(aria-label); font-size: 0; }
  .theme-toggle::after { content: "☾"; font-size: 18px; }
  :root[data-theme="dark"] .theme-toggle::after { content: "☀"; }
  .section-heading { flex-direction: column; align-items: flex-start; }
  .section-heading .text-link { width: 100%; }
  .hero-visual {
    min-height: 0;
    margin-top: 10px;
    transform: none;
  }
  .visual-glow,
  .coin,
  .plant,
  .phone-card,
  .calculator-card { display: none; }
  .dashboard-card {
    position: relative;
    inset: auto;
    width: 100%;
    transform: none;
    border-radius: 22px;
  }
  .dashboard-back::after { inset: 12px 10px -10px; }
  .tool-search { padding: 7px; border-radius: 18px; }
  .tool-search input { min-height: 46px; font-size: 16px; }
  .tool-search button { min-height: 46px; }
  .trust-strip { grid-template-columns: 1fr; }
  .trust-strip > div { border-right: 0; }
  .tool-grid,
  .category-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; }
  .category-grid a { min-height: 128px; }
  .calculator-panel,
  .results-panel,
  .schedule-card,
  .related-card,
  .how-it-works,
  .seo-grid,
  .tool-section { margin-top: 14px; }
  .tabs { display: grid; grid-template-columns: 1fr; }
  .primary-button,
  .outline-button,
  .link-button,
  .filter-btn,
  .tab { min-height: 46px; }
  .source-note { line-height: 1.55; }
  .source-meta { grid-template-columns: 1fr; }
  .source-links { grid-template-columns: 1fr; }
  .related-card a { padding: 13px 0; }
  .catalog-card { min-height: 0; }
  .catalog-card h3,
  .catalog-card-title { font-size: 15px; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 22px, 1220px); }
  .site-header { backdrop-filter: blur(12px); }
  .nav-wrap { min-height: 62px; }
  .brand { max-width: 170px; }
  .brand-mark { font-size: 23px; }
  .brand-name { font-size: 18px; }
  .brand small { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .calculator-page { padding-bottom: 46px; }
  .breadcrumbs { gap: 6px; line-height: 1.4; }
  .tool-title-row { display: block; }
  .tool-title-row h1 { margin-top: 4px; line-height: 1.04; }
  .tool-actions { margin-top: 16px; }
  .calculator-panel,
  .tool-form-panel,
  .results-panel,
  .tool-results-panel,
  .schedule-card,
  .related-card,
  .tool-section,
  .how-it-works,
  .article-strip { padding: 16px; }
  .field-group { margin-bottom: 18px; }
  .input-unit { border-radius: 14px; }
  .input-unit input { width: 100%; min-width: 0; font-size: 16px; }
  .input-unit span { max-width: 42%; padding: 0 11px; overflow: hidden; text-overflow: ellipsis; }
  .range { margin-top: 9px; }
  .form-actions { grid-template-columns: 1fr; }
  .result-export-actions { grid-template-columns: 1fr; }
  .results-top h2,
  .panel-label h2 { font-size: 20px; }
  .result-summary strong,
  .result-summary b { font-size: 22px; }
  .chart-card { margin-inline: -2px; padding: 12px 8px 6px; }
  #paymentChart { min-width: 520px; }
  .chart-card { overflow-x: auto; }
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { min-width: 640px; }
  th,
  td { padding: 10px; }
  .filter-row {
    flex-wrap: nowrap;
    margin-inline: -11px;
    padding: 0 11px 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .filter-btn { flex: 0 0 auto; }
}

@media (max-width: 380px) {
  .container { width: min(100% - 18px, 1220px); }
  .brand { max-width: 142px; }
  .brand-name { font-size: 16px; }
  .brand small { max-width: 126px; }
  .hero h1,
  .tool-title-row h1 { font-size: 29px; }
  .calculator-panel,
  .results-panel,
  .schedule-card,
  .related-card,
  .tool-section,
  .how-it-works { padding: 14px; }
  .input-unit span { display: none; }
  .source-note,
  .source-meta dd,
  .tool-section p,
  .tool-section li { font-size: 12px; }
}

/* Final adaptive and theme pass */
:root {
  color-scheme: light;
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 250, 255, .92));
  --control-bg: #ffffff;
  --control-text: #07113f;
  --glow-blue: rgba(51, 92, 255, .18);
  --glow-green: rgba(99, 212, 170, .15);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f7ff;
  --muted: #aeb9d8;
  --line: #2b3d70;
  --bg: #070b18;
  --surface: #0f1830;
  --surface-soft: #141f3a;
  --blue: #91a4ff;
  --blue-dark: #d7defe;
  --blue-pale: #1c2b56;
  --purple: #b795ff;
  --green: #66d7b0;
  --navy: #f5f7ff;
  --shadow: 0 28px 74px rgba(0, 0, 0, .38);
  --shadow-soft: 0 18px 46px rgba(0, 0, 0, .28);
  --card-bg: linear-gradient(180deg, rgba(18, 29, 56, .98), rgba(12, 20, 42, .98));
  --control-bg: #0b142b;
  --control-text: #f5f7ff;
  --glow-blue: rgba(90, 122, 255, .22);
  --glow-green: rgba(98, 215, 176, .12);
}

body {
  font-family: "Onest", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-feature-settings: "tnum" 1, "cv03" 1, "cv04" 1;
  font-optical-sizing: auto;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 14% -12%, var(--glow-blue), transparent 34rem),
    radial-gradient(circle at 88% 8%, var(--glow-green), transparent 28rem),
    linear-gradient(180deg, #080e1f 0%, #060914 100%);
}

:root[data-theme="dark"] .site-header {
  background: rgba(9, 15, 32, .86);
  border-bottom-color: rgba(89, 111, 171, .32);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
}

:root[data-theme="dark"] .tool-search,
:root[data-theme="dark"] .calculator-panel,
:root[data-theme="dark"] .results-panel,
:root[data-theme="dark"] .schedule-card,
:root[data-theme="dark"] .related-card,
:root[data-theme="dark"] .tool-form-panel,
:root[data-theme="dark"] .tool-results-panel,
:root[data-theme="dark"] .how-it-works,
:root[data-theme="dark"] .tool-section,
:root[data-theme="dark"] .article-strip,
:root[data-theme="dark"] .catalog-card,
:root[data-theme="dark"] .tool-card,
:root[data-theme="dark"] .dark-categories,
:root[data-theme="dark"] .trust-strip {
  border-color: rgba(104, 124, 184, .34);
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
}

:root[data-theme="dark"] .input-unit,
:root[data-theme="dark"] .tabs,
:root[data-theme="dark"] .result-summary > div,
:root[data-theme="dark"] .metrics > div,
:root[data-theme="dark"] .result-item,
:root[data-theme="dark"] .source-meta div,
:root[data-theme="dark"] .source-link,
:root[data-theme="dark"] .chart-card,
:root[data-theme="dark"] .table-wrap,
:root[data-theme="dark"] .filter-btn {
  border-color: rgba(104, 124, 184, .32);
  background: rgba(10, 18, 38, .78);
  color: var(--ink);
}

:root[data-theme="dark"] .result-value {
  color: var(--blue);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] button,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  color: var(--control-text);
}

:root[data-theme="dark"] .outline-button,
:root[data-theme="dark"] .icon-button {
  border-color: rgba(145, 164, 255, .38);
  background: linear-gradient(180deg, rgba(29, 42, 78, .92), rgba(14, 24, 50, .92));
  color: #dce3ff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
}

:root[data-theme="dark"] .outline-button:hover,
:root[data-theme="dark"] .icon-button:hover {
  border-color: rgba(145, 164, 255, .7);
  background: rgba(35, 52, 98, .95);
}

:root[data-theme="dark"] .primary-button {
  background: linear-gradient(135deg, #546dff 0%, #8a70ff 54%, #54c7a8 100%);
  box-shadow: 0 18px 40px rgba(84, 109, 255, .3);
}

:root[data-theme="dark"] .source-note {
  border-color: rgba(145, 164, 255, .24);
  background: linear-gradient(135deg, rgba(31, 48, 93, .88), rgba(18, 28, 55, .88));
}

:root[data-theme="dark"] thead th { background: rgba(24, 36, 68, .95); }
:root[data-theme="dark"] tbody tr:hover td { background: rgba(145, 164, 255, .05); }
:root[data-theme="dark"] .chart-grid line { stroke: rgba(159, 174, 220, .24); }
:root[data-theme="dark"] .brand small { color: #aeb9d8; }

.theme-toggle {
  min-width: 112px;
  padding-inline: 14px;
}

.theme-toggle::after { content: none; }

.tool-title-row h1,
.hero h1,
.section-heading h2,
.schedule-heading h2,
.how-it-works h2,
.tool-section h2 {
  font-weight: 850;
}

.tool-title-row p:not(.eyebrow),
.hero-text,
.tool-section p,
.tool-section li,
.catalog-card p,
.tool-card p {
  font-weight: 450;
}

@media (max-width: 760px) {
  .container { width: min(100% - 24px, 1220px); }

  .nav-wrap {
    min-height: 0;
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 11px 0 10px;
  }

  .brand {
    max-width: calc(100% - 154px);
  }

  .header-actions {
    margin-left: auto;
    gap: 8px;
  }

  .icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .theme-toggle {
    width: auto;
    min-width: 94px;
    height: 40px;
    padding: 0 11px;
    font-size: 12px;
  }

  .theme-toggle::before,
  .theme-toggle::after { content: none; }

  .main-nav {
    order: 3;
    display: flex;
    width: 100%;
    gap: 8px;
    margin: 0;
    padding: 1px 0 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar { display: none; }

  .main-nav a {
    flex: 0 0 auto;
    border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 78%, var(--surface-soft));
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1;
  }

  .main-nav a::after { display: none; }

  .hero {
    padding-top: 28px;
  }

  .hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .hero h1,
  .tool-title-row h1 {
    font-size: clamp(31px, 9vw, 42px);
    letter-spacing: -.045em;
  }

  .hero-text,
  .tool-title-row p:not(.eyebrow) {
    font-size: 15px;
    line-height: 1.6;
  }

  .hero-visual {
    width: 100%;
    min-height: 0;
    margin: 0;
    transform: none;
    overflow: visible;
  }

  .dashboard-card {
    position: relative;
    inset: auto;
    width: 100%;
    transform: none;
  }

  .phone-card,
  .calculator-card,
  .coin,
  .plant,
  .visual-glow { display: none; }

  .tool-title-row {
    display: grid;
    gap: 16px;
  }

  .tool-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 9px;
  }

  .tool-actions .outline-button { width: 100%; }

  .calculator-layout,
  .tool-workarea,
  .schedule-section,
  .seo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .calculator-panel,
  .results-panel,
  .schedule-card,
  .related-card,
  .tool-section,
  .how-it-works,
  .article-strip {
    margin-top: 0;
    padding: 18px;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .primary-button.wide,
  .form-actions .primary-button,
  .form-actions .outline-button,
  .form-actions .link-button {
    width: 100%;
    min-width: 0;
  }

  .results-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .result-export-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .result-summary,
  .metrics,
  .source-meta {
    grid-template-columns: 1fr;
  }

  .result-item {
    grid-template-columns: 1fr;
  }

  .result-value { text-align: left; }

  #paymentChart {
    min-width: 0;
    width: 100%;
  }

  .chart-mini {
    padding: 10px;
    overflow: hidden;
  }

  .chart-mini-legend {
    gap: 10px;
    font-size: 11px;
  }

  .print-schedule {
    font-size: 9px;
  }

  .print-schedule th,
  .print-schedule td {
    padding: 3px 4px;
  }

  .tool-catalog-grid,
  .tool-grid,
  .category-grid,
  .trust-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .container { width: min(100% - 20px, 1220px); }

  .brand {
    max-width: calc(100% - 100px);
  }

  .theme-toggle {
    width: 40px;
    min-width: 40px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .theme-toggle::after {
    content: "☾";
    font-size: 18px;
  }

  :root[data-theme="dark"] .theme-toggle::after { content: "☀"; }

  .tool-actions,
  .result-export-actions {
    grid-template-columns: 1fr;
  }

  .calculator-panel,
  .results-panel,
  .schedule-card,
  .related-card,
  .tool-section,
  .how-it-works,
  .article-strip {
    padding: 16px;
    border-radius: 18px;
  }

  .input-unit span {
    max-width: 48%;
    white-space: nowrap;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table { min-width: 620px; }
}

.chart-mini {
  margin-top: 16px;
  padding: 12px;
  background: var(--surface-soft);
  border-radius: 12px;
}

.chart-mini-bar {
  display: flex;
  height: 28px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--line);
}

.chart-bar-principal {
  background: var(--blue);
  transition: width 0.3s;
  min-width: 2px;
}

.chart-bar-interest {
  background: #e74c3c;
  transition: width 0.3s;
  min-width: 2px;
}

.chart-mini-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

.chart-mini-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.legend-principal { background: var(--blue); }
.legend-interest { background: #e74c3c; }

.print-schedule {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 11px;
}

.print-schedule th,
.print-schedule td {
  padding: 4px 6px;
  text-align: right;
  border-bottom: 1px solid #ddd;
}

.print-schedule th {
  text-align: right;
  font-weight: 600;
  background: #f5f5f5;
}
