:root {
    color-scheme: light dark;
    font-family: "Noto Sans JP", system-ui, sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 50%, #2563eb 100%);
    color: #f8fafc;
}

main {
    width: min(640px, 92vw);
    padding: 2.6rem 2.4rem;
    border-radius: 1.6rem;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(12px);
    box-shadow: 0 34px 60px rgba(15, 23, 42, 0.55);
}

h1 {
    margin: 0 0 1.1rem;
    font-size: clamp(1.9rem, 4.5vw, 2.5rem);
}

form {
    display: grid;
    gap: 1.8rem;
}

.field {
    display: grid;
    gap: 0.9rem;
}

.dropzone {
    border: 2px dashed rgba(148, 163, 184, 0.55);
    border-radius: 1.1rem;
    background: rgba(30, 41, 59, 0.45);
    padding: 1.7rem;
    text-align: center;
    display: grid;
    gap: 0.7rem;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
    cursor: pointer;
}

.dropzone:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.85);
    outline-offset: 4px;
}

.dropzone.active {
    border-color: rgba(96, 165, 250, 0.95);
    background: rgba(30, 64, 175, 0.45);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.35);
}

.dropzone.has-file {
    border-color: rgba(56, 189, 248, 0.85);
    background: rgba(37, 99, 235, 0.35);
}

.dropzone-cta {
    font-size: 1.05rem;
    font-weight: 700;
}

.filename {
    margin: 0;
    font-size: 0.93rem;
    color: rgba(248, 250, 252, 0.75);
    word-break: break-word;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

button {
    padding: 0.95rem 1.75rem;
    border: none;
    border-radius: 0.95rem;
    font-weight: 700;
    font-size: 1rem;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #0f172a;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
    box-shadow: none;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.45);
}

.progress {
    height: 3px;
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transition: opacity 160ms ease;
}

.progress.active {
    opacity: 1;
}

.progress::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 32%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0), rgba(56, 189, 248, 0.85), rgba(37, 99, 235, 0));
    animation: progress 1.2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(150%);
    }
    100% {
        transform: translateX(150%);
    }
}

.status {
    min-height: 1.6rem;
    font-size: 0.96rem;
    color: rgba(248, 250, 252, 0.85);
    white-space: pre-wrap;
}

.status.error {
    color: #fca5a5;
}

.download {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: 0.95rem;
    background: rgba(56, 189, 248, 0.16);
    color: #bae6fd;
    font-weight: 600;
    text-decoration: none;
    transition: background 160ms ease;
}

.download.visible {
    display: inline-flex;
}

.download:hover {
    background: rgba(56, 189, 248, 0.32);
}

@media (max-width: 520px) {
    main {
        padding: 2.2rem 1.9rem;
    }

    .dropzone {
        padding: 1.3rem;
    }
}
