/* ScientificCalculators.site — bundled CSS. Run: node scripts/bundle-css.mjs */
/* === variables.css === */
:root {
  --color-white: #ffffff;
  --color-navy-900: #0f172a;
  --color-navy-800: #1e293b;
  --color-navy-700: #334155;
  --color-royal-600: #2563eb;
  --color-royal-700: #1d4ed8;
  --color-royal-50: #eff6ff;
  --color-indigo-500: #6366f1;
  --color-indigo-100: #e0e7ff;
  --color-emerald-500: #10b981;
  --color-emerald-600: #059669;
  --color-emerald-50: #ecfdf5;
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;
  --color-red-500: #ef4444;
  --color-red-50: #fef2f2;
  --color-amber-500: #f59e0b;
  --color-amber-50: #fffbeb;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12);

  --header-height: 72px;
  --transition: 0.2s ease;
  --container-max: 1200px;

  --bg-body: var(--color-white);
  --bg-surface: var(--color-white);
  --bg-muted: var(--color-slate-50);
  --bg-elevated: var(--color-white);
  --text-primary: var(--color-slate-900);
  --text-secondary: var(--color-slate-600);
  --text-muted: var(--color-slate-500);
  --border-color: var(--color-slate-200);
  --header-bg: rgba(255, 255, 255, 0.92);
  --footer-bg: var(--color-navy-900);
}

[data-theme="dark"] {
  --bg-body: var(--color-navy-900);
  --bg-surface: var(--color-navy-800);
  --bg-muted: #162032;
  --bg-elevated: var(--color-navy-800);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #334155;
  --header-bg: rgba(15, 23, 42, 0.95);
  --color-royal-50: rgba(37, 99, 235, 0.12);
  --color-emerald-50: rgba(16, 185, 129, 0.12);
  --color-indigo-100: rgba(99, 102, 241, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}


/* === base.css === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 4vw, 2.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

ul, ol {
  color: var(--text-secondary);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--color-royal-600);
  color: var(--color-white);
  border-radius: var(--radius-md);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--color-royal-600);
  outline-offset: 2px;
}

.container-sc {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .container-sc {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.section {
  padding: 4rem 0;
}

.section-muted {
  background: var(--bg-muted);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
}

.section-header p {
  font-size: 1.125rem;
  margin-bottom: 0;
}

.section-label {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-royal-600);
  margin-bottom: 0.75rem;
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-royal-600), var(--color-indigo-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* === components.css === */
.btn-sc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  min-height: 44px;
}

.btn-sc-primary {
  background: var(--color-royal-600);
  color: var(--color-white);
  border-color: var(--color-royal-600);
}

.btn-sc-primary:hover {
  background: var(--color-royal-700);
  border-color: var(--color-royal-700);
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-sc-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-sc-secondary:hover {
  border-color: var(--color-royal-600);
  color: var(--color-royal-600);
}

.btn-sc-outline {
  background: transparent;
  color: var(--color-royal-600);
  border-color: var(--color-royal-600);
}

.btn-sc-outline:hover {
  background: var(--color-royal-50);
  color: var(--color-royal-700);
}

.btn-sc-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 0.5rem 0.75rem;
}

.btn-sc-ghost:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.btn-sc-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  min-height: 36px;
}

.btn-sc-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.card-sc {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition);
  height: auto;
}

.calc-grid > .card-sc,
.calc-grid > .card-sc-link {
  height: 100%;
}

.info-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.info-cards-stack .card-sc {
  height: auto;
  flex: 0 0 auto;
}

.card-sc:hover {
  border-color: var(--color-royal-600);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-sc-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-sc-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-royal-50);
  color: var(--color-royal-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.card-sc-icon svg {
  width: 24px;
  height: 24px;
}

.card-sc h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.card-sc p {
  font-size: 0.9375rem;
  margin-bottom: 0;
}

.badge-sc {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--color-royal-50);
  color: var(--color-royal-600);
}

.badge-sc-new {
  background: var(--color-emerald-50);
  color: var(--color-emerald-600);
}

.form-control-sc {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
}

.form-control-sc:focus {
  outline: none;
  border-color: var(--color-royal-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control-sc::placeholder {
  color: var(--text-muted);
}

.form-label-sc {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.accordion-sc .accordion-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) !important;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.accordion-sc .accordion-button {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-elevated);
  box-shadow: none;
}

.accordion-sc .accordion-button:not(.collapsed) {
  color: var(--color-royal-600);
  background: var(--color-royal-50);
}

.accordion-sc .accordion-body {
  color: var(--text-secondary);
}

.toast-sc-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast-sc {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  min-width: 280px;
}

.toast-sc-success {
  border-left: 4px solid var(--color-emerald-500);
}

.toast-sc-error {
  border-left: 4px solid var(--color-red-500);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-modal .modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.search-modal .modal-header {
  border-bottom-color: var(--border-color);
}

.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 360px;
  overflow-y: auto;
}

.search-results-list li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
}

