/* Reset and base */
* { box-sizing: border-box; }
body { 
    margin: 0; 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; 
    background: #f5f5f5; 
    padding-bottom: env(safe-area-inset-bottom); /* iOS safe area support */
}

/* Top bar - enhanced for iOS */
#top-bar {
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    height: 56px; 
    background: #007bff; 
    color: white; 
    display: flex; 
    align-items: center; 
    padding: 0 15px; 
    font-size: 20px; 
    z-index: 1000; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding-top: env(safe-area-inset-top); /* iOS notch support */
}
#home-btn { 
    background: none; 
    border: none; 
    color: white; 
    font-size: 28px; 
    cursor: pointer; 
    padding: 0; 
    margin-right: 15px;
}
#page-title { 
    flex: 1; 
    text-align: center; 
    margin-right: 40px; 
    font-weight: 500;
}

/* Content area */
#content { 
    margin-top: 56px; /* Matches top bar height */
    padding: 20px; 
    min-height: calc(100vh - 56px);
}
.page { 
    display: none; 
    text-align: center; 
}
.page.active { 
    display: block; 
}
h1 { 
    color: #333; 
    margin-bottom: 30px; 
    font-size: 24px;
}

button, .app-btn {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    -webkit-user-select: none;
    touch-action: manipulation;
    outline: none !important;
    cursor: pointer;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 18px;
    margin: 12px auto;
    font-size: 18px;
    width: 90%;
    max-width: 400px;
    display: block;
    transition: all 0.05s ease;
}

/* THIS IS THE LINE THAT FINALLY KILLS THE iOS GRAY STUCK STATE */
button:active, .app-btn:active {
    background: #007bff !important;
    transform: none !important;
    opacity: 1 !important;
}