html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  margin: 0;
  background: rgb(248 250 252);
  color: rgb(30 41 59);
}

svg {
  display: block;
}

/* Lightweight fallback for the static shell when external Tailwind CDN is unavailable. */
.hidden {
  display: none !important;
}

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

a {
  color: inherit;
  text-decoration: none;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgb(226 232 240);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
}

header nav {
  min-height: 4rem;
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
}

header nav > a:first-child,
header nav > div:last-child,
#mobile-menu-btn,
#theme-toggle {
  display: flex;
  align-items: center;
}

header nav > a:first-child {
  gap: .75rem;
  font-weight: 800;
}

header nav > a:first-child span:first-child {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: .7rem;
  background: #3b82f6;
  color: white;
}

header nav > a:first-child svg {
  width: 1.25rem;
  height: 1.25rem;
}

header nav > div:nth-child(2) {
  display: none;
}

header nav > div:nth-child(2) a {
  color: rgb(71 85 105);
  font-size: .9rem;
  font-weight: 800;
}

header nav > div:last-child {
  gap: .5rem;
}

#theme-toggle,
#mobile-menu-btn {
  justify-content: center;
  border: 1px solid rgb(226 232 240);
  border-radius: .7rem;
  background: white;
  color: rgb(51 65 85);
}

#mobile-menu {
  border-top: 1px solid rgb(226 232 240);
  background: white;
  padding: .75rem 1rem;
}

#mobile-menu a {
  display: block;
  border-radius: .7rem;
  padding: .8rem;
  font-weight: 800;
}

@media (min-width: 768px) {
  header nav > div:nth-child(2) {
    display: flex !important;
    align-items: center;
    gap: 1.75rem;
  }

  #mobile-menu-btn {
    display: none;
  }
}

#home > div:first-child,
#home > section,
#tools {
  background: white;
}

#home > div:first-child > div,
#tools > div,
#home > section > div,
footer > div {
  max-width: 80rem;
  margin: 0 auto;
  padding: 3.5rem 1rem;
}

#home > div:first-child > div {
  min-height: calc(100vh - 4rem);
  display: grid;
  align-items: center;
  gap: 3rem;
}

#home h1 {
  max-width: 56rem;
  margin: 0;
  color: rgb(15 23 42);
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1.05;
  font-weight: 800;
}

#home h2 {
  color: rgb(15 23 42);
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  line-height: 1.15;
  font-weight: 800;
}

#home p {
  color: rgb(71 85 105);
}

#home > div:first-child p {
  max-width: 46rem;
  font-size: 1.06rem;
  line-height: 1.8;
}

#home > div:first-child a[href="#tools"],
#home > div:first-child a[href="#about"],
.tool-layout + .content-panel a,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#home > div:first-child a[href="#tools"],
#home > div:first-child a[href="#about"] {
  min-height: 46px;
  margin-top: .8rem;
  margin-right: .6rem;
  border-radius: .75rem;
  padding: .8rem 1.1rem;
  font-size: .9rem;
  font-weight: 800;
}

#home > div:first-child a[href="#tools"] {
  background: #3b82f6;
  color: white;
}

#home > div:first-child a[href="#about"] {
  border: 1px solid rgb(203 213 225);
  background: white;
  color: rgb(51 65 85);
}

#home > div:first-child > div > div:last-child > div:last-child {
  border: 1px solid rgb(226 232 240);
  border-radius: 1.2rem;
  background: rgb(248 250 252);
  padding: 1rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

#home > div:first-child > div > div:last-child > div:last-child > div:first-child,
#tools .mt-10,
#home section .grid {
  display: grid;
  gap: 1rem;
}

#tools {
  border-top: 1px solid rgb(226 232 240);
  border-bottom: 1px solid rgb(226 232 240);
  background: rgb(248 250 252);
}

footer {
  border-top: 1px solid rgb(226 232 240);
  background: white;
}

footer > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
  color: rgb(100 116 139);
  font-size: .9rem;
}