.search-results-list li a:hover,
.search-results-list li a.active {
  background: var(--color-royal-50);
}

.search-results-list .result-type {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  min-width: 72px;
}

.search-results-list .result-title {
  font-weight: 600;
  flex: 1;
}

.search-results-list mark {
  background: rgba(37, 99, 235, 0.2);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.feature-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.feature-card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-royal-50), var(--color-indigo-100));
  color: var(--color-royal-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-card-icon svg {
  width: 32px;
  height: 32px;
}

.cta-banner {
  background: linear-gradient(135deg, var(--color-navy-900) 0%, #1e3a5f 50%, var(--color-royal-700) 100%);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--color-white);
}

.cta-banner h2 {
  color: var(--color-white);
  margin-bottom: 1rem;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 520px;
  margin: 0 auto 1.5rem;
}

.cta-banner .btn-sc-primary {
  background: var(--color-white);
  color: var(--color-royal-700);
  border-color: var(--color-white);
}

.cta-banner .btn-sc-primary:hover {
  background: var(--color-slate-100);
  color: var(--color-royal-700);
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.newsletter-form .form-control-sc {
  flex: 1;
  min-width: 200px;
}

.breadcrumb-sc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
}

.breadcrumb-sc li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.breadcrumb-sc li a {
  color: var(--text-secondary);
}

.breadcrumb-sc li a:hover {
  color: var(--color-royal-600);
}

.breadcrumb-sc li + li::before {
  content: "/";
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.page-hero {
  padding: 3rem 0 2rem;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-color);
}

.page-hero h1 {
  margin-bottom: 0.75rem;
}

.page-hero p {
  font-size: 1.125rem;
  max-width: 640px;
  margin-bottom: 0;
}


/* === layout.css === */
#site-header {
  min-height: var(--header-height);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  overflow: visible;
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.site-logo svg {
  width: 36px;
  height: 36px;
}

.site-logo span {
  display: none;
}

@media (min-width: 576px) {
  .site-logo span {
    display: inline;
  }
}

.main-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
  overflow: visible;
}

@media (min-width: 992px) {
  .main-nav {
    display: flex;
  }
}

.nav-link-sc {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-sans);
  min-height: 44px;
}

.nav-link-sc:hover,
.nav-link-sc.active {
  color: var(--color-royal-600);
  background: var(--color-royal-50);
}

.nav-dropdown {
  position: relative;
}

/* Invisible bridge — keeps hover active while moving cursor to mega menu */
.nav-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -0.5rem;
  right: -0.5rem;
  height: 0.75rem;
  z-index: 1039;
}

.mega-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  width: min(920px, calc(100vw - 2rem));
  max-height: calc(100vh - var(--header-height) - 1.5rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--color-slate-300) transparent;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 1.5rem;
  z-index: 1040;
}

.mega-menu::-webkit-scrollbar {
  width: 8px;
}

.mega-menu::-webkit-scrollbar-track {
  background: transparent;
  margin: 0.25rem 0;
}

.mega-menu::-webkit-scrollbar-thumb {
  background: var(--color-slate-300);
  border-radius: 999px;
}

.mega-menu::-webkit-scrollbar-thumb:hover {
  background: var(--color-slate-400);
}

/* Extends hover/click area upward into the gap above the panel */
.mega-menu::before {
  content: "";
  position: absolute;
  top: -0.75rem;
  left: 0;
  right: 0;
  height: 0.75rem;
}

.nav-dropdown.open .mega-menu,
.nav-dropdown:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .mega-menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .mega-menu-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.mega-menu-col h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.mega-menu-col h4 svg {
  width: 18px;
  height: 18px;
  color: var(--color-royal-600);
}

.mega-menu-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mega-menu-col ul li {
  margin-bottom: 0.25rem;
}

.mega-menu-col ul a {
  display: block;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.mega-menu-col ul a:hover {
  color: var(--color-royal-600);
}

.mega-menu-col .view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-royal-600);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
}

@media (min-width: 992px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1050;
  visibility: hidden;
  pointer-events: none;
}

.mobile-drawer.open {
  visibility: visible;
  pointer-events: auto;
}

.mobile-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-drawer.open .mobile-drawer-overlay {
  opacity: 1;
}

.mobile-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 85vw);
  height: 100%;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 1.5rem;
}

.mobile-drawer.open .mobile-drawer-panel {
  transform: translateX(0);
}

.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-list > li {
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-list > li > a,
.mobile-nav-list > li > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
}

.mobile-submenu {
  list-style: none;
  padding: 0 0 0.75rem 1rem;
  margin: 0;
  display: none;
}

.mobile-submenu.open {
  display: block;
}

