/* Shared mobile experience for Miller Bookkeeping & Tax. */
.mbt-mobile-menu-toggle,
.mbt-mobile-back-to-top,
.mbt-mobile-footer-toggle {
  font: inherit;
}

.mbt-mobile-menu-toggle,
.mbt-mobile-back-to-top {
  display: none;
}

.mbt-mobile-menu-panel,
.mbt-mobile-footer-toggle {
  display: none;
}

@media (max-width: 980px) {
  html {
    scroll-padding-top: 12px;
  }

  body {
    overflow-x: hidden;
  }

  body.mbt-menu-open {
    overflow: hidden;
  }

  header.mbt-mobile-header {
    position: relative !important;
    top: auto !important;
    min-height: 0 !important;
    backdrop-filter: none !important;
  }

  .mbt-mobile-header-row {
    width: min(100% - 28px, 1120px) !important;
    margin-inline: auto !important;
    padding: 8px 0 !important;
    min-height: 62px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 8px 12px !important;
  }

  .mbt-mobile-header-row > .brand,
  .mbt-mobile-header-row > .mbt-brand,
  .mbt-mobile-header-row > a.brand {
    min-width: 0 !important;
    width: auto !important;
    max-width: 100% !important;
    flex: initial !important;
    gap: 9px !important;
  }

  .mbt-mobile-header-row .brand-logo,
  .mbt-mobile-header-row .mbt-brand-logo,
  .mbt-mobile-header-row .brand img,
  .mbt-mobile-header-row .mbt-brand img {
    width: 44px !important;
    height: 44px !important;
    max-height: 44px !important;
    object-fit: contain !important;
    border-radius: 7px !important;
    padding: 3px !important;
    flex: 0 0 44px !important;
  }

  .mbt-mobile-header-row .brand strong,
  .mbt-mobile-header-row .mbt-brand strong,
  .mbt-mobile-header-row .brand-text,
  .mbt-mobile-header-row .mbt-brand-text strong {
    font-size: 1rem !important;
    line-height: 1.08 !important;
    white-space: normal !important;
  }

  .mbt-mobile-header-row .brand small,
  .mbt-mobile-header-row .brand span span,
  .mbt-mobile-header-row .mbt-brand span,
  .mbt-mobile-header-row .mbt-brand-text span {
    display: none !important;
  }

  .mbt-mobile-header-row > nav:not(.mbt-mobile-menu-panel),
  .mbt-mobile-header-row > .nav-links,
  .mbt-mobile-header-row > .mbt-nav-links,
  .mbt-mobile-header-row > .top-nav,
  .mbt-mobile-header-row > .header-cta,
  .mbt-mobile-header-row > .mbt-header-cta {
    display: none !important;
  }

  .mbt-mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 86px;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid rgba(217, 186, 106, 0.78);
    border-radius: 7px;
    background: #ffffff;
    color: #06172b;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
  }

  .mbt-mobile-menu-icon,
  .mbt-mobile-menu-icon::before,
  .mbt-mobile-menu-icon::after {
    width: 18px;
    height: 2px;
    display: block;
    background: currentColor;
    border-radius: 2px;
    content: "";
    transition: transform 0.18s ease;
  }

  .mbt-mobile-menu-icon {
    position: relative;
  }

  .mbt-mobile-menu-icon::before,
  .mbt-mobile-menu-icon::after {
    position: absolute;
    left: 0;
  }

  .mbt-mobile-menu-icon::before { top: -6px; }
  .mbt-mobile-menu-icon::after { top: 6px; }

  .mbt-mobile-menu-toggle[aria-expanded="true"] .mbt-mobile-menu-icon {
    background: transparent;
  }

  .mbt-mobile-menu-toggle[aria-expanded="true"] .mbt-mobile-menu-icon::before {
    top: 0;
    transform: rotate(45deg);
  }

  .mbt-mobile-menu-toggle[aria-expanded="true"] .mbt-mobile-menu-icon::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .mbt-mobile-menu-panel {
    grid-column: 1 / -1;
    width: 100%;
    max-height: min(68vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: none;
    margin: 0;
    padding: 7px 0 4px;
    border-top: 1px solid rgba(217, 186, 106, 0.42);
  }

  .mbt-mobile-menu-panel[data-open="true"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .mbt-mobile-menu-panel a,
  .mbt-mobile-menu-panel button {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 11px;
    border: 1px solid rgba(217, 186, 106, 0.25);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    font-size: 0.91rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
  }

  .mbt-mobile-header.mbt-light-header .mbt-mobile-menu-panel a,
  .mbt-mobile-header.mbt-light-header .mbt-mobile-menu-panel button {
    background: #f5f7fb;
    border-color: #d9e2ef;
    color: #06172b;
  }

  .mbt-mobile-menu-panel a[aria-current="page"] {
    border-color: #d9ba6a;
    background: #0b7a4d;
    color: #ffffff;
  }

  .top-note,
  .mbt-top-note {
    padding: 6px 12px !important;
    font-size: 0.74rem !important;
    line-height: 1.3 !important;
    letter-spacing: 0.02em !important;
  }

  main section,
  section {
    scroll-margin-top: 12px;
  }

  .hero,
  .legal-hero {
    min-height: 0 !important;
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }

  h1,
  .hero h1 {
    font-size: clamp(2.15rem, 11vw, 3.15rem) !important;
    line-height: 1.02 !important;
    letter-spacing: 0 !important;
  }

  h2 {
    font-size: clamp(1.7rem, 8vw, 2.35rem) !important;
    line-height: 1.1 !important;
    letter-spacing: 0 !important;
  }

  p,
  li {
    overflow-wrap: anywhere;
  }

  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  input,
  select,
  textarea,
  button {
    max-width: 100%;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .actions,
  .button-row,
  .cta-actions,
  .hero-actions {
    gap: 10px !important;
  }

  .actions .btn,
  .button-row .btn,
  .cta-actions .btn,
  .hero-actions .btn {
    width: 100%;
    min-height: 46px;
  }

  footer,
  .footer,
  .mbt-footer {
    padding-top: 34px !important;
    padding-bottom: 24px !important;
  }

  .mbt-mobile-footer-group > h3 {
    display: none !important;
  }

  .mbt-mobile-footer-toggle {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: #ffffff;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
  }

  .mbt-mobile-footer-toggle::after {
    content: "+";
    color: #d9ba6a;
    font-size: 1.3rem;
  }

  .mbt-mobile-footer-toggle[aria-expanded="true"]::after {
    content: "-";
  }

  .mbt-mobile-footer-group > ul {
    display: none !important;
    padding: 10px 0 5px !important;
  }

  .mbt-mobile-footer-group[data-open="true"] > ul {
    display: grid !important;
  }

  .mbt-mobile-back-to-top {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 9997;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid #d9ba6a;
    border-radius: 50%;
    background: #06172b;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(2, 10, 20, 0.3);
    font-size: 1.45rem;
    font-weight: 900;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  }

  .mbt-mobile-back-to-top[data-visible="true"] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .back-to-top {
    display: none !important;
  }
}

@media (max-width: 390px) {
  .mbt-mobile-header-row {
    width: min(100% - 20px, 1120px) !important;
  }

  .mbt-mobile-menu-panel[data-open="true"] {
    grid-template-columns: 1fr;
  }

  .mbt-mobile-menu-toggle {
    min-width: 74px;
    padding-inline: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .mbt-mobile-back-to-top,
  .mbt-mobile-menu-icon,
  .mbt-mobile-menu-icon::before,
  .mbt-mobile-menu-icon::after { transition: none !important; }
}

@media print {
  .mbt-mobile-menu-toggle,
  .mbt-mobile-menu-panel,
  .mbt-mobile-back-to-top,
  .mbt-mobile-footer-toggle {
    display: none !important;
  }
}
