  /* Accessibility helpers */
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 1px, 1px);
    white-space: nowrap; border: 0;
  }
  .visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px; height: 1px; overflow: hidden;
    clip: rect(0,0,1px,1px); white-space: nowrap;
  }
  .skip-link {
    position: absolute; left: 1rem; top: 0.5rem; z-index: 1100;
    background: #111; color: #fff; padding: .5rem .75rem; border-radius: .25rem;
  }
  :root {
    --brand-primary: #f97316;
    --brand-dark: #ea580c;
    --grey-100: #f8f9fa;
    --grey-200: #e9ecef;
    --grey-700: #495057;
    --text-primary: #212529;
    --white: #ffffff;
  }

  body {
    background-color: var(--white);
    font-family: 'Roboto', sans-serif;
    color: var(--text-primary);
  }

  .header-logo {
    height: auto;
    width: auto;
    /* Match client header: target ~88px, allow downscale based on viewport and remaining space */
    max-height: 88px;
    max-width: min(60vw, 320px, calc(100% - 64px));
    object-fit: contain;
  }
  @media (max-width: 575.98px) {
    .header-logo { max-height: 72px; max-width: min(70vw, 280px, calc(100% - 64px)); }
  }

  .header {
    background-color: var(--white);
    border-bottom: 1px solid var(--grey-200);
    position: sticky;
    top: 0;
    z-index: 1020;
  }
  /* Keep header contents on one line; HTML sets flex-wrap, override here */
  .header > .container { flex-wrap: nowrap !important; gap: .75rem; }
  .header .btn-brand { white-space: nowrap; }
  @media (max-width: 575.98px) {
    .header .btn-brand { padding: .4rem .7rem; font-size: .95rem; }
  }
  
  .main-content {
      flex-grow: 1;
  }
  
  .hero-section {
    position: relative;
    padding: 4rem 1rem;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)), url("../images/hero_bg.jpg");
    /* Mobile-safe default to avoid jank */
    background-attachment: scroll;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transition: padding 0.5s ease-in-out;
  }

  /* Enable fixed background only on larger screens */
  @media (min-width: 992px) {
    .hero-section {
      background-attachment: fixed;
    }
  }

  .hero-section.results-active {
      justify-content: flex-start;
      padding-top: 5rem;
      padding-bottom: 5rem;
  }
  
  .hero-title {
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--white);
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
  }

  .hero-subtitle {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  }
  
  .track-form-wrapper {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    border-radius: 30px;
  }
  
  #track-input {
    height: 56px;
    border-radius: 28px;
    padding-left: 24px;
    padding-right: 120px;
    border: 1px solid transparent;
    background-color: var(--white);
  }
  #track-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2);
    outline: none;
  }
  
  .track-button {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    height: 40px;
    width: 100px;
    border-radius: 20px;
    font-weight: 500;
  }

  .btn-brand {
      background-color: var(--brand-primary);
      color: var(--white);
      border-color: var(--brand-primary);
      font-weight: 500;
      transition: background-color 0.2s ease, border-color 0.2s ease;
  }
  .btn-brand:hover {
      background-color: var(--brand-dark);
      color: var(--white);
      border-color: var(--brand-dark);
  }
  
  #result .card {
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
  }
  #result .alert {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
  }

  /* Smart flexible result card sizing */
  .result-card {
    width: 100%;
    max-width: calc(100vw - 2rem); /* Full viewport minus margin */
    margin: 0 auto;
  }

  /* Dynamic card sizing based on content and viewport */
  @media (min-width: 576px) {
    .result-card { max-width: calc(100vw - 4rem); }
  }
  @media (min-width: 768px) {
    .result-card { max-width: calc(100vw - 6rem); }
  }
  @media (min-width: 992px) {
    .result-card { max-width: calc(100vw - 8rem); }
  }
  @media (min-width: 1200px) {
    .result-card { max-width: calc(100vw - 10rem); }
  }
  @media (min-width: 1400px) {
    .result-card { max-width: min(calc(100vw - 12rem), 1400px); }
  }

  /* Legacy stepper overrides - now handled by smart system */

  .content-section {
      padding: 5rem 1rem;
  }
  .section-title {
      text-align: center;
      font-weight: 700;
      font-size: 2.25rem;
      margin-bottom: 1rem;
  }
  .section-subtitle {
      text-align: center;
      color: var(--grey-700);
      max-width: 700px;
      margin-left: auto;
      margin-right: auto;
      margin-bottom: 4rem;
  }
  
  .feature-card, .service-card {
      background-color: var(--white);
      border: 1px solid var(--grey-200);
      border-radius: 16px;
      padding: 2rem;
      text-align: center;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      height: 100%;
  }
  .feature-card:hover, .service-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  }
  
  .feature-icon, .service-icon {
      font-size: 3rem;
      color: var(--brand-primary);
      margin-bottom: 1.5rem;
      display: inline-block;
  }
  
  .card-title-custom {
      font-weight: 500;
      font-size: 1.25rem;
      margin-bottom: 0.75rem;
  }
  
  .card-text-custom {
      color: var(--grey-700);
      font-size: 0.95rem;
  }

  .bg-light-alt {
      background-color: var(--grey-100);
  }

  .main-footer {
    background-color: var(--text-primary);
    color: var(--grey-200);
    padding: 3rem 1rem 1rem;
  }
  .main-footer a {
    color: var(--grey-200);
    text-decoration: none;
  }
  .main-footer a:hover {
    color: var(--brand-primary);
    text-decoration: underline;
  }
  .footer-bottom {
      border-top: 1px solid #495057;
      padding-top: 1rem;
      margin-top: 2rem;
      color: #adb5bd;
  }

  /* Respect user reduced motion preferences */
  @media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  }

  /* Smart stepper system */
  .stepper-scroll {
    width: 100%;
    position: relative;
  }
  
  .stepper-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: thin;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
  }

  /* Base stepper styling - will be overridden by JavaScript */
  #publicStepper.stepper {
    display: inline-flex;
    width: max-content;
    list-style: none;
    position: relative;
    font-family: 'Inter', sans-serif;
    padding: 0 1rem;
    gap: 1rem;
    padding-bottom: 1rem;
    margin: 0;
  }

  #publicStepper.stepper .step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    min-width: 140px;
    cursor: pointer;
    scroll-snap-align: start;
  }

  /* Adaptive stepper modes - controlled by JavaScript */
  #publicStepper.stepper.fill-mode {
    display: flex !important;
    width: 100% !important;
    gap: 1.5rem;
  }

  #publicStepper.stepper.fill-mode .step {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: 200px;
  }

  #publicStepper.stepper.scroll-mode {
    display: inline-flex !important;
    width: max-content !important;
    gap: 1rem;
  }

  #publicStepper.stepper.scroll-mode .step {
    flex: 0 0 auto !important;
    min-width: 140px !important;
  }

  /* Scroll indicators */
  .stepper-container::-webkit-scrollbar {
    height: 4px;
  }
  .stepper-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
  }
  .stepper-container::-webkit-scrollbar-thumb {
    background: var(--brand-primary);
    border-radius: 2px;
  }
  
  /* Scroll buttons */
  .stepper-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    background: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  }
  .stepper-scroll-btn i { font-size: 1.1rem; }
  .stepper-scroll-btn:hover { background: var(--brand-dark); }
  .stepper-scroll-btn:focus { outline: none; }
  .stepper-scroll-btn:focus-visible { box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.3), 0 4px 14px rgba(0,0,0,0.15); }
  
  .stepper-scroll-btn.prev { left: 6px; }
  .stepper-scroll-btn.next { right: 6px; }
  
  .stepper-scroll.is-overflowing .stepper-scroll-btn {
    display: inline-flex !important;
  }

  /* Responsive adjustments */
  @media (max-width: 991.98px) {
    .hero-section {
      /* Avoid iOS jank with fixed backgrounds */
      background-attachment: scroll;
      /* Slightly darker overlay on mobile for better contrast */
      background-image: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)), url("../images/hero_bg.jpg");
      min-height: 100svh;
      padding-top: max(3rem, env(safe-area-inset-top));
      padding: 3rem 1rem;
    }
    .hero-title { font-size: 2.25rem; }
    .hero-subtitle { font-size: 1rem; }
  }

  @media (max-width: 575.98px) {
    .track-form-wrapper {
      box-shadow: none;
      border-radius: 16px;
    }
    #track-input {
      padding-right: 16px; /* remove extra space when button stacks */
    }
    .track-button {
      position: static;
      transform: none;
      width: 100%;
      height: 44px;
      border-radius: 12px;
      margin-top: .5rem;
    }
  }

  /* Button disabled state for tracking */
  .track-button:disabled,
  .btn-brand:disabled {
    opacity: 0.75;
    cursor: not-allowed;
  }
