:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --green-50: #f0fdf4;
  --green-200: #bbf7d0;
  --green-600: #16a34a;
  --red-50: #fef2f2;
  --red-200: #fecaca;
  --red-700: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--gray-50);
  color: var(--gray-900);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: var(--blue-600);
  text-decoration: none;
}

a:hover {
  color: var(--blue-700);
}

.container {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--gray-100);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
}

.nav-inner {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-weight: 700;
  color: var(--gray-900);
}

.logo-mark {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  margin-right: 0.75rem;
  border-radius: 0.5rem;
  color: #fff;
  background: var(--blue-600);
}

.logo-sub {
  display: block;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 400;
  margin-top: 0.15rem;
}

.logo-title {
  display: block;
  font-size: 1.25rem;
  line-height: 1.4;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 2.5rem;
}

.nav-links a {
  position: relative;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--blue-50);
  color: var(--blue-600);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 1.25rem;
  height: 0.125rem;
  border-radius: 999px;
  background: var(--blue-600);
  transform: translateX(-50%);
}

.mobile-menu-button {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.45rem;
  background: #fff;
  color: var(--gray-700);
  font-size: 1.4rem;
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--gray-200);
  padding: 0.5rem 0 0.75rem;
}

.mobile-menu a {
  display: block;
  padding: 0.8rem 1rem;
  border-radius: 0.45rem;
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 600;
}

.mobile-menu a.active {
  background: var(--blue-50);
  color: var(--blue-600);
}

.hero-calculator {
  background: var(--blue-50);
  border-bottom: 1px solid var(--blue-200);
  padding: 2rem 0;
}

.hero-title {
  margin: 0 0 1rem;
  text-align: center;
  color: var(--blue-900);
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
}

.hero-copy {
  max-width: 75rem;
  margin: 0 auto 2rem;
  text-align: center;
  color: var(--blue-700);
  line-height: 1.5;
}

.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab-buttons button,
.primary-button,
.secondary-button,
.copy-button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.tab-buttons button {
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--blue-200);
  border-radius: 0.65rem;
  background: #fff;
  color: var(--blue-700);
  font-size: 0.9rem;
  font-weight: 700;
  transition: 0.2s ease;
}

.tab-buttons button.active {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.2);
}

.tab-select-wrap {
  display: none;
  margin-bottom: 1.5rem;
}

.tab-select-wrap select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--blue-200);
  border-radius: 0.65rem;
  color: var(--blue-800);
  background: #fff;
  font-weight: 700;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.calculator-panel {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  padding: 2rem;
}

.calculator-suite-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.calculator-heading {
  display: block;
  margin: 0 0 2rem;
  text-align: center;
  font-size: 1.25rem;
}

.calculator-heading h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
}

.calculator-heading p {
  margin: 0;
  color: #4b5563;
  font-size: 1rem;
}

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

.calculator-grid.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 1.5rem;
  row-gap: 1rem;
  margin-bottom: 2rem;
}

.form-stack {
  display: grid;
  gap: 1.5rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field label {
  color: var(--gray-700);
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 700;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

input,
select {
  min-height: 2.625rem;
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--gray-900);
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 1rem;
  line-height: 1.5rem;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--gray-400);
}

.input-row input {
  flex: 1 1 auto;
  border-radius: 0.75rem 0 0 0.75rem;
}

.input-row select {
  flex: 0 0 7rem;
  border-left: 0;
  border-radius: 0 0.75rem 0.75rem 0;
}

.native-select-hidden {
  display: none !important;
}

.unit-dropdown {
  position: relative;
  flex: 0 0 7rem;
  min-width: 0;
  z-index: 20;
}

.unit-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 2.625rem;
  border: 1px solid var(--gray-200);
  border-left: 0;
  border-radius: 0 0.75rem 0.75rem 0;
  background: #fff;
  color: var(--gray-700);
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 1rem;
  line-height: 1.5rem;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.unit-dropdown-trigger:hover,
.unit-dropdown.open .unit-dropdown-trigger {
  border-color: var(--gray-300);
}