@media (min-width: 640px) {
  #home > div:first-child > div,
  #tools > div,
  #home > section > div,
  footer > div,
  header nav {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  #home > div:first-child > div > div:last-child > div:last-child > div:first-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  #tools .mt-10,
  #home section .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  #home > div:first-child > div {
    grid-template-columns: 1.02fr .98fr;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  #tools .mt-10 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.fade-in {
  animation: fade-in 260ms ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tap-target {
  min-height: 44px;
  min-width: 44px;
}

.hero-tool-card,
.tool-card {
  border: 1px solid rgb(226 232 240);
  background: white;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.dark .hero-tool-card,
.dark .tool-card {
  border-color: rgb(30 41 59);
  background: rgb(15 23 42);
}

.hero-tool-card {
  min-height: 148px;
}

.hero-tool-card:hover,
.tool-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 18px 45px rgba(59, 130, 246, 0.12);
  transform: translateY(-2px);
}

.hero-tool-card strong,
.tool-card h3 {
  display: block;
  margin-top: 1rem;
  color: rgb(15 23 42);
  font-weight: 800;
}

.dark .hero-tool-card strong,
.dark .tool-card h3 {
  color: white;
}

.hero-tool-card small,
.tool-card p {
  display: block;
  margin-top: .35rem;
  color: rgb(100 116 139);
  font-size: .875rem;
  line-height: 1.55;
}

.dark .hero-tool-card small,
.dark .tool-card p {
  color: rgb(203 213 225);
}

.tool-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: .85rem;
}

.tool-icon svg {
  width: 1.45rem;
  height: 1.45rem;
}

.testimonial {
  border: 1px solid rgb(226 232 240);
  border-radius: 1rem;
  background: white;
  padding: 1.35rem;
  color: rgb(71 85 105);
  line-height: 1.7;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
}

.dark .testimonial {
  border-color: rgb(30 41 59);
  background: rgb(15 23 42);
  color: rgb(203 213 225);
}

.testimonial cite {
  display: block;
  margin-top: 1rem;
  color: rgb(30 41 59);
  font-style: normal;
  font-weight: 800;
}

.dark .testimonial cite {
  color: white;
}

.tool-page {
  max-width: 80rem;
  margin: 0 auto;
  padding: 3.5rem 1rem;
}

@media (min-width: 640px) {
  .tool-page {
    padding-inline: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .tool-page {
    padding-inline: 2rem;
  }
}

.tool-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .tool-layout {
    grid-template-columns: minmax(0, 1fr) 25rem;
    align-items: start;
  }
}

.calculator-card,
.result-card,
.content-panel {
  border: 1px solid rgb(226 232 240);
  border-radius: 1rem;
  background: white;
  padding: 1.5rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.dark .calculator-card,
.dark .result-card,
.dark .content-panel {
  border-color: rgb(30 41 59);
  background: rgb(15 23 42);
}

.tool-heading h1,
.content-panel h1 {
  color: rgb(15 23 42);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
}

.dark .tool-heading h1,
.dark .content-panel h1 {
  color: white;
}

.tool-heading p:not(.breadcrumb) {
  margin-top: .75rem;
  color: rgb(100 116 139);
  line-height: 1.7;
}

.dark .tool-heading p:not(.breadcrumb) {
  color: rgb(203 213 225);
}

.breadcrumb {
  margin-bottom: .75rem;
  color: #3b82f6;
  font-size: .82rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.5rem;
}

.field-label {
  display: block;
  margin-bottom: .45rem;
  color: rgb(30 41 59);
  font-size: .875rem;
  font-weight: 800;
}

.dark .field-label {
  color: rgb(226 232 240);
}

.input-field {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgb(203 213 225);
  border-radius: .7rem;
  background: white;
  color: rgb(15 23 42);
  padding: .72rem .9rem;
  font-size: 1rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.dark .input-field {
  border-color: rgb(51 65 85);
  background: rgb(2 6 23);
  color: white;
}

.input-field:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .16);
  outline: none;
}

.primary-btn {
  min-height: 48px;
  border-radius: .75rem;
  background: #3b82f6;
  padding: .85rem 1.1rem;
  color: white;
  font-size: .95rem;
  font-weight: 800;
  transition: background 150ms ease, transform 150ms ease;
}

.primary-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}

