* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.directory-page {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: #fff;
  color: var(--color-ink);
  font-family: var(--font-sans);
}

.directory-page button,
.directory-page input {
  font: inherit;
}

.directory-page button,
.directory-page a {
  cursor: pointer;
}

.directory-page a {
  color: inherit;
  text-decoration: none;
}

.directory-page svg {
  width: 1.1em;
  height: 1.1em;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.directory-container {
  width: min(100% - 96px, 1376px);
  margin: 0 auto;
}

.directory-header {
  border-bottom: 1px solid #dfe7f1;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 1px 0 rgba(17, 40, 77, .02);
}

.directory-header {
  position: relative;
  z-index: 100;
}

.header-inner,
.directory-brand,
.directory-nav,
.directory-actions,
.lang-btn,
.submit-btn,
.mobile-menu-btn,
.hero-search,
.hero-category-chips,
.hero-chip,
.browse-heading,
.browse-filter-row,
.browse-categories,
.category-tab,
.sort-tabs,
.sort-tab,
.unit-btn,
.calculator-card,
.pagination-area,
.pagination,
.page-btn,
.page-number,
.related-inner,
.related-list,
.related-card,
.newsletter-inner,
.directory-newsletter form,
.footer-socials,
.footer-meta,
.cookie-inner {
  display: flex;
  align-items: center;
}

.header-inner {
  min-height: 60px;
  justify-content: space-between;
  gap: 28px;
}

.directory-brand {
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.brand-word {
  color: #102a56 !important;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-word span {
  color: #16b67a !important;
  font-weight: 850;
}

.brand-planet {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 3px solid #08ae64;
  border-radius: 50%;
}

.brand-mark {
  border: 0 !important;
  background: url("../logos/Sapicalculator-mark-v3.svg") center / contain no-repeat !important;
  color: transparent !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 0 !important;
}

.brand-mark-img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: block;
  object-fit: contain;
}

.brand-mark::before,
.brand-mark::after {
  display: none !important;
  content: none !important;
}

/* Sapicalculator mark: keep the desktop navigation icon in sync with the new logo. */
.directory-header .brand-planet,
.directory-footer .brand-planet {
  border: 0;
  background: #08ae64;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
}

.directory-header .brand-planet::before,
.directory-header .brand-planet::after,
.directory-footer .brand-planet::before,
.directory-footer .brand-planet::after {
  display: none;
}

.directory-header .brand-planet::after,
.directory-footer .brand-planet::after {
  display: block;
  content: "Q";
  position: static;
  border: 0;
  box-shadow: none;
}

.brand-planet::before,
.brand-planet::after {
  content: "";
  position: absolute;
}

.brand-planet::before {
  left: 9px;
  right: 9px;
  top: 3px;
  bottom: 3px;
  border: 2px solid #08ae64;
  border-radius: 50%;
}

.brand-planet::after {
  left: 4px;
  right: 4px;
  top: 14px;
  height: 3px;
  border-top: 3px solid #08ae64;
  box-shadow: 0 -8px 0 -2px #08ae64, 0 8px 0 -2px #08ae64;
}

.directory-nav {
  justify-content: center;
  gap: 38px;
  margin-left: 36px;
  font-size: 14px;
  font-weight: 650;
}

.directory-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.directory-actions {
  justify-content: flex-end;
  gap: 28px;
  margin-left: auto;
}

.lang-btn,
.submit-btn,
.mobile-menu-btn,
.sort-tab,
.unit-btn,
.page-btn,
.page-number,
.footer-columns button {
  border: 0;
  background: transparent;
  color: var(--color-ink);
}

.lang-btn {
  gap: 8px;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid #dce6f2;
  border-radius: 7px;
  background: #fff;
  font-size: 14px;
  font-weight: 650;
}

.language-switcher {
  position: relative;
  flex: 0 0 auto;
}

.language-switcher__button {
  position: relative;
  z-index: 2;
}

.language-switcher__label {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(145px, 1fr));
  gap: 3px;
  width: 350px;
  max-height: min(430px, calc(100vh - 90px));
  overflow: auto;
  padding: 8px;
  border: 1px solid #d9e2ed;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(17, 45, 85, .16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px);
  transition: transform .12s ease;
}

