:root {
    --primary-color: #007aff;
    --primary-hover: #0056b3;
    --success-color: #34c759;
    --light-gray: #f2f2f7;
    --border-color: #d1d1d6;
    --text-color: #1d1d1f;
    --text-light: #6e6e73;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
}
body {
    font-family: var(--font-family);
    background-color: var(--light-gray);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
}
.container {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 480px;
    width: 100%;
}
h1 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-weight: 700;
}
p.subtitle {
    color: var(--text-light);
    margin: 0 0 2rem 0;
    font-size: 1rem;
}
#drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
    margin-bottom: 1.5rem;
    /* Using Flexbox for robust centering */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#drop-area.highlight {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}
#drop-area svg {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    stroke-width: 1.5;
}
#drop-area .upload-text {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}
#drop-area .upload-hint {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}
#file-input { display: none; }
#file-name { margin-top: 0.75rem; color: var(--text-color); font-weight: 500; font-size: 0.9rem; word-break: break-all; }
button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    width: 100%;
}
button:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}
button:disabled { background-color: #cdd2d9; cursor: not-allowed; }
.loader {
    border: 4px solid #e9e9e9;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    animation: spin 1s linear infinite;
    margin: 1.5rem auto 0;
    display: none;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
#result-area {
    margin-top: 2rem;
    text-align: left;
    background: #f7f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    display: none;
    border: 1px solid var(--border-color);
}
#result-area p { margin: 0.5rem 0; color: var(--text-light); }
#result-area strong { color: var(--text-color); font-weight: 600; }
.download-link {
    display: block;
    background-color: var(--success-color);
    color: white !important;
    padding: 0.9rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    text-align: center;
    transition: opacity 0.2s;
}
.download-link:hover { opacity: 0.85; }