body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9;
    padding: 0;
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
}

.app-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    height: 100vh;
}

.form-container {
    width: 400px;
    padding: 20px;
    background: white;
    overflow-y: auto;
    border-right: 1px solid #ddd;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.preview-container {
    flex: 1;
    background: #525659; /* PDF Viewer Grey */
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.button-group {
    display: flex;
    gap: 10px;
}

button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

button:hover { background-color: #0056b3; }

#downloadBtn { background-color: #28a745; }
#downloadBtn:hover { background-color: #218838; }

/* Existing form styles... */
h1 { font-size: 1.5rem; margin-top: 0; text-align: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input-group label { font-size: 0.8rem; font-weight: bold; color: #555; }
input, select, textarea { width: 100%; padding: 8px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; }
textarea { height: 120px; font-family: monospace; white-space: pre; }
.note { font-size: 0.8rem; color: #666; text-align: center; margin-top: 15px; }

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: auto; /* Allow scrolling */
    }

    .form-container {
        width: 100%; /* Full width on phone */
        border-right: none;
        border-bottom: 1px solid #ddd;
        height: auto;
        overflow-y: visible;
    }

    .preview-container {
        height: 500px; /* Give it height so it doesn't disappear */
        padding: 10px;
    }
    
    /* Hide the iframe on mobile because Android can't show it anyway */
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-message {
        display: block !important;
        text-align: center;
        color: white;
        font-family: sans-serif;
        padding: 20px;
    }
}

.mobile-message {
    display: none; /* Hidden on desktop */
}