/* Shared responsive navigation and touch improvements. */
.mobile-nav .mobile-menu { position: static; margin: 0; padding: 0; border: 0; background: transparent; }
.mobile-menu > summary { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 14px; border: 1px solid #cbdde6; border-radius: 12px; color: #10263a; background: #fff; font: 700 14px/1.4 system-ui,sans-serif; list-style: none; }
.mobile-menu > summary::-webkit-details-marker { display: none; }
.mobile-menu > summary::after { content: '☰'; margin-left: 8px; }
.mobile-menu[open] > summary::after { content: '×'; }
.mobile-menu-panel { position: absolute; top: 100%; left: 14px; right: 14px; display: grid; gap: 3px; padding: 12px; max-height: calc(100dvh - 100px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid #cbdde6; border-radius: 16px; background: #fff; box-shadow: 0 16px 40px #10263a24; }
.mobile-nav .mobile-menu-panel a { display: flex; align-items: center; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 9px; font-size: 15px; }
.mobile-menu-panel a:hover, .mobile-menu-panel a:focus-visible { background: #eefbfd; }
.mobile-nav .mobile-menu-panel .mobile-purchase { background: #27bfd8; }
:where(a,button,summary,input,select,textarea):focus-visible { outline: 3px solid #0b86a4; outline-offset: 3px; }
@media (max-width: 1200px) {
  .nav-wrap nav { min-height: 68px; gap: 12px; }
  .nav-wrap .nav-links { display: none; }
  .nav-wrap .menu-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 14px; }
  .nav-wrap .mobile-nav { display: flex; align-items: center; margin-left: auto; }
  .nav-wrap #navLinks { position: absolute; top: 100%; left: 14px; right: 14px; flex-direction: column; align-items: stretch; gap: 0; padding: 10px; max-height: calc(100dvh - 100px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid #d7e4ed; border-radius: 16px; background: #fff; box-shadow: 0 16px 40px #10263a24; }
  .nav-wrap #navLinks.open { display: flex; }
  .nav-wrap #navLinks a { min-height: 44px; padding: 12px; }
}
@media (max-width: 820px) {
  html { scroll-padding-top: 84px; }
  input:not([type=hidden]), select, textarea, .brief-form input, .brief-form select, .brief-form textarea { font-size: 16px !important; min-height: 48px; max-width: 100%; }
  button, .btn, .category-purchase, .mobile-nav a { min-height: 44px; }
  .hero, .page-hero { padding: 0; }
  .hero-grid, .page-hero-grid { padding: 34px 0 40px; gap: 28px; }
  .hero-grid > *, .page-hero-grid > *, .checkout-grid > *, .brief-builder > * { min-width: 0; }
  .brand { gap: 8px; }
  .brand span { font-size: 14px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  h1 { font-size: clamp(36px, 10vw, 48px); overflow-wrap: break-word; }
  .hero-actions .btn { flex-grow: 1; }
  .contact-card, .footer-links, .card, .hero-note { overflow-wrap: anywhere; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .mobile-cta { bottom: max(10px, env(safe-area-inset-bottom)) !important; }
  body:has(.mobile-cta) { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .fcl-chat-root .fcl-chat-close { width: 44px; height: 44px; flex-basis: 44px; }
  .fcl-chat-root .fcl-chat-action, .fcl-chat-root .fcl-chat-quick button { min-height: 44px; font-size: 13px; }
  .fcl-chat-root .fcl-chat-quick { max-height: 60px; }
  .fcl-chat-root .fcl-chat-form input { font-size: 16px; }

}
@media (max-width: 360px) {
  .nav-wrap .brand span { font-size: 12px; }
  .brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
  .nav-wrap nav { gap: 8px; }
  .topbar-inner { gap: 8px; flex-wrap: wrap; padding: 12px 0; }
  .hero-card, .hero-card-main, .brief-form, .brief-result { padding: 18px; }
}

/* Keep secondary navigation separate from support on every screen. */
body .back-top { left: max(16px, env(safe-area-inset-left)); right: auto; bottom: max(20px, env(safe-area-inset-bottom)); width: 48px; height: 48px; }
@media (max-width: 820px) {
  body { --mobile-action-bottom: max(12px, env(safe-area-inset-bottom)); }
  body:has(.mobile-cta) { --mobile-action-bottom: calc(88px + env(safe-area-inset-bottom)); }
  body .back-top { left: max(12px, env(safe-area-inset-left)); bottom: var(--mobile-action-bottom); }
  .fcl-chat-root .fcl-chat-launcher-wrap { right: max(12px, env(safe-area-inset-right)); bottom: var(--mobile-action-bottom); }
  .fcl-chat-root .fcl-chat-launcher { width: 52px; height: 52px; min-height: 52px; padding: 0; justify-content: center; }
  .fcl-chat-root .fcl-chat-launcher-label { display: none; }
  body.fcl-chat-open .back-top, body.fcl-chat-open .mobile-cta,
  body.fcl-chat-open .fcl-chat-launcher-wrap { visibility: hidden; pointer-events: none; }
  body.fcl-chat-open { overflow: hidden; }
  .fcl-chat-root:has(.fcl-chat-panel:not([hidden]))::before { content: ''; position: fixed; inset: 0; background: #10253b66; }
  .fcl-chat-root .fcl-chat-panel {
    top: calc(var(--chat-viewport-top, 0px) + 8px + env(safe-area-inset-top));
    bottom: auto; right: 8px; width: calc(100% - 16px);
    height: calc(var(--chat-viewport-height, 100dvh) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: none; border-radius: 20px;
  }
  .fcl-chat-root .fcl-chat-messages { overscroll-behavior: contain; }
  .fcl-chat-root .fcl-chat-bubble { font-size: 14px; }
  .fcl-chat-root .fcl-chat-header h2 { font-size: 24px; }
  .fcl-chat-root .fcl-chat-form { padding: 10px 12px; }
  .fcl-chat-root .fcl-chat-form button { min-height: 48px; font-size: 14px; }
  .fcl-chat-root .fcl-chat-footer { font-size: 12px; padding-bottom: 10px; }
}
@media (max-width: 820px) and (max-height: 500px) {
  .fcl-chat-root .fcl-chat-header { padding: 8px 12px; }
  .fcl-chat-root .fcl-chat-header p, .fcl-chat-root .fcl-chat-strip,
  .fcl-chat-root .fcl-chat-quick, .fcl-chat-root .fcl-chat-footer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body .back-top { transition: none; }
}

/* Author display rules must not reveal inactive validation messages. */
.quantity-warning[hidden] { display: none !important; }
