:root {
  --bg: #f3f6fb;
  --surface: rgba(255, 255, 255, 0.92);
  --text: #152238;
  --muted: #5c6b82;
  --accent: #0f766e;
  --accent-dark: #0a5a54;
  --border: #dce5f2;
  --shadow: 0 12px 30px rgba(21, 34, 56, 0.08);
  --result-bg: #edf7f5;
  --result-text: #0d4a45;
  --topbar-bg: rgba(243, 246, 251, 0.84);
}

body[data-theme="dark"] {
  --bg: #0b1220;
  --surface: rgba(17, 25, 40, 0.9);
  --text: #e2e8f0;
  --muted: #9aa8be;
  --accent: #2dd4bf;
  --accent-dark: #14b8a6;
  --border: #243247;
  --shadow: 0 10px 30px rgba(1, 4, 9, 0.45);
  --result-bg: #11211f;
  --result-text: #8ce2d8;
  --topbar-bg: rgba(11, 18, 32, 0.84);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%, var(--bg) 48%), var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.home-bg-match {
  background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%, var(--bg) 48%), var(--bg) !important;
}
body.home-bg-match {
  background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%, var(--bg) 48%), var(--bg) !important;
}
body:has(.tool-layout),
body:has(.calculators-page),
body:has(.labs-wrap) {
  background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%, var(--bg) 48%), var(--bg) !important;
}
main { flex: 1 0 auto; }