.segmented label,
.check-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid rgb(226 232 240);
  border-radius: .75rem;
  padding: .75rem .85rem;
  color: rgb(71 85 105);
  font-weight: 700;
}

.dark .segmented label,
.dark .check-row {
  border-color: rgb(30 41 59);
  color: rgb(203 213 225);
}

.error-text {
  min-height: 1.4rem;
  color: rgb(220 38 38);
  font-size: .9rem;
  font-weight: 700;
}

.result-card h2 {
  color: rgb(15 23 42);
  font-size: 1.35rem;
  font-weight: 800;
}

.dark .result-card h2 {
  color: white;
}

.result-number {
  margin-top: 1rem;
  color: #3b82f6;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.result-label {
  margin-top: .4rem;
  font-size: 1rem;
  font-weight: 800;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgb(226 232 240);
  padding-bottom: .75rem;
}

.dark .summary-row {
  border-color: rgb(30 41 59);
}

.summary-row dt {
  color: rgb(100 116 139);
  font-size: .9rem;
  font-weight: 700;
}

.dark .summary-row dt {
  color: rgb(203 213 225);
}

.summary-row dd {
  color: rgb(15 23 42);
  font-weight: 800;
  text-align: right;
}

.dark .summary-row dd {
  color: white;
}

.mini-stat {
  border-radius: .85rem;
  background: rgb(241 245 249);
  padding: 1rem .75rem;
  text-align: center;
}

.dark .mini-stat {
  background: rgb(2 6 23);
}

.mini-stat strong {
  display: block;
  color: #3b82f6;
  font-size: 1.8rem;
  font-weight: 800;
}

.mini-stat span {
  color: rgb(100 116 139);
  font-size: .8rem;
  font-weight: 800;
}

.dark .mini-stat span {
  color: rgb(203 213 225);
}

.content-panel {
  margin-top: 1.5rem;
  color: rgb(71 85 105);
  line-height: 1.8;
}

.dark .content-panel {
  color: rgb(203 213 225);
}

.content-panel h2 {
  margin-top: 1.5rem;
  color: rgb(15 23 42);
  font-size: 1.55rem;
  font-weight: 800;
}

.content-panel h2:first-child {
  margin-top: 0;
}

.dark .content-panel h2 {
  color: white;
}

.content-panel p {
  margin-top: .9rem;
}

.faq-item {
  margin-top: .75rem;
  border: 1px solid rgb(226 232 240);
  border-radius: .8rem;
  padding: .9rem 1rem;
}

.dark .faq-item {
  border-color: rgb(30 41 59);
}

.faq-item summary {
  cursor: pointer;
  color: rgb(15 23 42);
  font-weight: 800;
}

.dark .faq-item summary {
  color: white;
}

.faq-item p {
  margin-top: .65rem;
  font-size: .95rem;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1.5rem;
}

.share-row a,
.share-row button,
.recent-link,
.social-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(226 232 240);
  border-radius: .7rem;
  background: white;
  padding: .55rem .75rem;
  color: rgb(30 41 59);
  font-size: .8rem;
  font-weight: 800;
  transition: border-color 150ms ease, color 150ms ease;
}

.dark .share-row a,
.dark .share-row button,
.dark .recent-link,
.dark .social-link {
  border-color: rgb(30 41 59);
  background: rgb(2 6 23);
  color: rgb(226 232 240);
}

.share-row a:hover,
.share-row button:hover,
.recent-link:hover,
.social-link:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.recent-link {
  width: 100%;
  justify-content: flex-start;
  padding-inline: .9rem;
}

.legal-page {
  max-width: 64rem;
  margin: 0 auto;
  padding: 3.5rem 1rem;
}

input[type="range"] {
  width: 100%;
  accent-color: #3b82f6;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  header,
  footer,
  #scroll-top,
  .calculator-card,
  .share-row,
  .content-panel {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .page-section.hidden {
    display: none !important;
  }

  .result-card {
    border: 0;
    box-shadow: none;
  }
}
