/* Small, blocking safeguards for viewport overflow. */
html {
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}

/* Keep hover states, but animate only compositor-friendly properties. */
.btn,
.btn--action {
  transition: transform .18s ease, opacity .18s ease;
}

.header-calc-btn {
  transition: transform .15s ease;
}

.site-nav {
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), visibility 0s .35s;
}

.site-nav.is-open {
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

/* Keep the first calculator layout stable while Heebo finishes loading. */
.calc__label {
  line-height: 1.4;
}

.calc .input {
  line-height: 1.3;
}

input[data-numformat-applied="1"] {
  text-align: right;
}

/* Fieldsets keep calculator tracks grouped without browser default chrome. */
.track {
  min-inline-size: 0;
  margin-inline: 0;
}

.track__legend {
  padding: 0;
}

@media (max-width: 400px) {
  .site-header .container {
    gap: 6px;
    padding-inline: 10px;
  }

  .brand__name {
    display: none;
  }

  .brand__logo {
    width: 38px;
    height: 38px;
  }

  .mobile-menu-toggle {
    padding: 8px;
  }

  .header-calc-btn {
    margin-inline-start: 0;
    padding: 8px 10px !important;
    gap: 4px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  .breadcrumbs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .breadcrumbs::-webkit-scrollbar {
    display: none;
  }

  .breadcrumbs ol {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
  }

  .breadcrumbs li {
    white-space: nowrap;
  }

  .field__tip::after {
    inset-inline-end: 0;
    width: min(280px, calc(100vw - 32px));
    min-width: 0;
    max-width: none;
    transform: translate(0, -8px);
  }

  .field__tip:hover::after,
  .field__tip:focus-visible::after {
    transform: translate(0, -12px);
  }
}