.language-switcher.is-open .language-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.directory-header .language-menu {
  background: #fff;
  isolation: isolate;
}

.language-option {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-ink);
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}

.language-option:hover,
.language-option.is-active {
  background: #eef4ff;
  color: #1761d2;
}

.language-option__flag {
  display: block;
  width: 24px;
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(12,38,70,.18);
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(12,38,70,.08);
}
.language-option__flag svg,
.language-current-flag svg { display:block; width:100%; height:100%; }
.language-current-flag { display:inline-block; flex:0 0 auto; width:22px; height:15px; overflow:hidden; border:1px solid rgba(12,38,70,.18); border-radius:2px; }

.language-option small {
  color: #93a1b4;
  font-size: 9px;
  letter-spacing: .8px;
}

.footer-meta .language-menu {
  top: auto;
  bottom: calc(100% + 10px);
}

.mobile-menu__tools .language-switcher {
  width: 100%;
}

.mobile-menu__tools .language-switcher__button {
  display: inline-flex;
  width: 100%;
  align-items: center;
  gap: 8px;
}

.mobile-menu__tools .language-menu {
  top: auto;
  right: auto;
  bottom: calc(100% + 8px);
  left: 0;
  grid-template-columns: 1fr;
  width: min(320px, calc(100vw - 42px));
}

.submit-btn {
  gap: 9px;
  min-height: 36px;
  padding: 0 24px;
  border-radius: 7px;
  background: linear-gradient(180deg, #12bd72 0%, #009e57 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap !important;
  box-shadow: 0 8px 20px rgba(0, 166, 87, .22);
}

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

.menu-backdrop,
.mobile-menu {
  display: none;
}

.directory-hero {
  border-bottom: 1px solid #dfe7f1;
  background:
    radial-gradient(circle at 74% 26%, rgba(22, 136, 255, .08), transparent 220px),
    linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 470px;
  align-items: center;
  min-height: 220px;
  gap: 42px;
}

.hero-copy {
  padding-left: 130px;
  min-width: 0;
}

.hero-copy h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  font-weight: 850;
}

.hero-copy p {
  margin: 6px 0 18px;
  color: var(--color-muted);
  font-size: 17px;
  text-align: center;
}

.hero-search {
  width: min(100%, 670px);
  height: 42px;
  margin: 0 auto 18px;
  overflow: hidden;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(23, 52, 89, .04);
}

.hero-search > span {
  margin-left: 16px;
  color: #071b43;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  border: 0;
  outline: 0;
  color: #071b43;
  font-size: 14px;
}

.hero-search button {
  align-self: stretch;
  min-width: 92px;
  border: 0;
  background: linear-gradient(180deg, #12bd72 0%, #009e57 100%);
  color: #fff;
  font-weight: 800;
}

.hero-category-chips {
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
}

.hero-chip {
  gap: 7px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--chip-color) 36%, #dce6f2);
  border-radius: 8px;
  background: #fff;
  color: var(--chip-color);
  font-size: 13px;
  font-weight: 800;
}

.hero-art {
  position: relative;
  height: 190px;
}

.hero-icon {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  box-shadow: 0 10px 18px rgba(20, 60, 110, .12);
}

