:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8faff;
  --surface-3: #eef4ff;
  --text: #102044;
  --muted: #6f7c98;
  --line: #dfe6f3;
  --line-strong: #cdd8ea;
  --shadow: 0 10px 30px rgba(18, 40, 86, 0.06), 0 2px 8px rgba(18, 40, 86, 0.03);
  --shadow-soft: 0 8px 24px rgba(18, 40, 86, 0.05);
  --radius: 26px;
  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 18px;
  --blue: #246bff;
  --blue-dark: #154fcb;
  --blue-soft: #e9f1ff;
  --success: #1e8c62;
  --warning: #f58e2c;
  --max: 1220px;
  --header: 84px;
  --bottom-nav: 86px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #fbfcff 0%, var(--bg) 26%, #f4f5fb 100%);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom, 0px));
}

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

button,
input {
  font: inherit;
}

img,
svg {
  display: block;
}

.app-shell {
  min-height: 100vh;
}

.app-container {
  width: min(var(--max), calc(100vw - 24px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(223, 230, 243, 0.9);
}

.topbar {
  min-height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.logo-box,
.category-icon,
.tool-icon,
.trust-icon,
.inline-icon,
.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  flex: 0 0 auto;
}

.logo-box {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--blue-soft) 0%, #dde9ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.logo-box svg,
.category-icon svg,
.tool-icon svg,
.trust-icon svg,
.inline-icon svg,
.stat-icon svg,
.header-action svg {
  width: 24px;
  height: 24px;
}

.topbar-center,
.topbar-right,
.desktop-nav,
.desktop-search,
.search-results,
.footer-desktop,
.hero-visual,
.breadcrumb,
.site-footer {
  display: none;
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.header-action {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.header-action:active {
  transform: scale(0.98);
}

.mobile-search-panel,
.mobile-menu-panel {
  display: none;
  padding: 0 0 14px;
}

.mobile-search-panel.show,
.mobile-menu-panel.show {
  display: block;
}

.mobile-menu-links {
  display: grid;
  gap: 10px;
}

.mobile-menu-link {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  font-weight: 700;
}

.mobile-menu-link.active {
  color: var(--blue);
  border-color: rgba(47, 109, 247, 0.24);
}

.search-shell,
.hero-search,
.page-search {
  position: relative;
}

.search-field,
.search-field-main {
  width: 100%;
  height: 58px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  padding: 0 18px 0 56px;
  outline: none;
}

.search-field::placeholder,
.search-field-main::placeholder {
  color: #8a95af;
}

.search-lead,
.page-search .search-lead,
.hero-search .search-lead {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #7d89a5;
}

.search-lead svg {
  width: 24px;
  height: 24px;
}

.search-submit {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #2f7cff 0%, var(--blue) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(36, 107, 255, 0.25);
}

.search-submit svg {
  width: 22px;
  height: 22px;
}

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-results.show {
  display: block;
}

.search-item,
.search-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
}

.search-item + .search-item {
  border-top: 1px solid #edf1f8;
}

.search-item strong {
  font-size: 14px;
}

.search-item span,
.search-empty {
  color: var(--muted);
  font-size: 13px;
}

.page-wrap {
  padding: 22px 0 28px;
}

.mobile-frame,
.panel,
.list-card,
.tool-card,
.category-card,
.trust-card,
.trust-panel,
.empty-state,
.content-panel,
.calc-shell-panel,
.calc-fallback {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(223, 230, 243, 0.9);
  box-shadow: var(--shadow);
}

.hero-section {
  padding: 10px 0 4px;
}

.hero-stack {
  padding: 12px 0 0;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #d7e4ff;
  background: #f7faff;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
}

.hero-title {
  margin: 0;
  font-size: clamp(42px, 13vw, 74px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  font-weight: 800;
}

.hero-title .accent {
  color: var(--blue);
}

.hero-subtitle,
.page-subtitle {
  max-width: 720px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: clamp(18px, 4.8vw, 24px);
  line-height: 1.45;
}

.hero-search {
  margin: 24px auto 0;
  max-width: 720px;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 18px 0 0;
  border-radius: 24px;
  overflow: hidden;
}

.stat-tile {
  padding: 18px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: left;
}

.stat-tile + .stat-tile {
  border-left: 1px solid #edf1f8;
}

.stat-copy strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.stat-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.section-block {
  margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  margin: 0;
  font-size: clamp(18px, 5vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.section-link {
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.category-card {
  border-radius: 22px;
  padding: 14px 10px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.category-card .category-icon {
  width: 52px;
  height: 52px;
}

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

.category-card span {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}


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

.directory-card {
  border-radius: 22px;
  padding: 18px 16px;
  min-height: 108px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(223, 230, 243, 0.9);
  box-shadow: var(--shadow);
}

.directory-card .category-icon {
  width: 42px;
  height: 42px;
}

.directory-card strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.directory-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

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

.tool-card {
  border-radius: 22px;
  padding: 16px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

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

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

.tool-card h3,
.tool-card-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tool-copy {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 6px;
}

.tool-meta,
.tool-card-desc {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.tool-card.category-card,
.tool-card.directory-card,
.tool-card.trust-card,
.tool-card.list-card {
  padding: 16px;
  min-height: 132px;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
}

.chevron {
  color: #8a95af;
  margin-left: auto;
  flex: 0 0 auto;
}

.chevron svg {
  width: 22px;
  height: 22px;
}

.page-hero {
  text-align: center;
  padding: 16px 0 6px;
}

.page-hero-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  margin: 0;
  font-size: clamp(24px, 10vw, 48px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.page-hero .category-icon,
.page-hero .trust-icon {
  width: 52px;
  height: 52px;
}

.page-search {
  margin: 22px 0 0;
}

.list-stack {
  display: grid;
  gap: 14px;
}

.list-card {
  border-radius: 20px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.list-card .tool-icon,
.list-card .trust-icon,
.list-card .category-icon {
  width: 42px;
  height: 42px;
}

.list-card strong,
.trust-card strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.list-card span,
.trust-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.trust-stack {
  display: grid;
  gap: 14px;
}

.trust-card {
  border-radius: 22px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.trust-panel {
  border-radius: 24px;
  padding: 22px 18px;
  margin-top: 14px;
}

.trust-panel h3,
.content-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.trust-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.trust-point {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.trust-links-inline {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef2f8;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 700;
}

.trust-panel-head p {
  margin: 8px 0 0;
  color: #55637f;
  font-size: 14px;
  line-height: 1.7;
}

.trust-links-grid {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef2f8;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trust-link-chip {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid #e7ecf5;
  border-radius: 16px;
  background: #fbfcff;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.policy-panel {
  display: grid;
  gap: 18px;
}

.policy-intro {
  margin: 0;
  font-size: 15px;
  line-height: 1.78;
  color: #43506b;
}

.policy-section {
  padding-top: 2px;
}

.policy-section h3 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 800;
  color: var(--text);
}

.policy-section p + p {
  margin-top: 10px;
}

.content-panel {
  border-radius: 28px;
  padding: 24px 20px;
}

.content-panel p,
.content-panel li {
  color: #46536f;
  font-size: 15px;
  line-height: 1.72;
}

.content-panel ul {
  margin: 0;
  padding-left: 18px;
}

.content-panel .subtle {
  color: var(--muted);
}

.footer-links-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 18px;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 700;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(245, 247, 251, 0) 0%, rgba(245, 247, 251, 0.92) 35%, rgba(245, 247, 251, 0.98) 100%);
}

.bottom-nav-inner {
  width: min(780px, calc(100vw - 16px));
  margin: 0 auto;
  border-radius: 28px;
  border: 1px solid rgba(223, 230, 243, 0.96);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(18, 40, 86, 0.12);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.bottom-link {
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #7d89a5;
  font-size: 12px;
  font-weight: 700;
}

.bottom-link svg {
  width: 23px;
  height: 23px;
}

.bottom-link.active {
  color: var(--blue);
}

.empty-state {
  border-radius: 24px;
  padding: 24px 18px;
  text-align: center;
}

.empty-state p {
  margin: 10px 0 0;
  color: var(--muted);
}

.inline-button,
.cta-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 16px;
  padding: 0 18px;
  min-height: 48px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}

.cta-button {
  background: linear-gradient(180deg, #2f7cff 0%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(36, 107, 255, 0.24);
}

.secondary-button {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.simple-list {
  display: grid;
  gap: 12px;
}

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

.simple-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(223, 230, 243, 0.92);
  box-shadow: var(--shadow-soft);
}

.simple-link span:last-child,
.muted {
  color: var(--muted);
}

.calc-shell-panel,
.calc-fallback {
  border-radius: 30px;
  padding: 18px;
  overflow: hidden;
}

.calc-embed-wrap {
  width: 100%;
}

.calc-embed-frame {
  width: 100%;
  min-height: 520px;
  border: 0;
  border-radius: 18px;
  background: transparent;
}

.code-path {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-3);
  color: var(--blue-dark);
  font-size: 14px;
  word-break: break-word;
}

.related-header {
  margin: 28px 0 14px;
}

.page-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

@media (min-width: 768px) {
  .directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  body {
    padding-bottom: 40px;
  }

  .page-wrap {
    padding: 42px 0 56px;
  }

  .hero-section {
    padding-top: 22px;
  }

  .hero-title {
    font-size: clamp(56px, 8vw, 88px);
  }

  .hero-subtitle,
  .page-subtitle {
    font-size: 21px;
  }

  .category-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
  }

  .category-card {
    min-height: 136px;
    padding: 18px 14px;
  }

  .category-card span {
    font-size: 15px;
  }

  .tool-grid,
  .popular-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .tool-card {
    min-height: 152px;
    padding: 20px;
  }

  .list-stack,
  .trust-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .list-card {
    padding: 18px 20px;
  }

  .trust-panel {
    padding: 26px 24px;
  }
}

@media (min-width: 980px) {
  .directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  body {
    padding-bottom: 0;
  }

  .topbar {
    gap: 20px;
  }

  .topbar-center,
  .topbar-right,
  .desktop-nav,
  .desktop-search,
  .site-footer,
  .footer-desktop {
    display: flex;
  }

  .header-action-group,
  .mobile-search-panel,
  .mobile-menu-panel,
  .bottom-nav {
    display: none !important;
  }

  .topbar-center {
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
  }

  .desktop-nav {
    align-items: center;
    gap: 28px;
  }

  .desktop-nav a {
    color: #51607c;
    font-size: 15px;
    font-weight: 700;
  }

  .desktop-nav a.active,
  .desktop-nav a:hover {
    color: var(--text);
  }

  .topbar-right {
    align-items: center;
    gap: 14px;
  }

  .desktop-search {
    width: min(360px, 32vw);
    position: relative;
  }

  .desktop-search .search-field {
    height: 52px;
    padding-right: 18px;
    border-radius: 18px;
    box-shadow: none;
  }

  .hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    align-items: center;
    gap: 42px;
  }

  .hero-stack {
    text-align: left;
    padding-top: 24px;
  }

  .hero-subtitle {
    margin-left: 0;
    margin-right: 0;
  }

  .hero-search {
    margin-left: 0;
    margin-right: 0;
  }

  .hero-visual {
    display: block;
  }

  .hero-window {
    padding: 24px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(223, 230, 243, 0.96);
    box-shadow: 0 22px 44px rgba(18, 40, 86, 0.08);
  }

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

  .mini-card {
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid #edf2fa;
    padding: 16px;
    min-height: 124px;
    box-shadow: var(--shadow-soft);
  }

  .mini-card h4 {
    margin: 12px 0 0;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
  }

  .mini-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
  }

  .stats-strip {
    width: fit-content;
    min-width: 620px;
    margin-top: 22px;
  }

  .stat-tile {
    min-width: 206px;
    justify-content: flex-start;
    padding: 20px 22px;
  }

  .section-block {
    margin-top: 34px;
  }

  .section-title {
    font-size: 32px;
  }

  .category-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
  }

  .tool-grid,
  .popular-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .page-hero {
    padding: 10px 0 12px;
  }

  .page-title {
    font-size: 60px;
  }

  .page-search {
    max-width: 760px;
    margin: 26px auto 0;
  }

  .list-stack {
    grid-template-columns: 1fr;
  }

  .list-card {
    padding: 20px 24px;
  }

  .trust-stack {
    grid-template-columns: 1fr;
  }

  .site-footer {
    margin-top: 54px;
    padding: 26px 0 40px;
    border-top: 1px solid rgba(223, 230, 243, 0.92);
  }

  .footer-desktop {
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  .footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .footer-brand p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 14px;
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px 18px;
    color: #51607c;
    font-size: 14px;
    font-weight: 700;
  }

  .footer-links a:hover {
    color: var(--text);
  }
}


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

.category-tool-grid .tool-card {
  min-height: 154px;
  padding: 18px 14px;
  border-radius: 24px;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
}

.category-tool-grid .tool-card-top {
  justify-content: center;
}

.category-tool-grid .chevron {
  display: none;
}

.category-tool-grid .tool-card .tool-icon {
  width: 52px;
  height: 52px;
}

.category-tool-grid .tool-card .tool-icon svg {
  width: 34px;
  height: 34px;
}

.category-tool-grid .tool-copy {
  gap: 8px;
}

.category-tool-grid .tool-card h3 {
  font-size: 14px;
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
}

.category-tool-grid .tool-meta {
  display: none;
}

@media (min-width: 640px) {
  .category-tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (min-width: 980px) {
  .category-tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }

  .category-tool-grid .tool-card {
    min-height: 166px;
    padding: 20px 16px;
  }

  .category-tool-grid .tool-card h3 {
    font-size: 15px;
  }
}

@media (min-width: 1280px) {
  .category-tool-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}


body.calculator-page .app-container {
  width: calc(100vw - 24px);
  max-width: none;
}

body.calculator-page .page-wrap {
  padding-top: 12px;
}

body.calculator-page .calc-shell-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  overflow: visible;
}

body.calculator-page .calc-embed-wrap {
  width: 100%;
}

body.calculator-page .calc-embed-frame {
  width: 100%;
  min-height: 720px;
  border-radius: 0;
  background: transparent;
}

body.calculator-page #page-mount:empty {
  display: none;
}

@media (min-width: 768px) {
  body.calculator-page .app-container {
    width: calc(100vw - 40px);
  }

  body.calculator-page .calc-embed-frame {
    min-height: 860px;
  }
}

@media (min-width: 980px) {
  body.calculator-page .app-container {
    width: calc(100vw - 40px);
  }

  body.calculator-page .page-wrap {
    padding-top: 18px;
  }

  body.calculator-page .calc-embed-frame {
    min-height: 920px;
  }
}


.breadcrumb-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 18px;
}

.breadcrumb-bar .breadcrumb {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.breadcrumb {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.breadcrumb a,
.breadcrumb .current,
.breadcrumb .sep {
  display: inline-flex;
  align-items: center;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

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

.breadcrumb .current {
  color: var(--text);
}

.breadcrumb .sep {
  color: #b7c0d6;
}

body.calculator-page #page-mount {
  margin-bottom: 16px;
}


.save-calculator-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #97a3bb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.save-calculator-btn:hover {
  color: #e11d48;
  border-color: #f3c1cd;
  background: #fff6f8;
}

.save-calculator-btn:focus-visible {
  outline: 2px solid rgba(36, 107, 255, 0.22);
  outline-offset: 2px;
}

.save-calculator-btn:active {
  transform: scale(0.96);
}

.save-calculator-icon svg {
  width: 15px;
  height: 15px;
}

.save-heart-path {
  fill: transparent;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.save-calculator-btn.is-active {
  color: #e11d48;
  border-color: #f2b8c5;
  background: #fff1f4;
}

.save-calculator-btn.is-active .save-heart-path {
  fill: currentColor;
  stroke: currentColor;
}

.site-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 1200;
}

.site-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 980px) {
  .breadcrumb-bar {
    margin-bottom: 22px;
  }

  .breadcrumb {
    margin-bottom: 0;
    font-size: 14px;
  }
}


/* 4-column card layout update */
@media (min-width: 768px) {
  .category-grid,
  .directory-grid,
  .tool-grid,
  .popular-grid,
  .category-tool-grid,
  .mini-grid,
  .list-stack,
  .trust-stack {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .category-grid,
  .directory-grid,
  .tool-grid,
  .popular-grid,
  .category-tool-grid,
  .mini-grid,
  .list-stack,
  .trust-stack {
    gap: 18px;
  }

  .directory-card,
  .list-card,
  .trust-card {
    min-height: 148px;
    padding: 18px 14px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .directory-card .category-icon,
  .list-card .tool-icon,
  .list-card .trust-icon,
  .list-card .category-icon,
  .trust-card .trust-icon {
    width: 48px;
    height: 48px;
  }

  .directory-card strong,
  .list-card strong,
  .trust-card strong {
    font-size: 15px;
    line-height: 1.25;
  }

  .directory-card span,
  .list-card span,
  .trust-card span {
    font-size: 12px;
    line-height: 1.35;
  }

  .directory-card .chevron,
  .list-card .chevron,
  .trust-card .chevron {
    display: none;
  }

  .mini-card {
    min-height: 144px;
  }
}

@media (min-width: 980px) {
  .category-grid,
  .directory-grid,
  .tool-grid,
  .popular-grid,
  .category-tool-grid,
  .mini-grid,
  .list-stack,
  .trust-stack {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (min-width: 1280px) {
  .category-grid,
  .directory-grid,
  .tool-grid,
  .popular-grid,
  .category-tool-grid,
  .mini-grid,
  .list-stack,
  .trust-stack {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}



/* Mobile 4-column override */
@media (max-width: 639px) {
  .category-grid,
  .directory-grid,
  .tool-grid,
  .popular-grid,
  .category-tool-grid,
  .mini-grid,
  .list-stack,
  .trust-stack,
  .trust-points {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .category-card,
  .tool-card,
  .directory-card,
  .list-card,
  .trust-card,
  .mini-card,
  .trust-point,
  .category-tool-grid .tool-card {
    border-radius: 14px !important;
    padding: 10px 8px !important;
    min-height: 96px !important;
    gap: 8px !important;
  }

  .category-card .category-icon,
  .tool-card .tool-icon,
  .directory-card .category-icon,
  .list-card .tool-icon,
  .list-card .trust-icon,
  .list-card .category-icon,
  .trust-card .trust-icon,
  .category-tool-grid .tool-card .tool-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
  }

  .category-card .category-icon svg,
  .tool-card .tool-icon svg,
  .directory-card .category-icon svg,
  .list-card .tool-icon svg,
  .list-card .trust-icon svg,
  .list-card .category-icon svg,
  .trust-card .trust-icon svg,
  .category-tool-grid .tool-card .tool-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .directory-card,
  .list-card,
  .trust-card,
  .trust-point,
  .category-tool-grid .tool-card {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .tool-card-top {
    gap: 6px !important;
    justify-content: center !important;
  }

  .tool-card .chevron,
  .directory-card .chevron,
  .category-tool-grid .chevron {
    display: none !important;
  }

  .directory-card strong,
  .list-card strong,
  .trust-card strong,
  .tool-card-title,
  .category-card span,
  .mini-card h4,
  .trust-point strong {
    font-size: 11px !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    margin: 0 !important;
  }

  .directory-card span,
  .list-card span,
  .trust-card span,
  .mini-card p,
  .tool-card-desc,
  .trust-point span {
    font-size: 9px !important;
    line-height: 1.2 !important;
    margin-top: 2px !important;
  }

  .mini-card {
    min-height: 96px !important;
  }

  .section-block {
    margin-top: 18px !important;
  }
}

@media (min-width: 820px) {
  .trust-links-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


.footer-contact-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 10px;
  color: #5b6986;
  font-size: 13px;
  font-weight: 700;
}

.footer-contact-inline a {
  color: #2754c5;
}

.contact-box {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.contact-chip {
  display: block;
  border: 1px solid rgba(208, 218, 235, 0.95);
  border-radius: 20px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 30px rgba(18, 40, 86, 0.06);
}

.contact-chip-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 6px 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(39, 84, 197, 0.08);
  color: #2754c5;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.contact-chip strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
}

.contact-chip span:last-child {
  display: block;
  margin-top: 6px;
  color: #60708f;
  font-size: 14px;
  line-height: 1.55;
}

.trust-contact-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(223, 230, 243, 0.9);
  color: #60708f;
  font-size: 14px;
  font-weight: 700;
}

.trust-contact-note a {
  color: #2754c5;
}

.contact-section {
  margin-bottom: 10px;
}

@media (min-width: 980px) {
  .contact-box {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
