/* Mobile Auto-Scaling Fix for All Devices */
* {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html {
    /* Use rem units based on device width */
    font-size: calc(14px + 0.5vw);
}

body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    width: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure images scale properly */
img {
    max-width: 100%;
    height: auto;
}

/* Fix touch targets for mobile */
button, a, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
}

/* Prevent zoom on input focus (iOS) */
input, select, textarea {
    font-size: 16px !important;
}

/* Safe area for notched devices */
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Responsive font scaling */
@media screen and (max-width: 375px) {
    html { font-size: 14px; }
}

@media screen and (min-width: 376px) and (max-width: 414px) {
    html { font-size: 15px; }
}

@media screen and (min-width: 415px) and (max-width: 768px) {
    html { font-size: 16px; }
}

@media screen and (min-width: 769px) {
    html { font-size: 18px; }
}