.hero-percent { left: 58px; top: 30px; background: #3f86ff; }
.hero-heart { left: 42px; top: 122px; background: #ff625a; }
.hero-plane { left: 95px; bottom: 12px; background: #27c2da; }
.hero-home { right: 86px; top: 30px; background: #ff890b; }
.hero-flask { right: 54px; top: 116px; background: #f6bd19; }

.spark {
  position: absolute;
  width: 9px;
  height: 9px;
  color: #a6b4c6;
}

.spark::before,
.spark::after {
  content: "";
  position: absolute;
  inset: 4px 0;
  background: currentColor;
}

.spark::after {
  transform: rotate(90deg);
}

.spark-a { left: 30px; top: 70px; }
.spark-b { left: 88px; top: 92px; }
.spark-c { right: 28px; top: 90px; }

.art-globe {
  position: absolute;
  left: 150px;
  top: 24px;
  width: 145px;
  height: 145px;
  overflow: hidden;
  border: 3px solid #071b43;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 34%, #55d993 0 13%, transparent 14%),
    radial-gradient(circle at 62% 58%, #42c989 0 17%, transparent 18%),
    radial-gradient(circle at 54% 23%, #2fae75 0 8%, transparent 9%),
    linear-gradient(135deg, #a4e9ff, #58b9ef);
  box-shadow: 0 16px 28px rgba(24, 92, 164, .12);
}

.art-globe span {
  position: absolute;
  border: 1px solid rgba(6, 23, 56, .16);
  border-radius: 50%;
}

.art-globe span:nth-child(1) { inset: 18px; }
.art-globe span:nth-child(2) { inset: -10px 52px; }
.art-globe span:nth-child(3) { inset: 52px -10px; }

.art-calc {
  position: absolute;
  left: 232px;
  top: 86px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 14px);
  gap: 8px;
  width: 82px;
  padding: 14px;
  border: 4px solid #071b43;
  border-radius: 12px;
  background: #2e3947;
}

.art-calc::before {
  content: "";
  grid-column: 1 / -1;
  height: 18px;
  border-radius: 5px;
  background: #b7c3d2;
}

.art-calc span {
  height: 12px;
  border-radius: 4px;
  background: #aeb9c9;
}

.art-calc span:last-child {
  grid-row: span 2;
  height: auto;
  background: #23c875;
}

.art-shadow {
  position: absolute;
  left: 202px;
  bottom: 4px;
  width: 210px;
  height: 22px;
  border-radius: 50%;
  background: rgba(18, 34, 58, .08);
}

.browse-section {
  padding: 20px 0 14px;
  background: #fbfdff;
  border-bottom: 1px solid #dfe7f1;
}

.browse-heading {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 0;
  align-items: flex-start;
}

.browse-heading > div:first-child {
  flex: 1 1 280px;
}

.browse-heading h2,
.related-inner h2,
.directory-newsletter h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 850;
}

.browse-heading p,
.directory-newsletter p {
  margin: 6px 0 0;
  color: var(--color-muted);
  font-size: 13px;
}

.browse-filter-row {
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 12px;
}

.browse-categories {
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px 18px;
  flex-wrap: wrap;
}

.browse-categories .category-tab:not(.is-active) svg {
  display: none;
}

.category-tab {
  gap: 6px;
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--tab-color, #173153);
  font-size: 13px;
  font-weight: 800;
}

.category-tab.is-active {
  border-color: #08ae64;
  background: #fff;
  color: #009b5c;
}

.sort-tabs {
  flex: 0 0 auto;
  gap: 10px;
  margin-left: auto;
}

.unit-btn {
  flex: 0 0 auto;
  margin-left: auto;
}

.sort-tab,
.unit-btn {
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #dce6f2;
  border-radius: 7px;
  background: #fff;
  color: #071b43;
  font-size: 13px;
  font-weight: 800;
}

.sort-tab.is-active {
  color: #071b43;
}

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

.calculator-card {
  position: relative;
  gap: 18px;
  min-height: 86px;
  padding: 12px 46px 12px 12px;
  border: 1px solid #dce6f2;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(25, 60, 102, .035);
}

.card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--card-color) 70%, white), var(--card-color));
  color: #fff;
  box-shadow: 0 12px 22px color-mix(in srgb, var(--card-color) 22%, transparent);
}

.card-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.card-copy {
  min-width: 0;
}

.card-copy h2 {
  margin: 0;
  color: #061738;
  font-size: 14px;
  line-height: 1.12;
  font-weight: 850;
}

.card-tag {
  display: block;
  margin-top: 3px;
  color: color-mix(in srgb, var(--card-color) 84%, #061738);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 850;
}

.card-copy p {
  display: -webkit-box;
  margin: 4px 0 0;
  overflow: hidden;
  color: #233755;
  font-size: 12px;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-arrow {
  position: absolute;
  right: 18px;
  top: 50%;
  color: #071b43;
  transform: translateY(-50%);
}

body.calculators-directory-page {
  font-family: "Microsoft YaHei", "微软雅黑", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.calculators-directory-page .directory-brand .brand-word,
.calculators-directory-page .directory-hero h1,
.calculators-directory-page .browse-heading h2,
.calculators-directory-page .related-inner h2,
.calculators-directory-page .newsletter-copy h2 {
  font-weight: 700;
}

.calculators-directory-page .directory-nav a,
.calculators-directory-page .lang-btn,
.calculators-directory-page .submit-btn,
.calculators-directory-page .hero-search button,
.calculators-directory-page .hero-chip,
.calculators-directory-page .category-tab,
.calculators-directory-page .sort-tab,
.calculators-directory-page .unit-btn,
.calculators-directory-page .page-btn,
.calculators-directory-page .page-number {
  font-weight: 600;
}

.calculators-directory-page .card-copy h2 {
  font-weight: 600;
  letter-spacing: 0;
}

.calculators-directory-page .card-tag {
  font-weight: 600;
}

.calculators-directory-page .card-copy p,
.calculators-directory-page .browse-heading p,
.calculators-directory-page .directory-hero p {
  font-weight: 400;
}

.calculators-directory-page .card-icon {
  border: 1px solid color-mix(in srgb, var(--card-color) 22%, #ffffff);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .34), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--card-color) 78%, white), var(--card-color));
}

.calculators-directory-page .card-icon svg {
  width: 27px;
  height: 27px;
  stroke-width: 2.15;
}

.pagination-area {
  justify-content: space-between;
  gap: 24px;
  margin-top: 10px;
}

.pagination-area p {
  margin: 0;
  color: #48607f;
  font-size: 13px;
}

.pagination {
  gap: 10px;
}

.page-btn,
.page-number {
  justify-content: center;
  min-height: 32px;
  border: 1px solid #dce6f2;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  font-weight: 750;
}


.page-btn {
  gap: 8px;
  min-width: 98px;
  padding: 0 14px;
}

.page-btn:disabled {
  color: #b8c4d4;
  background: #fafcff;
}

.page-number {
  width: 40px;
}

.page-number.is-active {
  border-color: #08ae64;
  background: linear-gradient(180deg, #12bd72, #00a85c);
  color: #fff;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: #071b43;
  font-weight: 850;
}

.related-section {
  padding: 14px 0;
  border-bottom: 1px solid #dfe7f1;
  background: #fff;
}

.related-inner {
  gap: 28px;
}

.related-inner h2 {
  flex: 0 0 auto;
}

.related-list {
  flex: 1;
  gap: 28px;
}

.related-card {
  flex: 1 1 0;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #dce6f2;
  border-radius: 7px;
  background: #fff;
  color: #071b43;
  font-size: 12px;
  font-weight: 750;
}

.related-card span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.related-card svg {
  flex: 0 0 auto;
  color: var(--card-color);
}

.directory-newsletter {
  background:
    radial-gradient(circle at 24% 48%, rgba(8, 174, 100, .12), transparent 130px),
    linear-gradient(90deg, #f0fbf6 0%, #fbfffd 100%);
  border-bottom: 1px solid #dfe7f1;
}

.newsletter-inner {
  min-height: 66px;
  gap: 18px;
}

.mail-art {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 70px;
  height: 54px;
  color: #07995b;
}

.mail-art svg {
  width: 54px;
  height: 42px;
}

.newsletter-copy {
  min-width: 280px;
}

.directory-newsletter form {
  width: min(100%, 470px);
  margin-left: auto;
}

.directory-newsletter input,
.directory-newsletter button {
  height: 36px;
  border: 1px solid #dce6f2;
}

.directory-newsletter input {
  flex: 1;
  min-width: 0;
  padding: 0 16px;
  border-radius: 6px 0 0 6px;
  outline: 0;
}

.directory-newsletter button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border-color: #08ae64;
  border-radius: 0 6px 6px 0;
  background: linear-gradient(180deg, #12bd72, #00a85c);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.directory-footer {
  background: #fff;
  border-bottom: 1px solid #dfe7f1;
}

.footer-inner {
  display: grid;
  grid-template-columns: 240px 1fr 150px;
  gap: 62px;
  padding: 14px 0 14px;
}

.footer-brand-block p,
.footer-meta p,
.footer-columns a {
  color: var(--color-muted);
}

.footer-brand-block p {
  margin: 8px 0 10px;
  max-width: 240px;
  font-size: 12px;
  line-height: 1.45;
}

.footer-socials {
  gap: 12px;
}

.footer-socials a {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #dce6f2;
  border-radius: 999px;
  background: #fff;
  color: #071b43;
}

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

.footer-columns section {
  display: grid;
  align-content: start;
  gap: 4px;
}

.footer-columns button {
  justify-content: space-between;
  padding: 0;
  color: #071b43;
  font-size: 13px;
  font-weight: 850;
  text-align: left;
}

.footer-columns button svg {
  display: none;
}

.footer-columns a {
  font-size: 12px;
  line-height: 1.32;
}

.footer-meta {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}

.footer-meta .lang-btn {
  align-self: stretch;
  justify-content: center;
}

.footer-meta p {
  margin: 0;
  font-size: 12px;
}

.cookie-bar {
  background: #fff;
  box-shadow: 0 -1px 0 #dfe7f1;
}

.cookie-inner {
  min-height: 38px;
  justify-content: space-between;
  gap: 20px;
}

.cookie-inner p {
  margin: 0;
  color: #48607f;
  font-size: 12px;
}

.cookie-mark {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  vertical-align: -2px;
  border-radius: 50%;
  background: #ffbd20;
}

.cookie-mark::before,
.cookie-mark::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #925500;
}

.cookie-mark::before {
  left: 4px;
  top: 4px;
  box-shadow: 6px 2px 0 #925500;
}

.cookie-mark::after {
  left: 7px;
  top: 10px;
}

.cookie-inner > div {
  display: flex;
  gap: 10px;
}

.cookie-secondary,
.cookie-primary {
  min-height: 28px;
  padding: 0 18px;
  border: 1px solid #dce6f2;
  border-radius: 6px;
  background: #fff;
  color: #071b43;
  font-size: 12px;
  font-weight: 750;
}

.cookie-primary {
  border-color: #08ae64;
  background: #08ae64;
  color: #fff;
}

@media (min-width: 1201px) and (max-width: 1240px) {
  .directory-container {
    width: min(100% - 40px, 1180px);
  }

  .header-inner {
    gap: 16px;
  }

  .directory-nav {
    gap: 20px;
    margin-left: 10px;
  }

  .directory-actions {
    gap: 14px;
  }

  .directory-actions .lang-btn {
    min-width: 124px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .directory-actions .submit-btn {
    min-width: 188px;
    padding: 0 18px;
    white-space: nowrap !important;
  }
}

@media (max-width: 1200px) {
  .directory-container {
    width: min(100% - 40px, 960px);
  }

  .directory-nav {
    display: none;
  }

  .directory-actions .submit-btn {
    display: none;
  }

  .mobile-menu-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #dce8f2;
    border-radius: 14px;
    background: #fff;
    color: var(--color-ink);
    box-shadow: 0 8px 20px rgba(29, 86, 139, .08);
  }

  .directory-actions {
    gap: 8px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 28px 0 24px;
  }

  .hero-copy {
    padding-left: 0;
  }

  .hero-art {
    display: none;
  }

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

  .browse-filter-row {
    margin-top: 0;
    padding-left: 0;
  }

  .related-list {
    gap: 12px;
    flex-wrap: wrap;
  }

  .related-card {
    flex: 1 1 30%;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 760px) {
  .directory-container {
    width: calc(100% - 32px);
    margin-left: 16px;
    margin-right: 16px;
  }

  .header-inner {
    width: 100%;
    min-height: 0;
    height: 60px;
    gap: 12px;
    flex-wrap: nowrap;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
  }

  .directory-header {
    position: sticky;
    top: 0;
    z-index: 20;
    width: calc(100% - 32px);
    margin-left: 16px;
    margin-right: 16px;
    border-bottom: 0;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
    box-shadow: none;
  }

  .directory-nav,
  .directory-actions .submit-btn {
    display: none;
  }

  .directory-actions {
    gap: 8px;
    margin-left: auto;
    font-size: 13px;
  }

  .directory-actions .lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: 110px;
    height: 36px;
    min-height: 36px;
    flex: 0 0 110px;
    padding: 0 10px;
    border: 1px solid #e1ebf5;
    border-radius: 999px;
    background: #fff;
    color: var(--color-ink);
    box-shadow: 0 5px 14px rgba(30, 92, 148, .05);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.42;
  }

  .directory-actions .lang-btn svg {
    width: 16.25px;
    height: 16.25px;
  }

  .directory-actions .lang-btn [data-dir-icon="globe"],
  .directory-actions .lang-btn [data-dir-icon="chevron-down"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .directory-actions .lang-btn [data-dir-icon="globe"] {
    width: 16.25px;
    height: 16.25px;
    flex: 0 0 16.25px;
  }

  .directory-actions .lang-btn [data-dir-icon="chevron-down"] {
    width: 16.25px;
    height: 20.7px;
    flex: 0 0 16.25px;
  }

  .mobile-menu-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #dce8f2;
    border-radius: 14px;
    background: #fff;
    color: var(--color-ink);
    box-shadow: 0 8px 20px rgba(29, 86, 139, .08);
  }

  .mobile-menu-btn svg,
  .menu-close svg {
    width: 18px;
    height: 18px;
  }

  .directory-brand {
    gap: 8px;
  }

  .brand-planet {
    width: 27px;
    height: 27px;
    border-width: 2px;
  }

  .brand-planet::before {
    left: 7px;
    right: 7px;
    top: 2px;
    bottom: 2px;
    border-width: 1.5px;
  }

  .brand-planet::after {
    left: 3px;
    right: 3px;
    top: 10px;
    height: 2px;
    border-top-width: 2px;
    box-shadow: 0 -6px 0 -1.5px #08ae64, 0 6px 0 -1.5px #08ae64;
  }

  .brand-word {
    font-size: 18.6px;
    font-weight: 850;
  }

  .menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
    background: rgba(7, 23, 50, .38);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }

  .menu-backdrop[hidden] {
    display: block;
  }

  .mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 31;
    display: flex;
    flex-direction: column;
    width: min(86vw, 340px);
    height: 100dvh;
    padding: 18px;
    border-left: 1px solid #dce8f2;
    background:
      radial-gradient(circle at 88% 8%, rgba(0, 192, 127, .12), transparent 24%),
      #fff;
    box-shadow: -24px 0 60px rgba(8, 32, 72, .18);
    transform: translateX(102%);
    transition: transform .26s ease;
  }

  body.menu-open {
    overflow: hidden;
  }

  body.menu-open .menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.menu-open .mobile-menu {
    transform: translateX(0);
  }

  .mobile-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid #edf3f8;
  }

  .mobile-menu__logo {
    width: 138px;
    height: auto;
  }

  .menu-close {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #dce8f2;
    border-radius: 14px;
    background: #fff;
    color: var(--color-ink);
    box-shadow: 0 8px 20px rgba(29, 86, 139, .08);
  }

  .mobile-menu__nav {
    display: grid;
    gap: 8px;
    padding: 20px 0;
  }

  .mobile-menu__nav a,
  .mobile-menu__tools a {
    color: var(--color-ink);
    text-decoration: none;
  }

  .mobile-menu__nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid #e2edf6;
    border-radius: 14px;
    background: #f8fcff;
    font-size: 15px;
    font-weight: 750;
  }

  .mobile-menu__tools {
    display: grid;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid #edf3f8;
  }

  .mobile-menu__tools a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-muted);
    font-size: 14px;
    font-weight: 650;
  }

  .mobile-menu__tools .primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(180deg, #12bd72, #00a85c);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(0, 166, 87, .22);
  }

  .brand-word {
    font-size: 18.6px;
    font-weight: 850;
  }

  .brand-planet {
    width: 27px;
    height: 27px;
    border-width: 2px;
  }

  .hero-copy h1 {
    font-size: 32px;
    text-align: left;
  }

  .hero-copy p {
    font-size: 14px;
    text-align: left;
  }

  .hero-search {
    width: 100%;
    max-width: 100%;
    height: auto;
    flex-wrap: wrap;
    margin-bottom: 14px;
  }

  .hero-search input {
    height: 44px;
  }

  .hero-search button {
    width: 100%;
    height: 42px;
  }

  .hero-category-chips,
  .browse-categories,
  .sort-tabs {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hero-category-chips::-webkit-scrollbar,
  .browse-categories::-webkit-scrollbar,
  .sort-tabs::-webkit-scrollbar {
    display: none;
  }

  .hero-chip,
  .category-tab,
  .sort-tab {
    flex: 0 0 auto;
  }

  .browse-heading,
  .browse-filter-row,
  .pagination-area,
  .related-inner,
  .newsletter-inner,
  .cookie-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .browse-heading {
    gap: 12px;
    justify-content: flex-start;
  }

  .browse-heading > div:first-child {
    flex: 0 0 auto;
  }

  .browse-filter-row {
    gap: 12px;
    justify-content: flex-start;
    margin-top: 0;
    padding-left: 0;
  }

  .unit-btn {
    align-self: flex-start;
    margin-left: 0;
  }

  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
    border: 1px solid #dce6f2;
    border-radius: 12px;
  }

  .calculator-card {
    min-height: 78px;
    padding: 12px 42px 12px 12px;
    border: 0;
    border-bottom: 1px solid #dce6f2;
    border-radius: 0;
    box-shadow: none;
  }

  .calculator-card:last-child {
    border-bottom: 0;
  }

  .card-icon {
    width: 44px;
    height: 44px;
  }

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

  .card-copy h2 {
    font-size: 13px;
  }

  .card-copy p {
    display: none;
  }

  .pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .page-prev {
    order: 1;
  }

  .page-next {
    order: 3;
  }

  .page-number,
  .page-ellipsis {
    display: none;
  }

  .pagination::before {
    content: "Page " attr(data-current-page) " of " attr(data-total-pages);
    order: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #071b43;
    font-size: 13px;
    font-weight: 800;
  }

  .directory-newsletter form {
    width: 100%;
    margin-left: 0;
  }

  .newsletter-copy {
    min-width: 0;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .footer-columns section {
    border-bottom: 1px solid #e7eef7;
  }

  .footer-columns button {
    display: flex;
    min-height: 46px;
    width: 100%;
  }

  .footer-columns button svg {
    display: block;
  }

  .footer-columns a {
    max-height: 0;
    overflow: hidden;
    line-height: 1;
    transition: max-height .2s ease, padding .2s ease;
  }

  .footer-columns section.is-open a {
    max-height: 34px;
    padding-bottom: 12px;
  }

  .footer-meta .lang-btn {
    align-self: flex-start;
  }
}

@media (max-width: 760px) {
  .directory-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
    width: calc(100% - 32px);
    height: 60px;
    margin-left: 16px;
    margin-right: 16px;
    padding: 0;
    border-bottom: 0;
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: none;
    backdrop-filter: blur(14px);
  }

  .directory-header .header-inner {
    display: contents;
  }

  .directory-header .directory-brand {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    max-width: 150px;
    height: 32px;
    flex: 0 0 auto;
    background: none;
  }

  .directory-header .directory-brand .brand-word {
    display: inline-flex;
    font-size: 17px;
    line-height: 1;
  }

  .directory-header .directory-brand .brand-mark-img {
    display: block;
    width: 30px;
    height: 30px;
  }

  .directory-header .mobile-menu-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid #dce8f2;
    border-radius: 14px;
    background: #fff;
    color: var(--color-ink);
    box-shadow: 0 8px 20px rgba(29, 86, 139, .08);
  }
}