.container { width: min(1140px, 92%); margin: 0 auto; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(10px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; justify-content: space-between; align-items: center; padding: 0.85rem 0; }
.brand { font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.brand-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}
.back-link--header {
  margin: 0 !important;
  font-size: 0.86rem;
  font-weight: 600;
}
.nav-right { display: flex; align-items: center; gap: 1rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.header-search input[type="search"] {
  width: 210px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--text);
  padding: 0 0.75rem;
  font-size: 0.9rem;
}
.header-search input[type="search"]::placeholder { color: var(--muted); }
.nav-right nav { display: flex; align-items: center; gap: 1rem; }
nav a { text-decoration: none; color: var(--muted); margin-left: 0; font-weight: 600; white-space: nowrap; }
nav a {
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
nav a.is-active {
  color: var(--muted);
  background: transparent;
}
nav a:hover,
nav a:active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.topbar nav a[href="/contact.html"] {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}
a, a:link, a:visited { color: var(--accent); }
a:hover, a:active { color: var(--accent-dark); }
a:focus-visible { outline: none; }
button:focus,
button:focus-visible,
a:focus { outline: none; box-shadow: none; }
.tool-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #178680);
  margin-top: auto;
}
.tool-link:link,
.tool-link:visited,
.tool-link:hover,
.tool-link:active { color: #fff; }

.theme-switch { border: 0; background: transparent; padding: 0; cursor: pointer; }
.theme-switch,
.theme-switch:hover,
.theme-switch:active,
.theme-switch:focus,
.theme-switch:focus-visible {
  width: auto;
  height: auto;
  min-height: 0;
  max-height: none;
  background: transparent !important;
  border: 0;
}
#theme-toggle,
#theme-toggle:hover,
#theme-toggle:active,
#theme-toggle:focus,
#theme-toggle:focus-visible {
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}
#theme-toggle::-moz-focus-inner { border: 0; }
.theme-switch__track {
  width: 58px; height: 30px; border-radius: 999px; position: relative;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 90%, transparent);
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px;
}
.theme-switch__icon { font-size: 0.72rem; color: var(--muted); z-index: 1; }
.theme-switch__thumb {
  width: 24px; height: 24px; border-radius: 50%; background: #ffffff;
  position: absolute; left: 2px; top: 2px; box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transition: transform 0.22s ease;
}
body[data-theme="dark"] .theme-switch__thumb { transform: translateX(28px); background: #0f172a; border: 1px solid #243247; }

.hero { padding: 3.8rem 0 2.2rem; }
.hero-inner { display: grid; grid-template-columns: 1.2fr minmax(280px, 360px); gap: 1rem; align-items: start; }
.eyebrow { color: var(--accent); font-weight: 700; margin: 0; }
h1 { margin: 0.35rem 0; font-size: clamp(1.6rem, 2.8vw, 2.25rem); line-height: 1.18; max-width: 18ch; }
.subtitle { margin: 0; color: var(--muted); max-width: 660px; }
.hero-converter-cta {
  margin: 0.95rem 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  width: fit-content;
  max-width: 100%;
}
.hero-converter-cta__label {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-converter-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0 1.08rem;
  border-radius: 11px;
  color: #fff !important;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(135deg, #0f766e, #178680);
  box-shadow:
    0 10px 22px rgba(15, 118, 110, 0.28),
    inset 0 1px 0 rgba(255,255,255,.25),
    inset 0 -2px 0 rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.22);
  letter-spacing: .01em;
  transform: translateY(0);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.hero-converter-cta__btn:hover {
  background: linear-gradient(135deg, #0b5f59, #147a74);
  transform: translateY(-1px) scale(1.01);
  box-shadow:
    0 14px 28px rgba(15, 118, 110, 0.36),
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -2px 0 rgba(0,0,0,.16);
}
.hero-converter-cta__btn:active {
  transform: translateY(1px) scale(0.995);
  box-shadow:
    0 6px 14px rgba(15, 118, 110, 0.28),
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(0,0,0,.10);
}
.hero-pills { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1rem; }
.hero-pills span {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 0.35rem 0.68rem; font-size: 0.82rem; color: var(--muted);
}
.hero-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.hero-panel h3 { margin: 0 0 0.4rem; }
.hero-panel p { margin: 0; color: var(--muted); }
.hero-calculator {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0.9rem;
}
.hero-calculator__eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.hero-calculator__display {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: right;
  padding: 0 0.7rem;
  margin-bottom: 0.6rem;
}
.hero-calculator__keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}
.hero-calculator__keys button {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  border-radius: 9px;
  font-size: 0.95rem;
}
.hero-calculator__keys .wide {
  grid-column: span 2;
}
.hero-calculator__keys .accent {
  background: linear-gradient(135deg, var(--accent), #178680);
  color: #fff;
}

.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; padding-bottom: 2.2rem; }
.tool-directory {
  margin-top: -0.6rem;
  margin-bottom: 1.7rem;
}
.tool-directory--top { margin-top: 0; }
.tool-directory--page {
  margin-top: 1rem;
  margin-bottom: 0;
}
.tool-directory details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.7rem 0.9rem;
}
.tool-directory summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  list-style: none;
}
.tool-directory summary::-webkit-details-marker { display: none; }
.tool-directory summary::after { content: " +"; color: var(--accent); }
.tool-directory details[open] summary::after { content: " -"; }
.tool-directory ul { margin: 0.65rem 0 0; padding-left: 1rem; columns: 2; column-gap: 1.2rem; }
.tool-directory li { break-inside: avoid; margin: 0 0 0.35rem; }
.tool-directory-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.tool-directory-col {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 0.7rem 0.8rem;
}
.tool-directory-col ul {
  margin: 0.4rem 0 0;
  padding-left: 1rem;
  columns: 1;
}
.tool-directory-col li { margin: 0 0 0.28rem; }
.tool-directory__category {
  margin: 0;
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 1.15rem; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card h2 { margin: 0; font-size: 1.07rem; display: flex; align-items: center; gap: 0.42rem; }
.card p { margin: 0.42rem 0 0.9rem; color: var(--muted); }
.tools-grid .card p { min-height: 44px; }

.tool-form { display: grid; gap: 0.7rem; flex: 1; align-content: start; }
.tool-form {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  justify-items: center;
}
.tool-form--short .field-spacer { height: 74px; }
.tool-form label {
  width: 100%;
  text-align: left;
}
label { display: grid; gap: 0.35rem; color: var(--text); font-size: 0.92rem; font-weight: 600; }
input, select, button { font: inherit; border-radius: 10px; }
input, select {
  border: 1px solid var(--border); background: #fff; color: #152238; padding: 0.63rem 0.7rem;
}
body[data-theme="dark"] input, body[data-theme="dark"] select { background: #0f172a; color: #d6deea; }
.output { font-weight: 700; }

button {
  border: 0; height: 44px; min-height: 44px; max-height: 44px; width: 100%;
  padding: 0 1rem; white-space: nowrap; line-height: 1;
  font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), #178680);
  outline: none;
  box-shadow: none;
}
button:hover { background: linear-gradient(135deg, var(--accent-dark), #116f69); }
button:hover,
button:active,
button:focus,
button:focus-visible,
.tool-link:hover,
.tool-link:active,
.tool-link:focus,
.tool-link:focus-visible,
.theme-switch:hover,
.theme-switch:active,
.theme-switch:focus,
.theme-switch:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.result {
  margin-top: 0.9rem; min-height: 48px; display: flex; align-items: center;
  justify-content: center;
  padding: 0.72rem; border-radius: 10px; background: var(--result-bg); color: var(--result-text); font-weight: 600;
  text-align: center;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.trust-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem;
  padding: 0 0 2rem;
}
.seo-clusters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  padding: 0 0 1.8rem;
}
.cluster-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.95rem 1rem;
}
.cluster-card h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.cluster-card p { margin: 0 0 0.6rem; color: var(--muted); }
.cluster-card ul { margin: 0; padding-left: 1rem; }
.cluster-card li { margin: 0 0 0.3rem; }
.trust-grid article {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  padding: 0.95rem 1rem;
}
.trust-grid h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.trust-grid p { margin: 0; color: var(--muted); }

.faq { padding: 0 0 2.6rem; }
.faq h3 { margin: 0 0 0.7rem; }
.tool-notes {
  margin: 0.95rem 0 0.9rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.tool-notes h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.tool-notes p {
  margin: 0.32rem 0;
  color: var(--muted);
}
.report-issue a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.copy-result-btn {
  margin-top: 0.55rem;
  width: auto;
  min-width: 132px;
  height: 36px;
  padding: 0 0.75rem;
  border-radius: 9px;
}
.ad-slot {
  margin: 0.85rem 0;
}
.ad-slot__label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ad-slot__box {
  min-height: 92px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.88rem;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}
.ad-slot--top .ad-slot__box {
  min-height: 110px;
}
.ad-slot--bottom .ad-slot__box {
  min-height: 96px;
}
.ad-slot[hidden] {
  display: none !important;
}
.faq p {
  margin: 0.5rem 0;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.footer { border-top: 1px solid var(--border); padding: 1.2rem 0; color: var(--muted); margin-top: auto !important; text-align: center !important; }
.footer-links {
  margin: 0.45rem 0 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.footer-links a { color: var(--muted); text-decoration: none; margin-right: 0; }
.cookie-banner {
  display: none !important;
  position: fixed;
  left: 1rem;
  right: 1rem;
  top: 1rem;
  bottom: auto;
  background: var(--panel, #ffffff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  z-index: 2147483647;
  pointer-events: auto;
}
.cookie-banner p { margin: 0; color: var(--muted); }
.cookie-banner button {
  width: auto;
  min-width: 90px;
  height: 38px;
  cursor: pointer;
  position: relative;
  z-index: 2147483647;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  gap: 1rem;
  padding-bottom: 2rem;
}

.tool-main-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.tool-main-card h1 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin: 0.2rem 0 0.5rem;
  max-width: none;
}

.tool-main-card p {
  color: var(--muted);
}
.scientific-calc {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-radius: 14px;
  padding: 0.85rem;
}
.scientific-display {
  width: 100%;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: right;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0 0.7rem;
  margin-bottom: 0.6rem;
}
.scientific-keys {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}
.scientific-keys button {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  border-radius: 9px;
  font-size: 0.88rem;
}
.scientific-keys .accent {
  background: linear-gradient(135deg, var(--accent), #178680);
}
.related-tools ul {
  margin: 0;
  padding-left: 1.15rem;
  list-style-position: outside;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem 0.9rem;
}
.related-tools li {
  min-width: 0;
  padding-right: 0.2rem;
  display: list-item;
  line-height: 1.35;
}
.related-tools a {
  display: inline;
  line-height: 1.35;
  overflow-wrap: normal;
  word-break: normal;
  padding: 0;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.18s ease;
}
.related-tools a:hover {
  color: var(--accent-dark);
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  font-weight: 700;
  text-decoration: none;
}
.tool-main-card .back-link {
  display: inline-flex !important;
  float: left;
  clear: both;
  width: auto !important;
  margin: 0 0 0.55rem 0 !important;
  text-align: left !important;
}
.tool-main-card h1 { clear: both; }

@media (max-width: 620px) {
  .nav {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand switch"
      "search search"
      "links links";
    align-items: center;
    gap: 0.5rem 0.65rem;
  }
  .brand { grid-area: brand; }
  .nav-right { display: contents; }
  .header-search {
    grid-area: search;
  }
  .header-search input[type="search"] {
    width: 100%;
    max-width: none;
    height: 34px;
    font-size: 0.84rem;
  }
  #theme-toggle { grid-area: switch; justify-self: end; }
  .nav-right nav {
    grid-area: links;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
  }
  nav a {
    margin-left: 0;
    font-size: 0.83rem;
    white-space: nowrap;
  }
  .topbar nav a[href="/contact.html"] {
    display: none !important;
  }
  .hero { padding-top: 2.7rem; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-pills { gap: 0.45rem; }
  .hero-pills span { font-size: 0.78rem; }
  .hero-converter-cta { margin-top: 0.75rem; gap: .45rem; padding: .6rem; width: 100%; }
  .hero-converter-cta__label { font-size: .7rem; }
  .hero-converter-cta__btn { min-height: 40px; font-size: 0.82rem; padding: 0 .76rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-directory ul { columns: 1; }
  .tool-directory-grid { grid-template-columns: 1fr; }
  .related-tools ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scientific-keys { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .trust-grid { grid-template-columns: 1fr; }
  .trust-grid article { padding: 0.9rem; }
  .faq { padding-bottom: 2rem; }
  .faq p { font-size: 0.95rem; line-height: 1.5; }
}

@media (max-width: 480px) {
  .container { width: min(1140px, 94%); }
  .brand { font-size: 1.08rem; }
  .nav-right nav { gap: 0.45rem; }
  .hero { padding: 2.4rem 0 1.6rem; }
  h1 { line-height: 1.15; }
  .subtitle { font-size: 0.96rem; line-height: 1.55; }
  .card, .hero-panel, .trust-grid article, .faq p { border-radius: 14px; }
  .related-tools ul { grid-template-columns: 1fr; }
  .scientific-keys { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .brand { font-size: 1rem; }
  nav a { font-size: 0.78rem; }
  .theme-switch__track { width: 54px; }
  .hero-pills span { font-size: 0.74rem; padding: 0.3rem 0.56rem; }
}


/* Split home choice */
.hero--split-choice { padding: 4.2rem 0 3.2rem; }
.split-choice { text-align: center; }
.split-choice h1 { max-width: none; }
.split-choice .subtitle { margin: 0.3rem auto 0; max-width: 680px; }
.split-choice__grid {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 380px));
  justify-content: center;
  gap: 1rem;
}
.split-choice__card {
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  border-radius: 18px;
  padding: 1.1rem;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.62rem;
  aspect-ratio: 1 / 1;
  height: clamp(300px, 34vw, 380px);
}
.split-choice__card h2 { margin: 0; font-size: 1.2rem; }
.split-choice__card p { margin: 0; color: var(--muted); max-width: 28ch; }
.split-choice__kicker { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.split-choice__cta {
  margin-top: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--border));
  background: linear-gradient(135deg, var(--accent), #178680);
  color: #fff;
  font-weight: 700;
  padding: 0 0.85rem;
  width: auto;
  min-width: 190px;
  text-align: center;
}
body[data-theme="dark"] .split-choice__card {
  border-color: #2f4a64;
}
body[data-theme="dark"] .split-choice__cta {
  border-color: #45c9b5;
}

.split-choice__grid > .split-choice__card {
  width: 100%;
  max-width: 380px;
}

/* Calculators hub compact */
.calc-hub { display: grid; gap: 0.95rem; margin-top: 1rem; }
.calculators-page { text-align: center; }
.calculators-page .back-link {
  display: flex !important;
  width: fit-content;
  margin: 0 0 0.5rem 0 !important;
  margin-left: 0 !important;
  margin-right: auto !important;
  text-align: left;
}
.calculators-page h1,
.calculators-page .subtitle {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.calc-search-wrap {
  margin: 0.7rem auto 0.95rem;
  width: min(360px, 100%);
}
.calc-search-wrap input[type="search"] {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  padding: 0 0.75rem;
  font-size: 0.9rem;
}
.calc-group {
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 1rem;
  text-align: center;
  box-shadow: none;
}
.calc-group h2 { margin: 0; font-size: 1.03rem; text-align: center; }
.calc-group h2 span { color: var(--muted); font-weight: 600; }
.calc-tile-grid {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 120px));
  gap: 0.6rem;
  justify-items: center;
  justify-content: center;
  align-items: center;
}
.calc-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  aspect-ratio: 1 / 1;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  background: #ffffff;
  text-decoration: none;
  color: #0f766e !important;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: .01em;
  font-family: "Manrope", sans-serif;
  padding: 0.45rem;
  text-align: center;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.12);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease, color .18s ease, background .18s ease;
}
.calc-tile span {
  line-height: 1.22;
}
.calc-tile:hover {
  color: #ffffff !important;
  background: linear-gradient(145deg, #0f766e, #169486);
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.24);
}
body[data-theme="dark"] .calc-group {
  background: transparent;
  box-shadow: none;
}
body[data-theme="dark"] .calc-tile {
  color: #dffaf6 !important;
  border-color: #2c4b60;
  background: linear-gradient(145deg, rgba(32, 74, 88, 0.94), rgba(23, 54, 67, 0.92));
}
body[data-theme="dark"] .calc-tile:hover {
  color: #ffffff !important;
  background: linear-gradient(145deg, #0f766e, #14b8a6);
}

/* File converters swap ui */
.labs-wrap { max-width: 900px; margin: 1rem auto; padding: 0 1rem 1.7rem; }
.file-converters-back {
  margin-top: 1rem;
}
.file-converters-back .back-link {
  display: inline-flex;
  margin: 0 0 0.55rem 0 !important;
  margin-left: 0 !important;
  margin-right: auto !important;
}
.labs-card {
  background: linear-gradient(145deg, rgba(16,185,129,.10), rgba(16,185,129,.02));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: .95rem 1rem 1rem;
  display: grid;
  justify-items: center;
}
.labs-panel {
  max-width: 560px;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 440px;
  background: var(--card, var(--surface));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: .9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 16px 30px rgba(0,0,0,.10);
}
.swap-stack { display: grid; gap: .58rem; }
.swap-box { border: 1px solid var(--border); border-radius: 12px; padding: .62rem .68rem; background: rgba(255,255,255,.025); }
.swap-box__top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .36rem; }
.swap-chip { font-size: .74rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: .14rem .45rem; background: transparent; }
.swap-main { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: .65rem; min-width: 0; width: 100%; }
.swap-main--stack { display: flex; align-items: flex-start; flex-direction: column; gap: .5rem; width: 100%; }
.labs-select--compact { min-width: 110px; height: 34px; padding: 0 .55rem; flex: 0 0 110px; }
.swap-file-name { margin: 0; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; display: block; }
.swap-file-trigger { display: inline-block; max-width: 220px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.swap-file-trigger:hover { color: var(--accent); }
.swap-input-group { display: grid; justify-items: start; gap: .2rem; min-width: 0; flex: 1; overflow: hidden; padding-left: .2rem; width: 100%; }
.swap-type { font-weight: 700; font-size: .95rem; letter-spacing: .02em; }
.swap-mid { width: 100%; display: flex; justify-content: center; margin: .1rem 0; }
.swap-mid-badge {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  min-height: 34px;
  padding: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  appearance: none;
}
.swap-mid-badge__icon {
  width: 19px;
  height: 19px;
  display: block;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.swap-mid-badge:hover,
.swap-mid-badge:active,
.swap-mid-badge:focus,
.swap-mid-badge:focus-visible {
  background: var(--surface) !important;
  color: var(--accent) !important;
  border-color: var(--border);
  transform: none;
  box-shadow: none !important;
  outline: none !important;
}
.swap-arrows { display: inline-grid; place-items: center; gap: 0; line-height: .72; font-size: .72rem; }
.labs-row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.labs-note { color: var(--muted); font-size: .9rem; margin: 0; line-height: 1.45; }
.labs-status-line,
#labs-status {
  margin-top: .55rem;
  min-height: 1.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: .22rem .6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}
.labs-label { font-size: .84rem; color: var(--muted); margin: 0 0 .28rem; }
.labs-input--hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.labs-select { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: .4rem .52rem; background: transparent; color: var(--text); font-size: .8rem; }
.labs-btn { border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; padding: .68rem .95rem; cursor: pointer; width: 100%; }
.labs-results-wrap { margin-top: .85rem; width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .75rem; }
.labs-progress { margin-top: .55rem; border: 1px solid var(--border); border-radius: 11px; padding: .48rem .58rem; background: rgba(255,255,255,.02); }
.labs-progress__bar { width: 100%; height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: .28rem; }
.labs-progress__fill { width: 0%; height: 100%; background: linear-gradient(90deg, #16a34a, #10b981); border-radius: 999px; transition: width .24s ease; }
.labs-progress__meta { display: flex; align-items: center; justify-content: space-between; gap: .7rem; font-size: .78rem; color: var(--muted); }
.labs-results { margin-top: .55rem; display: grid; gap: .58rem; justify-items: center; }
.labs-item { width: 100%; max-width: 400px; border: 1px solid var(--border); border-radius: 11px; padding: .58rem; background: rgba(255,255,255,.02); }
.labs-item img { max-width: 100%; max-height: 240px; object-fit: contain; height: auto; border-radius: 7px; border: 1px solid var(--border); display: block; margin: 0 auto; }
.labs-previewable { cursor: zoom-in; }
.labs-status-pop { animation: labsStatusPop .44s ease; }
@keyframes labsStatusPop { 0% { transform: translateY(3px); opacity: .55; } 100% { transform: translateY(0); opacity: 1; } }
.labs-preview-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .86); display: grid; place-items: center; z-index: 2000; padding: .6rem; }
.labs-preview-modal[hidden] { display: none; }
.labs-preview-modal__panel { width: auto; max-width: 96vw; max-height: 96vh; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .55rem; position: relative; display: inline-flex; align-items: center; justify-content: center; }
.labs-preview-modal img { display: block; max-width: 94vw; max-height: calc(96vh - 58px); border-radius: 10px; border: 1px solid var(--border); background: #fff; object-fit: contain; margin: 0 auto; }
.labs-preview-close { position: absolute; top: .35rem; right: .35rem; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-weight: 700; line-height: 1; }
.labs-title { margin: 0 0 .3rem; }

.footer .container { text-align: center !important; }

@media (max-width: 900px) {
  .split-choice__grid {
    grid-template-columns: minmax(260px, 420px);
    justify-content: center;
  }
}
@media (max-width: 640px) {
  .header-search input[type="search"] { width: 150px; }
  .calc-tile-grid { grid-template-columns: repeat(2, minmax(110px, 120px)); }
  .labs-wrap { margin-top: .7rem; padding-bottom: 1.15rem; }
  .labs-card { padding: .78rem .72rem .8rem; }
  .labs-panel { min-height: 0; aspect-ratio: auto; padding: .7rem; }
  .labs-title { font-size: 1.18rem; line-height: 1.2; }
}
@media (max-width: 420px) {
  .calc-tile-grid { grid-template-columns: repeat(2, minmax(100px, 112px)); }
  .calc-tile { width: 112px; }
}

/* Final converter layout overrides */
.labs-panel .swap-main {
  grid-template-columns: 110px minmax(0, 1fr) !important;
}
.labs-panel .labs-select--compact {
  min-width: 110px !important;
  flex-basis: 110px !important;
}
.labs-panel .swap-file-name {
  max-width: 240px !important;
}