.mobile-submenu a {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.hero-section {
  padding: 4rem 0 5rem;
  background: linear-gradient(180deg, var(--bg-muted) 0%, var(--bg-body) 100%);
  overflow: hidden;
}

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

@media (min-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-content h1 {
  margin-bottom: 1.25rem;
}

.hero-content .lead {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-search {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.hero-search .form-control-sc {
  flex: 1;
  min-width: 220px;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-stat span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-visual svg,
.hero-visual img {
  max-width: 100%;
  width: 480px;
}

/* Homepage hero scientific calculator — self-contained (works even if imports fail) */
.hero-sci-calc {
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.hero-sci-calc .calculator-display,
.hero-sci-calc .hero-sci-display {
  background: linear-gradient(135deg, var(--color-navy-900), #1e3a5f);
  color: var(--color-white);
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
  border-bottom: 1px solid var(--border-color);
}

.hero-sci-display {
  font-size: 1.375rem;
  padding: 0.875rem 1rem;
  min-height: 56px;
}

.hero-sci-calc .calculator-display .expression,
.hero-sci-display .expression {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  min-height: 1.25rem;
  margin-bottom: 0.25rem;
}

.hero-sci-mode {
  display: inline-flex;
  width: auto;
  align-self: flex-start;
  margin: 0.4rem 0 0 0.65rem;
  gap: 0;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  overflow: hidden;
}

.hero-sci-mode-btn {
  flex: none;
  min-width: 3.25rem;
  border: none !important;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.hero-sci-mode-btn.active {
  background: var(--color-royal-600);
  color: var(--color-white);
}

.hero-sci-keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border-color);
  padding: 1px;
}

.hero-sci-keypad .calc-key {
  background: var(--bg-surface);
  border: none !important;
  padding: 0.5rem 0.25rem;
  min-height: 40px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  border-radius: 0;
}

.hero-sci-keypad .calc-key:hover {
  background: var(--bg-muted);
}

.hero-sci-keypad .calc-key-function {
  background: var(--bg-muted);
  font-size: 0.6875rem;
}

.hero-sci-keypad .calc-key-operator {
  background: var(--color-royal-50);
  color: var(--color-royal-600);
}

.hero-sci-keypad .calc-key-operator:hover {
  background: var(--color-royal-600);
  color: var(--color-white);
}

.hero-sci-keypad .calc-key-equals.hero-sci-equals {
  grid-row: span 1;
  background: var(--color-emerald-500);
  color: var(--color-white);
}

.hero-sci-keypad .calc-key-equals.hero-sci-equals:hover {
  background: var(--color-emerald-600);
}

.hero-visual .hero-sci-calc {
  max-width: 100%;
}

@media (min-width: 992px) {
  .hero-visual {
    justify-content: flex-end;
  }

  .hero-sci-calc {
    max-width: 380px;
  }
}

.sci-calc-page-wrap {
  max-width: 380px;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 576px) {
  .calc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .calc-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .calc-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.site-footer {
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.75);
  padding: 4rem 0 0;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color var(--transition);
}

.site-footer a:hover {
  color: var(--color-white);
}

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

@media (min-width: 576px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr repeat(4, 1fr);
  }
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9375rem;
  margin: 1rem 0 1.5rem;
}

.footer-brand .site-logo {
  color: var(--color-white);
}

.footer-col h4 {
  color: var(--color-white);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

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

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul a {
  font-size: 0.9375rem;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  transition: background var(--transition);
}

.footer-social a:hover {
  background: rgba(255, 255, 255, 0.15);
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
}

.footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}


/* === calculator.css === */
/* Calculator widget styles */
.calculator-widget {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.calculator-display {
  background: linear-gradient(135deg, var(--color-navy-900), #1e3a5f);
  color: var(--color-white);
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 500;
  text-align: right;
  min-height: 64px;
  word-break: break-all;
  border-bottom: 1px solid var(--border-color);
}

.calculator-display .expression {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  min-height: 1.25rem;
  margin-bottom: 0.25rem;
}

.calculator-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-color);
  padding: 1px;
}

.calculator-keypad-scientific {
  grid-template-columns: repeat(5, 1fr);
}

.calc-key {
  background: var(--bg-surface);
  border: none;
  padding: 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  min-height: 52px;
  transition: background var(--transition);
}

.calc-key:hover {
  background: var(--bg-muted);
}

.calc-key:active {
  background: var(--color-slate-200);
}

.calc-key-operator {
  background: var(--color-royal-50);
  color: var(--color-royal-600);
}

.calc-key-operator:hover {
  background: var(--color-royal-600);
  color: var(--color-white);
}

.calc-key-equals {
  background: var(--color-emerald-500);
  color: var(--color-white);
  grid-row: span 2;
}

.calc-key-equals:hover {
  background: var(--color-emerald-600);
}

.calc-key-function {
  background: var(--bg-muted);
  font-size: 0.8125rem;
}

.calc-key-wide {
  grid-column: span 2;
}

.calculator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.result-card {
  background: var(--color-emerald-50);
  border: 1px solid var(--color-emerald-500);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.result-card h3 {
  color: var(--color-emerald-600);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.result-card .result-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-calc .form-control-sc.is-invalid {
  border-color: var(--color-red-500);
}

.form-calc .invalid-feedback {
  color: var(--color-red-500);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.calc-content-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.calc-page-row {
  align-items: flex-start;
}

#calcContentSections .calc-content-section:first-child {
  margin-top: 1rem;
  padding-top: 0;
  border-top: none;
}

.adv-content-block {
  max-width: 100%;
}

.adv-content-lead {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.adv-content-chart {
  margin: 1rem 0;
}

.adv-svg-diagram .adv-svg-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
}

.adv-svg-diagram svg {
  max-width: 100%;
  height: auto;
}

.adv-var-table {
  width: 100%;
  font-size: 0.9375rem;
  border-collapse: collapse;
  margin: 1rem 0;
}

.adv-var-table th,
.adv-var-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.adv-var-table thead th {
  background: var(--bg-muted);
  font-weight: 600;
}

.adv-example-card {
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
}

.adv-example-result {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  color: var(--color-emerald-600);
  margin: 0.5rem 0;
}

.adv-example-steps {
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--bg-muted);
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  margin: 0.5rem 0 0;
  white-space: pre-wrap;
}

.adv-apps-list {
  padding-left: 1.25rem;
  line-height: 1.75;
}

.adv-apps-list li {
  margin-bottom: 0.35rem;
}

.formula-box {
  background: var(--bg-muted);
  border-left: 4px solid var(--color-royal-600);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  margin: 1rem 0;
  overflow-x: auto;
}

.steps-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps-list li {
  counter-increment: step;
  padding: 0.75rem 0 0.75rem 3rem;
  position: relative;
  border-bottom: 1px solid var(--border-color);
}

.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 28px;
  height: 28px;
  background: var(--color-royal-600);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
}

@media (max-width: 576px) {
  .calculator-keypad {
    grid-template-columns: repeat(4, 1fr);
  }

  .calc-key {
    padding: 0.875rem 0.5rem;
    font-size: 0.9375rem;
    min-height: 48px;
  }

  .calculator-display {
    font-size: 1.5rem;
  }
}

/* Calculator sidebar — all tools nav */
.calc-tools-nav-wrap,
.calc-tools-nav {
  margin-top: 1.25rem;
}

#calcSidebar > .calc-tools-nav,
.col-lg-5 > .calc-tools-nav:first-child {
  margin-top: 0;
}

.calc-tools-nav-inner {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--color-slate-300) transparent;
}

.calc-tools-nav-inner::-webkit-scrollbar {
  width: 8px;
}

.calc-tools-nav-inner::-webkit-scrollbar-thumb {
  background: var(--color-slate-300);
  border-radius: 999px;
}

.calc-tools-nav-inner h2 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.calc-tools-group {
  margin-bottom: 1rem;
}

.calc-tools-group:last-of-type {
  margin-bottom: 0.5rem;
}

.calc-tools-group h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin: 0 0 0.35rem;
  padding-top: 0.25rem;
}

.calc-tools-group ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
}

.calc-tools-group li {
  margin-bottom: 0.1rem;
}

.calc-tools-group a {
  display: block;
  padding: 0.3rem 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-royal-600);
  text-decoration: none;
}

.calc-tools-group a:hover {
  text-decoration: underline;
}

.calc-tools-group li.current > a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

.calc-tools-view-all a {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.calc-tools-directory {
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8125rem;
}

.calc-tools-directory a {
  font-weight: 600;
  color: var(--color-royal-600);
  text-decoration: none;
}

.calc-tools-directory a:hover {
  text-decoration: underline;
}

/* Advanced multi-tool calculator panels (calculator.net style) */
.adv-calc-stack {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.adv-calc-panel {
  background: linear-gradient(180deg, #f4f6f9 0%, #eef1f6 100%);
  border: 1px solid #b8c4d4;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.08);
  padding: 0;
}

.adv-calc-panel.card-sc {
  background: linear-gradient(180deg, #f4f6f9 0%, #eef1f6 100%);
  border-color: #b8c4d4;
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.08);
}

.adv-panel-banner {
  background: linear-gradient(180deg, #1a4971 0%, #123a5c 100%);
  color: #e8f1fa;
  padding: 0.65rem 1.15rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-bottom: 1px solid #0c2a42;
}

.adv-panel-banner::before {
  content: "i";
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
}

.adv-panel-banner strong {
  color: #fff;
  font-weight: 600;
}

.adv-panel-body {
  padding: 1.35rem 1.5rem 1.5rem;
}

.adv-calc-panel h2 {
  font-size: 1.1875rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #1e3a5f;
  letter-spacing: -0.01em;
}

.adv-calc-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1.1rem;
  line-height: 1.55;
}

.adv-calc-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.adv-form-grid {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(150px, 220px);
  gap: 0.65rem 1.25rem;
  align-items: center;
  max-width: 500px;
}

.adv-form-grid .form-label-sc {
  justify-self: end;
  text-align: right;
  margin: 0;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.adv-form-grid .form-control-sc,
.adv-form-grid select.form-control-sc,
.adv-form-grid textarea.form-control-sc {
  max-width: none;
  width: 100%;
}

.adv-form-grid .adv-calc-actions {
  grid-column: 1 / -1;
  margin-top: 0.35rem;
}

.adv-calc-form .form-control-sc {
  max-width: 120px;
  border-color: #c5cdd8;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.adv-calc-form .form-control-sc:focus {
  border-color: var(--color-royal-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.adv-calc-form select.form-control-sc {
  max-width: 100px;
}

.adv-calc-form .adv-input-wide {
  max-width: 220px;
  min-width: 140px;
}

.adv-calc-form .adv-input-xl {
  max-width: 100%;
  min-width: 180px;
  flex: 1;
}

.btn-calc-go {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #5da042 0%, #4a8534 100%);
  border: 1px solid #3d6f2a;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn-calc-go::before {
  content: "▶";
  font-size: 0.625rem;
  opacity: 0.9;
}

.btn-calc-go:hover {
  filter: brightness(1.06);
}

.btn-calc-go:active {
  transform: translateY(1px);
}

.frac-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  width: 72px;
}

.frac-stack .form-control-sc {
  text-align: center;
  padding: 0.4rem 0.35rem;
  max-width: none;
  width: 100%;
}

.frac-bar {
  display: block;
  height: 2px;
  background: var(--text-primary);
  margin: 2px 0;
}

.adv-calc-eq {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 0.25rem;
}

.adv-calc-result-slot {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-royal-600);
  min-width: 48px;
}

.adv-calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.5rem;
}

.adv-calc-output {
  margin-top: 1.15rem;
  padding: 1.15rem 1.35rem;
  background: #fff;
  border: 1px solid #86c99a;
  border-left: 4px solid #16a34a;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(22, 163, 74, 0.08);
}

.adv-calc-output .adv-result-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: #14532d;
  line-height: 1.35;
}

.adv-result-hero {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.35rem;
}

.adv-result-main {
  font-family: var(--font-mono);
  font-size: 1.625rem;
  font-weight: 700;
  color: #14532d;
}

.adv-result-sub {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.adv-calc-output .adv-result-steps {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0.65rem 0 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.adv-phrase-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  font-size: 0.9375rem;
}

.adv-phrase-row .form-control-sc {
  width: 88px;
  max-width: 88px;
  text-align: center;
}

.adv-frac-whole {
  width: 56px !important;
  max-width: 56px !important;
}

.math-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin: 0 0.25rem;
  font-family: var(--font-mono);
}

.math-frac .num {
  border-bottom: 1px solid currentColor;
  padding: 0 0.35rem 0.15rem;
}

.math-frac .den {
  padding: 0.15rem 0.35rem 0;
}

.adv-calc-hint {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-royal-50);
  border-radius: var(--radius-sm);
}

.adv-radio-group {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.adv-radio-group legend {
  width: 100%;
  margin-bottom: 0.35rem;
}

.adv-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9375rem;
  cursor: pointer;
}

.adv-check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9375rem;
  cursor: pointer;
}

.calc-grid-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.adv-exponent-form {
  flex-direction: column;
  align-items: stretch;
}

.adv-exponent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.adv-exponent-row .form-control-sc {
  min-width: 100px;
}

.adv-link-small {
  font-size: 0.8125rem;
  color: var(--color-royal-600);
  text-decoration: none;
}

.adv-link-small:hover {
  text-decoration: underline;
}

.adv-unit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.adv-unit-row .form-control-sc {
  width: 100px;
  max-width: 120px;
}

.adv-unit-row select.form-control-sc {
  width: 88px;
  max-width: 88px;
}

.tri-calc-layout {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 1.25rem;
  align-items: start;
}

.tri-diagram {
  position: relative;
  min-height: 220px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.tri-diagram svg {
  width: 100%;
  height: auto;
  max-height: 180px;
}

.tri-fields-grid {
  display: grid;
  gap: 0.65rem;
}

.tri-field-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.rt-calc-layout {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 1.25rem;
}

.rt-fields {
  display: grid;
  gap: 0.5rem;
}

.rt-field-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.rt-diagram svg {
  width: 100%;
  height: auto;
}

.adv-shape-icon {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

@media (max-width: 767.98px) {
  .tri-calc-layout,
  .rt-calc-layout {
    grid-template-columns: 1fr;
  }
}

.adv-calc-form textarea.form-control-sc {
  width: 100%;
  min-height: 72px;
  resize: vertical;
}

.adv-prob-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 120px;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.9375rem;
}

@media (max-width: 575.98px) {
  .adv-prob-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .adv-calc-form {
    flex-direction: column;
    align-items: flex-start;
  }

  .adv-form-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .adv-form-grid .form-label-sc {
    justify-self: start;
    text-align: left;
  }

  .adv-calc-form .form-control-sc,
  .adv-phrase-row .form-control-sc {
    max-width: 100%;
    width: 100%;
  }

  .frac-stack {
    width: 100%;
  }

  .adv-exponent-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.adv-date-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.adv-date-row select,
.adv-date-row input[type="number"] {
  width: auto;
  min-width: 4.5rem;
}

.adv-time-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(3rem, 1fr));
  gap: 0.35rem;
  max-width: 20rem;
  margin-bottom: 0.5rem;
}

.adv-time-grid label {
  font-size: 0.75rem;
  color: var(--sc-muted, #64748b);
  text-align: center;
}

.adv-results-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

@media (max-width: 767.98px) {
  .adv-results-grid {
    grid-template-columns: 1fr;
  }
}

.adv-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.adv-stat-card {
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  padding: 0.85rem 0.65rem;
  text-align: center;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

.adv-stat-card .adv-stat-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.adv-stat-card strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-royal-600);
  font-variant-numeric: tabular-nums;
}

.adv-stat-card small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.adv-donut {
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.12);
}