@media (max-width: 760px) {
  body:not(.menu-open) .mobile-menu {
    display: none !important;
  }

  body.menu-open .mobile-menu {
    display: flex !important;
  }
}

/* Mobile usability baseline shared by every calculator page.
   Keep page-specific art direction, while preventing narrow-screen overflow. */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body {
    -webkit-text-size-adjust: 100%;
  }

  main,
  section,
  article,
  form,
  fieldset,
  .container,
  .content,
  .page-shell,
  .tool-shell,
  .calculator-shell,
  .calculator-layout,
  .calculator-panel,
  .calculator-card,
  .result-card,
  .results-card,
  .tool-card {
    min-width: 0;
    max-width: 100%;
  }

  :where(.hero, .tool-hero, .calculator-hero, .detail-hero, .utility-hero,
    .finance-hero, .developer-hero, .chemistry-hero, .engineering-hero,
    .health-hero, .converter-hero, .hero-inner, .hero-grid,
    .calculator-layout, .tool-layout, .input-output-grid, .workspace-grid,
    .result-layout, .results-grid, .content-grid) {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  :where(.hero, .tool-hero, .calculator-hero, .detail-hero, .utility-hero,
    .finance-hero, .developer-hero, .chemistry-hero, .engineering-hero,
    .health-hero, .converter-hero) {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  :where(h1, .hero-title, .tool-title) {
    max-width: 100%;
    font-size: clamp(2rem, 10vw, 3rem) !important;
    line-height: 1.05 !important;
    overflow-wrap: anywhere;
  }

  :where(h2, h3, p, li, label, .result-value, .metric-value, .formula) {
    overflow-wrap: anywhere;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  button {
    min-height: 44px;
    max-width: 100%;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    width: 100%;
    font-size: 16px !important;
  }

  :where(.button-row, .action-row, .form-actions, .calculator-actions,
    .tool-actions, .result-actions, .hero-actions) {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
  }

  :where(.button-row, .action-row, .form-actions, .calculator-actions,
    .tool-actions, .result-actions, .hero-actions) > :where(button, .btn, a) {
    flex: 1 1 140px;
    justify-content: center;
  }

  :where(.table-wrap, .table-responsive, .result-table, .schedule-table,
    .breakdown-table, .data-table-wrap) {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  table {
    max-width: none;
  }

  pre,
  code,
  .formula-box,
  .code-output,
  .json-output {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  img,
  svg,
  canvas,
  video {
    max-width: 100%;
    height: auto;
  }

  .language-menu {
    position: fixed !important;
    top: 68px !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(70vh, 520px);
    overflow-y: auto;
  }

  .site-footer,
  .directory-footer,
  .footer-inner {
    max-width: 100%;
    overflow: hidden;
  }
}

@media (max-width: 380px) {
  .directory-header {
    width: calc(100% - 20px);
    margin-left: 10px;
    margin-right: 10px;
    gap: 8px;
  }

  .directory-header .directory-brand {
    width: 108px;
  }

  .directory-actions .lang-btn,
  body.directory-page .directory-actions .lang-btn {
    width: 92px;
    flex-basis: 92px;
    padding-inline: 8px;
  }
}
