:root {
  --bg: #f3f7ff;
  --bg-strong: #eaf2ff;
  --panel: #ffffff;
  --panel-alt: #f8fbff;
  --surface: #edf4ff;
  --surface-strong: #dfeaff;
  --text: #101828;
  --muted: #52607a;
  --muted-soft: #7787a5;
  --primary: #1f5ae5;
  --primary-dark: #113bb3;
  --primary-soft: rgba(31, 90, 229, 0.12);
  --accent: #0ea5e9;
  --success: #14b87b;
  --warning: #f59e0b;
  --line: rgba(15, 23, 42, 0.08);
  --shadow: 0 28px 60px rgba(15, 23, 42, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: min(1180px, calc(100% - 2rem));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: linear-gradient(180deg, #edf5ff 0%, #f8fbff 40%, #f3f6ff 100%);
  color: var(--text);
  line-height: 1.6;
}

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

img {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(248, 251, 255, 0.8);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand img {
  width: 40px;
  height: 40px;
}

.brand span {
  font-size: 1.1rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--muted);
  font-size: 0.96rem;
}

.main-nav a {
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--primary);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  box-shadow: 0 18px 35px rgba(31, 90, 229, 0.28);
}

.button-secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  color: var(--text);
}

.button-small {
  padding: 0.72rem 1.2rem;
  font-size: 0.92rem;
}

.button-block {
  width: 100%;
  margin-top: 1.2rem;
}

.hero-section {
  padding: 4.5rem 0 2.25rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.06fr 1fr;
  align-items: center;
  gap: 2.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow.dark {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.hero-copy h1 {
  margin: 1rem 0 0.75rem;
  font-size: clamp(2.5rem, 5vw, 4.3rem);
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.hero-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.8rem;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin: 1.8rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-highlights li::before {
  content: "•";
  color: var(--success);
  margin-right: 0.5rem;
}

.hero-panel {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.muted-label {
  margin: 0;
  color: var(--muted-soft);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-header h2 {
  margin: 0.25rem 0 0;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.65rem;
  border-radius: 999px;
  background: rgba(20, 184, 123, 0.12);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 700;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-shell:focus-within {
  border-color: rgba(31, 90, 229, 0.4);
  box-shadow: 0 0 0 4px rgba(31, 90, 229, 0.1);
}

.input-shell input,
.field select {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  height: 100%;
  padding: 0.9rem 0.9rem;
  appearance: none;
}

.field select {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  padding: 0.9rem 2.6rem 0.9rem 0.9rem;
}

.prefix,
.suffix {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
  padding: 0 0.65rem 0 0.9rem;
}

.suffix {
  padding-right: 0.9rem;
  padding-left: 0;
}

.field-error {
  min-height: 1.1rem;
  color: #d93a3a;
  font-size: 0.76rem;
}

.results-panel {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.8rem 0.9rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.result-item.highlight {
  background: linear-gradient(135deg, rgba(31, 90, 229, 0.09) 0%, rgba(14, 165, 233, 0.12) 100%);
  margin-bottom: 0.75rem;
}

.result-item span {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-item strong {
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  letter-spacing: -0.04em;
}

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

.metrics-section,
.category-section,
.feature-section,
.guide-section {
  padding: 2.2rem 0 0;
}

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

.metric-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.15rem;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.04);
}

.metric-card .metric-value {
  display: block;
  margin-bottom: 0.25rem;
  font-size: clamp(1.3rem, 2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.05em;
}

.metric-card .metric-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.section-heading {
  margin-bottom: 1.5rem;
  text-align: center;
}

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

.section-heading h2 {
  margin: 0.8rem 0 0;
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.05em;
}

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

.directory-page {
  padding: 4rem 0 2rem;
}

.directory-hero {
  padding-bottom: 1.5rem;
}

.directory-header {
  max-width: 760px;
}

.directory-header h1 {
  margin: 0.8rem 0 0.75rem;
  font-size: clamp(2.4rem, 4vw, 4rem);
  letter-spacing: -0.06em;
}

.directory-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.directory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
  flex-wrap: wrap;
}

.directory-summary {
  color: var(--muted);
  font-weight: 600;
}

.directory-summary strong {
  color: var(--text);
}

.search-shell {
  min-width: min(100%, 320px);
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  padding: 0.2rem 0.9rem;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.03);
}

.search-shell input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.85rem 0.65rem;
  color: var(--text);
  font-size: 0.98rem;
}

.search-shell input:focus {
  outline: none;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.directory-empty {
  grid-column: 1 / -1;
  padding: 2rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  text-align: center;
}

.calculator-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.4rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.04);
}

.calculator-card .icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 700;
}

.calculator-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.calculator-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.calculator-card .card-updated {
  margin-top: -0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.calculator-card .card-link {
  margin-top: auto;
  color: var(--primary);
  font-weight: 600;
}

.feature-stack {
  display: grid;
  gap: 1.4rem;
}

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

.feature-card {
  padding: 1.4rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(31, 90, 229, 0.08), rgba(14, 165, 233, 0.1));
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
}

.feature-card h3 {
  margin: 1rem 0 0.6rem;
  font-size: 1.2rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

.guide-panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.6rem;
  background: linear-gradient(135deg, rgba(31, 90, 229, 0.08), rgba(14, 165, 233, 0.08));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.guide-panel h2 {
  margin: 0.7rem 0 0;
  font-size: clamp(1.6rem, 2vw, 2.4rem);
  letter-spacing: -0.05em;
}

.guide-panel p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  margin-top: 3rem;
  padding: 2rem 0 1.25rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 1) 100%);
  color: rgba(255, 255, 255, 0.8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand-block p {
  max-width: 420px;
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.7);
}

.site-footer h3 {
  margin: 0 0 0.9rem;
  color: white;
  font-size: 1rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.7);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.legal-page {
  padding: 4rem 0 2rem;
}

.legal-shell {
  max-width: 920px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 2vw, 2.5rem);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.04);
}