.adv-donut::after {
  content: "";
  position: absolute;
  inset: 24%;
  background: #fff;
  border-radius: 50%;
  box-shadow: inset 0 1px 4px rgba(15, 23, 42, 0.06);
}

.adv-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  padding: 0 1.5rem;
  line-height: 1.2;
}

.adv-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

.adv-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.adv-legend-rich li {
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 9rem;
}

.adv-legend-rich li strong {
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.adv-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  display: inline-block;
}

.adv-swatch-primary { background: var(--sc-primary, #2563eb); }
.adv-swatch-success { background: var(--sc-success, #16a34a); }
.adv-swatch-danger { background: var(--sc-danger, #dc2626); }

.adv-schedule-table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.adv-schedule-table th,
.adv-schedule-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--sc-border, #e2e8f0);
  text-align: right;
}

.adv-schedule-table th:first-child,
.adv-schedule-table td:first-child {
  text-align: left;
}

.adv-schedule-table thead th {
  background: var(--sc-surface-2, #f1f5f9);
  font-weight: 600;
}

.adv-schedule-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.adv-tab {
  border: 1px solid var(--sc-border, #e2e8f0);
  background: var(--sc-surface, #fff);
  padding: 0.25rem 0.65rem;
  font-size: 0.8125rem;
  border-radius: 0.25rem;
  cursor: pointer;
}

.adv-tab.active {
  background: var(--sc-primary, #2563eb);
  color: #fff;
  border-color: var(--sc-primary, #2563eb);
}

.adv-footnote {
  font-size: 0.75rem;
  color: var(--sc-muted, #64748b);
  margin-top: 0.5rem;
}

.adv-chart-area {
  padding: 0;
  background: transparent;
  border: none;
}

.adv-chart-card {
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
}

.adv-chart-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
}

.adv-chart-donut-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.adv-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.adv-bar-item {
  display: grid;
  grid-template-columns: 4.5rem 1fr 5.5rem;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.8125rem;
}

.adv-bar-track {
  height: 1.35rem;
  background: #eef2f7;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #dbe3ec;
}

.adv-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.35s ease;
  min-width: 2px;
}

.adv-bar-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.adv-stack-chart {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.adv-stack-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr 4.5rem;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8125rem;
}

.adv-stack-bar {
  display: flex;
  height: 1.25rem;
  background: #eef2f7;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #dbe3ec;
}

.adv-stack-seg {
  height: 100%;
  min-width: 1px;
  transition: width 0.35s ease;
}

.adv-stack-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
}

.adv-stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.65rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.adv-stack-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.adv-stack-legend i {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
}

.adv-histogram {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 5.5rem;
  padding-top: 0.5rem;
}

.adv-hist-col {
  flex: 1;
  min-width: 0;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 3px 3px 0 0;
  position: relative;
  min-height: 2px;
  transition: height 0.35s ease;
}

.adv-hist-col span {
  position: absolute;
  top: -1.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.625rem;
  color: var(--text-muted);
}

.adv-curve-wrap {
  text-align: center;
}

.adv-normal-curve {
  width: 100%;
  max-width: 280px;
  height: auto;
}

.adv-tip {
  padding: 0.65rem 0.85rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border-left: 3px solid var(--sc-primary, #2563eb);
  border-radius: 0.25rem;
  font-size: 0.9375rem;
}

[data-adv-extra] {
  margin-top: 0.75rem;
}


/* === blog.css === */
/* Blog & article styles */
.blog-hero {
  padding: 3rem 0 2rem;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-color);
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.blog-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.blog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 992px) {
  .blog-layout.has-sidebar {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
  }
}

.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 992px) {
  .blog-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    max-height: calc(100vh - var(--header-height) - 2rem);
    overflow-y: auto;
  }
}

.blog-sidebar-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.blog-sidebar-block h2 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}


.blog-toc h2 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.blog-posts-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-posts-nav li {
  margin-bottom: 0.15rem;
}

.blog-posts-nav a {
  display: block;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--color-royal-600);
  text-decoration: none;
}

.blog-posts-nav a:hover {
  text-decoration: underline;
}

.blog-posts-nav li.current a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

/* Blog index — compact cards */
.blog-list-grid {
  gap: 1rem;
}

.blog-list-grid .card-sc {
  padding: 1rem 1.25rem;
}

.blog-list-grid .card-sc h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.blog-list-grid .card-sc p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.blog-list-grid .card-sc small {
  font-size: 0.8125rem;
}

.blog-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-toc ul li {
  margin-bottom: 0.35rem;
}

.blog-toc ul a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
}

.blog-toc ul a:hover,
.blog-toc ul a.active {
  color: var(--color-royal-600);
  border-left-color: var(--color-royal-600);
}

.blog-body {
  max-width: 720px;
}

.blog-body h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.blog-body h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.blog-body p,
.blog-body li {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.blog-body ul,
.blog-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.blog-body a {
  font-weight: 500;
}

.blog-share {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 2rem 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.blog-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
}

.blog-nav a {
  display: block;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
}

.blog-nav a:hover {
  border-color: var(--color-royal-600);
  box-shadow: var(--shadow-md);
}

.blog-nav .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.blog-nav .title {
  font-weight: 600;
  color: var(--text-primary);
}

.blog-comments {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.formula-page .formula-display {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  padding: 1.5rem;
  background: var(--bg-muted);
  border-left: 4px solid var(--color-royal-600);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  overflow-x: auto;
}

.formula-vars {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.formula-vars th,
.formula-vars td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.formula-vars th {
  background: var(--bg-muted);
  font-weight: 600;
}

.resource-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.resource-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.resource-list a {
  font-weight: 600;
  font-size: 1.0625rem;
}

.glossary-grid {
  display: grid;
  gap: 1rem;
}

.glossary-term {
  padding: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.glossary-term dt {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.glossary-term dd {
  margin: 0;
  color: var(--text-secondary);
}

/* Info page prose */
.info-prose .calc-content-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.badge-sc-sm { font-size: 0.75rem; margin-left: 0.5rem; vertical-align: middle; }


/* === dark-mode.css === */
[data-theme="dark"] .accordion-sc .accordion-button::after {
  filter: invert(1);
}

[data-theme="dark"] .btn-sc-secondary {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .card-sc:hover {
  border-color: var(--color-royal-600);
}

[data-theme="dark"] .form-control-sc {
  background: var(--bg-muted);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .mega-menu::-webkit-scrollbar-thumb {
  background: var(--color-slate-600);
}

[data-theme="dark"] .mega-menu::-webkit-scrollbar-thumb:hover {
  background: var(--color-slate-500);
}

[data-theme="dark"] .mega-menu {
  scrollbar-color: var(--color-slate-600) transparent;
  background: var(--bg-surface);
}

[data-theme="dark"] .mobile-drawer-panel,
[data-theme="dark"] .toast-sc,
[data-theme="dark"] .search-modal .modal-content {
  background: var(--bg-surface);
}

[data-theme="dark"] .search-results-list mark {
  background: rgba(37, 99, 235, 0.35);
}


/* === responsive.css === */
/* Mobile-first responsive enhancements */

@media (max-width: 575.98px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 1.75rem;
    line-height: 1.25;
  }

  h2 {
    font-size: 1.375rem;
  }

  .section {
    padding: 2.5rem 0;
  }

  .page-hero {
    padding: 2rem 0 1.5rem;
  }

  .page-hero h1 {
    font-size: 1.625rem;
  }

  .page-hero p {
    font-size: 1rem;
  }

  .hero-section {
    padding: 2.5rem 0 3rem;
  }

  .hero-content .lead {
    font-size: 1.0625rem;
    margin-bottom: 1.5rem;
  }

  .hero-search {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-search .form-control-sc,
  .hero-search .btn-sc {
    width: 100%;
    min-width: 0;
  }

  .hero-stats {
    gap: 1.25rem;
  }

  .hero-stat strong {
    font-size: 1.25rem;
  }

  .hero-visual svg,
  .hero-visual img,
  .hero-visual .hero-sci-calc {
    width: 100%;
    max-width: 100%;
  }

  .hero-sci-keypad .calc-key {
    min-height: 36px;
    font-size: 0.6875rem;
    padding: 0.375rem 0.125rem;
  }

  .hero-sci-display {
    font-size: 1.125rem;
  }

  .breadcrumb-sc {
    font-size: 0.8125rem;
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }

  .lead {
    font-size: 1.0625rem;
  }

  .calc-grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .card-sc {
    padding: 1rem;
  }

  .calculator-actions {
    gap: 0.5rem;
  }

  .calculator-actions .btn-sc {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    justify-content: center;
  }

  .result-card {
    padding: 1rem;
  }

  .result-value {
    font-size: 1.375rem;
    word-break: break-word;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }

  .footer-bottom-links {
    justify-content: center;
    gap: 1rem;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form .btn-sc {
    width: 100%;
  }

  .blog-hero h1 {
    font-size: 1.625rem;
  }

  .blog-meta {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }

  .blog-share {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .blog-nav {
    flex-direction: column;
    gap: 1rem;
  }

  .blog-nav-next.text-end {
    text-align: left !important;
  }

  .accordion-button {
    font-size: 0.9375rem;
    padding: 0.875rem 1rem;
  }

  .row.g-4 > [class*="col-"],
  .row.g-5 > [class*="col-"] {
    margin-bottom: 0.25rem;
  }
}

@media (max-width: 767.98px) {
  .calculator-keypad-scientific {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .calculator-keypad-scientific .calc-key {
    padding: 0.75rem 0.35rem;
    font-size: 0.8125rem;
    min-height: 46px;
  }

  .calculator-display {
    padding: 1rem;
    font-size: 1.375rem;
  }

  .calculator-display .expression {
    font-size: 0.75rem;
  }

  .col-lg-7,
  .col-lg-5,
  .col-lg-8 {
    width: 100%;
  }

  .mega-menu {
    display: none;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  .formula-display {
    font-size: 1rem;
    overflow-x: auto;
    padding: 1rem;
  }

  .formula-vars {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 991.98px) {
  .blog-layout.has-sidebar {
    display: block;
  }

  .blog-sidebar {
    position: static;
    max-height: none;
    margin-bottom: 1.5rem;
  }

  .blog-posts-nav ul {
    columns: 2;
    column-gap: 1.5rem;
  }

  .blog-posts-nav li {
    break-inside: avoid;
  }
}

@media (max-width: 575.98px) {
  .blog-posts-nav ul {
    columns: 1;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .calc-grid.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* === hero-calculator.css === */
/* Hero / homepage scientific calculator — calculator.net style, Bootstrap-proof */
.sc-hero-calc {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

.sc-hero-calc-display {
  background: linear-gradient(180deg, #2b6cb0 0%, #1e4d8c 100%);
  color: #fff;
  padding: 10px 14px;
  min-height: 52px;
  text-align: right;
  font-family: "Courier New", Courier, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-all;
}

.sc-hero-calc-display .sc-expr {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  min-height: 1rem;
  margin-bottom: 2px;
}

.sc-hero-calc-keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: #a0a0a0;
  border-top: 1px solid #909090;
}

.sc-hero-calc-keypad button {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none !important;
  outline: none;
  border-radius: 0 !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.1;
  min-height: 36px;
  cursor: pointer;
  background: #e4e4e4;
  color: #111;
  transition: background 0.1s;
}

.sc-hero-calc-keypad button:hover {
  background: #d0d0d0;
}

.sc-hero-calc-keypad button:active {
  background: #b8b8b8;
}

.sc-hero-calc-keypad .sc-k-fn {
  background: #d8d8d8;
  font-size: 0.75rem;
}

.sc-hero-calc-keypad .sc-k-op {
  background: #c5d5e8;
  color: #1a3a5c;
}

.sc-hero-calc-keypad .sc-k-op:hover {
  background: #a8c0dc;
}

.sc-hero-calc-keypad .sc-k-eq {
  background: #2b6cb0;
  color: #fff;
}

.sc-hero-calc-keypad .sc-k-eq:hover {
  background: #1e4d8c;
}

.sc-hero-calc-keypad .sc-k-ac {
  background: #4a6fa5;
  color: #fff;
}

.sc-hero-calc-keypad .sc-k-ac:hover {
  background: #3a5a8a;
}

.sc-hero-calc-keypad .sc-k-mode {
  background: #d8d8d8;
  font-size: 0.6875rem;
  font-weight: 700;
}

.sc-hero-calc-keypad .sc-k-mode.active {
  background: #2b6cb0;
  color: #fff;
}

.hero-visual .sc-hero-calc {
  max-width: 100%;
}

@media (min-width: 992px) {
  .hero-visual {
    display: flex;
    justify-content: flex-end;
  }

  .hero-visual .sc-hero-calc {
    max-width: 340px;
  }
}

@media (max-width: 575.98px) {
  .sc-hero-calc-keypad button {
    min-height: 34px;
    font-size: 0.75rem;
  }

  .sc-hero-calc-display {
    font-size: 1.25rem;
    min-height: 48px;
  }
}

[data-theme="dark"] .sc-hero-calc {
  background: #1e293b;
  border-color: #475569;
}

[data-theme="dark"] .sc-hero-calc-keypad button {
  background: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .sc-hero-calc-keypad .sc-k-fn {
  background: #3b4f66;
}

[data-theme="dark"] .sc-hero-calc-keypad .sc-k-op {
  background: #1e3a5f;
  color: #93c5fd;
}