.unit-dropdown-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-dropdown-chevron {
  margin-left: 0.4rem;
  color: #111827;
  font-size: 1.15rem;
  line-height: 1;
  transform: translateY(-0.08rem);
  transition: transform 0.2s ease;
}

.unit-dropdown.open .unit-dropdown-chevron {
  transform: rotate(180deg) translateY(0.08rem);
}

.unit-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 60;
  display: none;
  width: 100%;
  min-width: 7rem;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.14);
  animation: fadeIn 0.15s ease-out;
}

.unit-dropdown.open .unit-dropdown-menu {
  display: block;
}

.unit-dropdown-option {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  color: var(--gray-700);
  padding: 0.45rem 0.85rem;
  text-align: left;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.35rem;
  cursor: pointer;
}

.unit-dropdown-option:hover,
.unit-dropdown-option.selected {
  background: var(--gray-100);
}

.actions {
  display: flex;
  gap: 1rem;
  margin-top: 0;
  justify-content: center;
}

.calculator-panel > .actions {
  margin-top: 1rem;
}

.primary-button,
.secondary-button {
  flex: 1;
  min-height: 2.5rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
}

.primary-button {
  background: linear-gradient(90deg, var(--blue-600), #6366f1);
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
}

.primary-button:disabled,
.primary-button.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-button {
  background: var(--gray-100);
  color: var(--gray-800);
}

.result-card {
  border: 1px solid var(--gray-100);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  padding: 1.5rem;
}

.result-card h3,
.result-card h4 {
  margin: 0 0 1rem;
}

.result-box {
  border: 1px solid var(--green-200);
  border-radius: 0.75rem;
  background: var(--green-50);
  padding: 1rem;
  text-align: center;
  color: var(--gray-800);
  font-weight: 700;
}

.result-box.is-error,
.error-box {
  border-color: var(--red-200);
  background: var(--red-50);
  color: var(--red-700);
}

.steps {
  margin-top: 0.75rem;
}

.step-item {
  margin-top: 0.5rem;
  border-left: 4px solid #60a5fa;
  border-radius: 0.35rem;
  background: #fff;
  padding: 0.55rem 0.75rem;
  color: var(--gray-700);
  font-size: 0.9rem;
}

.copy-button {
  width: 100%;
  margin-top: 1.25rem;
  border-radius: 0.6rem;
  background: linear-gradient(90deg, var(--blue-600), #6366f1);
  color: #fff;
  padding: 0.75rem 1rem;
  font-weight: 800;
}

.formula-box {
  margin-top: 2rem;
  border: 1px solid var(--blue-200);
  border-radius: 1rem;
  background: linear-gradient(
    135deg,
    rgba(239, 246, 255, 0.85),
    rgba(219, 234, 254, 0.85)
  );
  color: var(--blue-900);
  padding: 1.25rem;
  text-align: center;
}

.formula-box.purple {
  border-color: #e9d5ff;
  background: linear-gradient(
    135deg,
    rgba(250, 245, 255, 0.6),
    rgba(243, 232, 255, 0.6)
  );
  color: #6b21a8;
}

.formula-box h2 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  text-align: left;
}

.formula {
  margin: 0 0 0.45rem;
  font-family: "Courier New", monospace;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 800;
}

.info-main {
  padding: 3rem 0;
}

.info-section {
  margin-bottom: 2rem;
  border: 1px solid var(--gray-100);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 2rem;
}

.info-section h1,
.info-section h2 {
  margin: 0 0 1.25rem;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
}

.info-section h3 {
  margin: 1rem 0 0.5rem;
}

.info-section p,
.info-section li {
  color: var(--gray-700);
  line-height: 1.65;
}

.callout {
  border-left: 4px solid var(--blue-600);
  background: var(--blue-50);
  padding: 1rem;
  color: var(--blue-900);
  font-weight: 700;
}

.grams-info-section {
  border-color: var(--gray-200);
  border-radius: 0.9rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.grams-info-section h2 {
  margin-bottom: 1.35rem;
  color: #00123f;
  font-size: 1.25rem;
  line-height: 1.45;
}

.grams-info-section p,
.grams-info-section li {
  color: #00123f;
  font-size: 0.875rem;
  line-height: 1.55;
}

.grams-info-section p {
  margin: 0 0 1rem;
}

.grams-info-section ul,
.grams-info-section ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.grams-info-section li {
  margin: 0.45rem 0;
}

.grams-info-section p:last-child,
.grams-info-section ol:last-child,
.grams-info-section ul:last-child {
  margin-bottom: 0;
}

.grams-formula-callout {
  margin: 0 0 1rem;
  border-left-width: 3px;
  border-left-color: #60a5fa;
  background: #eff6ff;
  padding: 0.95rem 1rem;
  color: #00123f;
  font-size: 0.875rem;
  font-weight: 400;
}

.grams-features-section h2 {
  margin-bottom: 1.45rem;
}

.grams-feature-list {
  display: grid;
  gap: 1.1rem;
}

.grams-feature-item {
  border-left: 3px solid;
  border-left-color: #60a5fa;
  padding: 0.25rem 0 0.25rem 1.2rem;
}

.grams-feature-item h3 {
  margin: 0 0 0.6rem;
  color: #00123f;
  font-size: 0.9375rem;
  line-height: 1.35;
  font-weight: 700;
}

.grams-feature-item h3::first-letter {
  color: #1d4ed8;
}

.grams-feature-item p {
  margin: 0;
  color: #00123f;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.grams-importance-section ul {
  margin-top: 0;
  margin-bottom: 0;
}

.grams-importance-section li::marker {
  color: #2563eb;
}

.grams-conclusion-section p {
  max-width: 74rem;
}

.molar-info-section {
  border-color: var(--gray-200);
  border-radius: 0.9rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.molar-info-section h2 {
  margin-bottom: 1.35rem;
  color: #00123f;
  font-size: 1.25rem;
  line-height: 1.45;
}

.molar-info-section p,
.molar-info-section li {
  color: #00123f;
  font-size: 0.875rem;
  line-height: 1.55;
}

.molar-info-section p {
  margin: 0 0 1rem;
}

.molar-info-section ul,
.molar-info-section ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.molar-info-section li {
  margin: 0.45rem 0;
}

.molar-info-section p:last-child,
.molar-info-section ol:last-child,
.molar-info-section ul:last-child {
  margin-bottom: 0;
}

.molar-features-section h2 {
  margin-bottom: 1.2rem;
}

.molar-feature-list {
  display: grid;
  gap: 1.55rem;
}

.molar-feature-item h3 {
  margin: 0 0 0.75rem;
  color: #00123f;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
}

.molar-feature-item p {
  margin: 0 0 0.6rem;
  color: #00123f;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.molar-feature-item p:last-child {
  margin-bottom: 0;
}

.molar-conclusion-section p {
  max-width: 74rem;
}

.moles-info-section {
  border-color: var(--gray-100);
  border-radius: 0.35rem;
  box-shadow: none;
}

.moles-info-section h2 {
  margin-bottom: 1.35rem;
  color: #00123f;
  font-size: 1.25rem;
  line-height: 1.45;
}

.moles-info-section p,
.moles-info-section li {
  color: #00123f;
  font-size: 0.875rem;
  line-height: 1.55;
}

.moles-info-section p {
  margin: 0 0 1rem;
}

.moles-info-section ul,
.moles-info-section ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.moles-info-section li {
  margin: 0.45rem 0;
}

.moles-formula-callout {
  margin: 0 0 1rem;
  border-radius: 0.45rem;
  background: #f3f4f6;
  padding: 0.9rem 1rem;
  color: #00123f;
  font-family: "Courier New", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

.moles-note-callout {
  border-radius: 0.35rem;
  background: #eff6ff;
  padding: 0.95rem 1rem;
  color: #00123f;
  font-size: 0.75rem;
  line-height: 1.45;
}

.moles-features-section h2,
.moles-conclusion-section h2 {
  margin-bottom: 1.25rem;
}

.moles-feature-list {
  display: grid;
  gap: 1.25rem;
}

.moles-feature-item h3 {
  margin: 0 0 0.65rem;
  color: #00123f;
  font-size: 0.875rem;
  line-height: 1.35;
  font-weight: 700;
}

.moles-feature-item p {
  margin: 0;
  color: #00123f;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.moles-conclusion-section p {
  max-width: 74rem;
}

.feature-list {
  display: grid;
  gap: 1.25rem;
}

.feature-item {
  border-left: 4px solid #60a5fa;
  padding-left: 1.25rem;
}

.units-consider-section {
  border-color: var(--gray-200);
  border-radius: 0.9rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.units-consider-section > p {
  margin: 0 0 1.5rem;
  color: #00123f;
  font-size: 0.875rem;
  line-height: 1.55;
}

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

.unit-conversion-card {
  border-radius: 0.45rem;
  background: var(--gray-50);
  padding: 1.35rem 1.5rem 1.25rem;
}

.unit-conversion-card h3 {
  margin: 0 0 1.1rem;
  color: #00123f;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
}

.unit-conversion-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  color: #00123f;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  font-weight: 500;
}

.unit-conversion-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1rem;
}

.unit-conversion-list dt,
.unit-conversion-list dd {
  margin: 0;
}

.unit-conversion-list dd {
  text-align: right;
  white-space: nowrap;
}

.units-good-news {
  border-left: 4px solid #22c55e;
  background: #ecfdf5;
  padding: 1rem 1.15rem;
}

.units-good-news h3 {
  margin: 0 0 0.55rem;
  color: #00123f;
  font-size: 0.95rem;
  line-height: 1.3;
}

.units-good-news p {
  margin: 0;
  color: #006b2f;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.how-to-calculate-section {
  border-color: var(--gray-200);
  border-radius: 0.9rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.how-to-calculate-section > p {
  margin: 0 0 1.75rem;
  color: #00123f;
  font-size: 0.875rem;
  line-height: 1.55;
}

.how-to-card {
  border-left: 4px solid;
  border-radius: 0.45rem;
  padding: 1.55rem 1.4rem 1.3rem;
}

.how-to-card + .how-to-card {
  margin-top: 2rem;
}

.how-to-card-blue {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

.how-to-card-green {
  border-left-color: #22c55e;
  background: #ecfdf5;
}

.how-to-card h3 {
  margin: 0 0 1rem;
  color: #00123f;
  font-size: 1.0625rem;
  line-height: 1.35;
  font-weight: 700;
}

.how-to-card p {
  margin: 0 0 0.9rem;
  color: #00123f;
  font-size: 0.875rem;
  line-height: 1.55;
}

.how-to-card ol {
  margin: 0;
  padding-left: 1.25rem;
}

.how-to-card li {
  margin: 0.55rem 0;
  color: #00123f;
  font-size: 0.875rem;
  line-height: 1.45;
}

.additional-functions-section {
  border-color: var(--gray-200);
  border-radius: 0.9rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.additional-functions-section h2 {
  margin-bottom: 1rem;
}

.additional-function-card {
  border-left: 4px solid;
  padding: 0.15rem 0 0.15rem 1.45rem;
}

.additional-function-card + .additional-function-card {
  margin-top: 1.45rem;
}

.additional-function-blue {
  border-left-color: #3b82f6;
}

.additional-function-green {
  border-left-color: #22c55e;
}

.additional-function-purple {
  border-left-color: #a855f7;
}

.additional-function-orange {
  border-left-color: #f97316;
}

.additional-function-card h3 {
  margin: 0 0 0.75rem;
  color: #00123f;
  font-size: 0.9375rem;
  line-height: 1.35;
  font-weight: 700;
}

.additional-function-card p {
  margin: 0 0 0.65rem;
  color: #00123f;
  font-size: 0.75rem;
  line-height: 1.5;
}

.additional-function-card ol {
  margin: 0;
  padding-left: 1.1rem;
}

.additional-function-card li {
  margin: 0.45rem 0;
  color: #00123f;
  font-size: 0.75rem;
  line-height: 1.45;
}

.why-solver-section {
  border-color: var(--gray-200);
  border-radius: 0.9rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

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

.why-feature-item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.why-feature-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.25rem;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.why-feature-icon-blue {
  background: #3b82f6;
}

.why-feature-icon-orange {
  background: #f97316;
}

.why-feature-icon-green {
  background: #22c55e;
}

.why-feature-icon-red {
  background: #f43f5e;
}

.why-feature-icon-purple {
  background: #a855f7;
}

.why-feature-item h3 {
  margin: 0 0 0.5rem;
  color: #00123f;
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 700;
}

.why-feature-item p {
  margin: 0;
  color: #00123f;
  font-size: 0.75rem;
  line-height: 1.45;
}

.conclusion-section {
  border-color: #dbeafe;
  border-radius: 0.65rem;
  background: #eff6ff;
  box-shadow: none;
}

.conclusion-section p {
  margin: 0;
  color: #00123f;
  font-size: 0.8125rem;
  line-height: 1.65;
}

.conclusion-section p + p {
  margin-top: 1rem;
}

.results-panel {
  margin-top: 1.25rem;
}

.hidden {
  display: none !important;
}

.error-box {
  margin: 1rem 0;
  border: 1px solid var(--red-200);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
}

.site-footer {
  background: var(--gray-900);
  color: #fff;
  padding: 3rem 0 2rem;
}

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

.site-footer h3 {
  margin: 0 0 1rem;
}

.site-footer p,
.site-footer a {
  color: var(--gray-300);
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  margin: 0.6rem 0;
}

.footer-bottom {
  margin-top: 2rem;
  border-top: 1px solid var(--gray-800);
  padding-top: 1.5rem;
  color: #9ca3af;
  font-size: 0.875rem;
}

.toast {
  position: fixed;
  top: 5rem;
  left: 50%;
  z-index: 80;
  transform: translateX(-50%) translateY(-0.5rem);
  border-radius: 0.65rem;
  background: var(--green-600);
  color: #fff;
  padding: 0.8rem 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.is-error {
  background: var(--red-700);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%);
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-button {
    display: block;
  }

  .mobile-menu.is-open {
    display: block;
  }

  .tab-buttons {
    display: none;
  }

  .tab-select-wrap {
    display: block;
  }

  .calculator-grid,
  .calculator-grid.three-cols,
  .unit-conversion-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .calculator-grid.three-cols {
    margin-bottom: 0;
  }

  .calculator-heading {
    display: none;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .tab-select-wrap select {
    font-size: 1.125rem;
  }
}

@media (max-width: 640px) {
  .container {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-calculator {
    padding: 0.85rem 0;
  }

  .hero-title {
    margin-bottom: 0.65rem;
    font-size: 1.25rem;
    line-height: 1.24;
  }

  .hero-copy {
    margin-bottom: 0.85rem;
    font-size: 0.75rem;
    line-height: 1.35;
  }

  .tab-select-wrap {
    margin-bottom: 1.15rem;
  }

  .tab-select-wrap select {
    min-height: 2.7rem;
    padding: 0.375rem 1rem;
    border-color: #bfdbfe;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    color: #1e40af;
    font-size: 0.9375rem;
    font-weight: 400;
  }

  .calculator-panel,
  .info-section {
    padding: 1rem;
  }

  .calculator-suite-panel {
    padding: 0;
  }

  .calculator-panel .calculator-grid,
  .calculator-suite-panel .calculator-grid {
    column-gap: 0;
    row-gap: 0.8rem;
  }

  .calculator-panel .form-stack,
  .calculator-suite-panel .form-stack {
    gap: 0.8rem;
  }

  .calculator-panel .field,
  .calculator-suite-panel .field {
    gap: 0.55rem;
  }

  .calculator-panel .field label,
  .calculator-suite-panel .field label {
    font-size: 0.9375rem;
    line-height: 1.35rem;
  }

  .calculator-panel input,
  .calculator-panel select,
  .calculator-panel .unit-dropdown-trigger,
  .calculator-suite-panel input,
  .calculator-suite-panel select,
  .calculator-suite-panel .unit-dropdown-trigger {
    min-height: 2.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
    line-height: 1.15rem;
  }

  .calculator-panel .input-row,
  .calculator-suite-panel .input-row {
    gap: 0.5rem;
  }

  .calculator-panel .input-row input,
  .calculator-suite-panel .input-row input {
    border-radius: 0.75rem 0 0 0.75rem;
  }

  .calculator-panel .input-row select,
  .calculator-panel .unit-dropdown,
  .calculator-suite-panel .input-row select,
  .calculator-suite-panel .unit-dropdown {
    flex-basis: 7.5rem;
    border-left: 0;
  }

  .calculator-panel .unit-dropdown-trigger,
  .calculator-suite-panel .unit-dropdown-trigger {
    border-radius: 0 0.75rem 0.75rem 0;
  }

  .calculator-panel .actions,
  .calculator-suite-panel .actions {
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.6rem;
  }

  .calculator-panel .primary-button,
  .calculator-panel .secondary-button,
  .calculator-suite-panel .primary-button,
  .calculator-suite-panel .secondary-button {
    min-height: 2.35rem;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 0.8125rem;
  }

  .input-row select,
  .unit-dropdown {
    flex-basis: 6.5rem;
  }

  .unit-dropdown-trigger {
    min-height: 2.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
    line-height: 1.15rem;
  }

  .unit-dropdown-menu {
    min-width: 6.5rem;
  }

  .unit-dropdown-option {
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.15rem;
  }

  .formula-box {
    margin-top: 1.2rem;
    padding: 0.9rem;
  }

  .formula-box h2 {
    margin-bottom: 0.55rem;
    font-size: 1.125rem;
    line-height: 1.45rem;
  }

  .formula {
    font-size: 1.25rem;
    line-height: 1.65rem;
  }

  .formula-box p {
    font-size: 0.875rem;
    line-height: 1.35;
  }

  .actions {
    gap: 0.5rem;
  }

  .info-main {
    padding: 1.5rem 0;
  }

  .info-section {
    margin-bottom: 1.15rem;
    padding: 1.15rem;
  }

  .info-section h1,
  .info-section h2 {
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    line-height: 1.4rem;
  }

  .info-section h3 {
    font-size: 0.875rem;
    line-height: 1.2rem;
  }

  .info-section p,
  .info-section li {
    font-size: 0.8125rem;
    line-height: 1.42;
  }

  .callout {
    margin: 0.75rem 0;
    padding: 0.65rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.25;
  }

  .units-consider-section > p {
    margin-bottom: 1rem;
    font-size: 0.8125rem;
  }

  .unit-conversion-grid {
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  .unit-conversion-card {
    padding: 1rem;
  }

  .unit-conversion-card h3 {
    font-size: 0.9375rem;
  }

  .unit-conversion-list {
    font-size: 0.75rem;
  }

  .unit-conversion-list div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .unit-conversion-list dd {
    text-align: left;
  }

  .units-good-news {
    padding: 0.85rem 0.9rem;
  }

  .how-to-calculate-section > p {
    margin-bottom: 1rem;
    font-size: 0.8125rem;
  }

  .how-to-card {
    padding: 1rem;
  }

  .how-to-card + .how-to-card {
    margin-top: 1rem;
  }

  .how-to-card h3 {
    font-size: 0.9375rem;
  }

  .how-to-card p,
  .how-to-card li {
    font-size: 0.8125rem;
  }

  .additional-function-card {
    padding-left: 1rem;
  }

  .additional-function-card + .additional-function-card {
    margin-top: 1.1rem;
  }

  .additional-function-card h3 {
    font-size: 0.875rem;
  }

  .why-feature-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .why-feature-item {
    grid-template-columns: 1.75rem minmax(0, 1fr);
    gap: 0.8rem;
  }

  .why-feature-icon {
    width: 1.75rem;
    height: 1.75rem;
  }

  .why-feature-item h3 {
    font-size: 0.875rem;
  }

  .why-feature-item p,
  .conclusion-section p {
    font-size: 0.8125rem;
  }

  .info-section ul,
  .info-section ol {
    padding-left: 1.1rem;
  }
}