.legal-shell h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.2rem, 3vw, 3rem);
  letter-spacing: -0.05em;
}

.legal-shell h2 {
  margin: 1.5rem 0 0.65rem;
  font-size: 1.2rem;
}

.legal-shell p,
.legal-shell li {
  color: var(--muted);
}

.legal-shell ul {
  padding-left: 1.1rem;
}

.tool-page {
  padding: 4rem 0 2rem;
}

.tool-shell {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  align-items: start;
}

.tool-card,
.tool-result {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.04);
}

.tool-card {
  padding: clamp(1.2rem, 2vw, 2rem);
}

.tool-header {
  margin-bottom: 1.25rem;
}

.tool-header h1 {
  margin: 0.75rem 0 0;
  font-size: clamp(2.2rem, 4vw, 3.3rem);
  letter-spacing: -0.05em;
}

.tool-header p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 1.25rem;
}

.preset-button,
.reset-button {
  border: 1px solid rgba(31, 90, 229, 0.16);
  background: rgba(31, 90, 229, 0.04);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.preset-button:hover,
.preset-button:focus-visible,
.reset-button:hover,
.reset-button:focus-visible {
  background: rgba(31, 90, 229, 0.09);
  transform: translateY(-1px);
}

.reset-button {
  margin-left: auto;
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.02);
  color: var(--muted);
}

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

.tool-form .field {
  width: 100%;
}

.tool-form .field.full {
  grid-column: 1 / -1;
}

.tool-result {
  padding: 1.2rem;
  position: sticky;
  top: 100px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.result-figure {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.result-figure strong {
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.result-figure span {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-figure.primary {
  background: linear-gradient(135deg, rgba(31, 90, 229, 0.09), rgba(14, 165, 233, 0.12));
}

.tool-meta {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.breakdown-panel,
.comparison-panel {
  margin-top: 1rem;
  padding: 1rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.46);
}

.breakdown-header,
.comparison-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.breakdown-bar {
  display: flex;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 90, 229, 0.08);
}

.breakdown-bar span {
  display: block;
  height: 100%;
}

#breakdown-main {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

#breakdown-secondary {
  background: linear-gradient(135deg, rgba(20, 184, 123, 0.9), rgba(20, 184, 123, 0.45));
}

.breakdown-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.breakdown-metrics div {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.breakdown-metrics strong {
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.breakdown-metrics span {
  color: var(--muted);
  font-size: 0.78rem;
}

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

.compare-card {
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(31, 90, 229, 0.04);
  border: 1px solid rgba(31, 90, 229, 0.09);
}

.compare-card strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.25rem;
  letter-spacing: -0.04em;
}

.compare-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comparison-delta {
  margin: 0.9rem 0 0;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.86rem;
}

@media (max-width: 900px) {
  .hero-grid,
  .guide-panel,
  .footer-grid,
  .feature-grid,
  .calculator-grid,
  .metric-grid,
  .tool-shell,
  .tool-form {
    grid-template-columns: 1fr 1fr;
  }

  .hero-grid,
  .guide-panel,
  .footer-grid,
  .tool-shell,
  .tool-form {
    grid-template-columns: 1fr;
  }

  .nav-wrap {
    flex-wrap: wrap;
    min-height: auto;
    padding: 0.7rem 0;
  }

  .main-nav {
    display: flex;
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
  }

  .button-small {
    margin-left: auto;
  }

  .directory-toolbar {
    align-items: stretch;
  }
}

@media (max-width: 620px) {
  .hero-section {
    padding-top: 3rem;
  }

  .hero-actions,
  .form-grid,
  .metric-grid,
  .feature-grid,
  .calculator-grid,
  .stats-row {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    display: grid;
  }

  .button,
  .button-small {
    width: auto;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .form-grid {
    display: grid;
  }

  .nav-wrap {
    min-height: auto;
    gap: 0.7rem;
  }

  .brand span {
    font-size: 1rem;
  }

  .main-nav {
    gap: 0.5rem;
    font-size: 0.76rem;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

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

  .main-nav a {
    flex-shrink: 0;
  }

  .tool-page {
    padding-top: 1.25rem;
  }

  .footer-bottom {
    flex-direction: column;
  }
}
