/* Root Variables */
:root {
    color-scheme: light;
    --bg: #0b1220;
    --border: rgba(15, 23, 42, 0.12);
    --brand: #2563eb;
    --brand-2: #7c3aed;
    --danger: #ef4444;
    --muted: #475569;
    --ok: #16a34a;
    --radius: 16px;
    --shadow: 0 12px 30px rgba(2, 6, 23, 0.18);
    --surface: rgba(255, 255, 255, 0.92);
    --surface-2: rgba(255, 255, 255, 0.80);
    --text: #0f172a;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

body {
    background: radial-gradient(1200px 600px at 10% 10%, rgba(37, 99, 235, 0.35), transparent 60%),
                radial-gradient(900px 540px at 90% 15%, rgba(124, 58, 237, 0.30), transparent 55%),
                linear-gradient(180deg, #0b1220, #0b1220 40%, #070b14);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Arial, sans-serif;
    margin: 0;
}

/* Links */
a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Containers */
.container {
    margin: 0 auto;
    padding: 28px 0 40px;
    width: min(1120px, calc(100% - 32px));
}

/* Header */
header.site-header {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    margin: 0 0 18px;
    padding: 18px 18px;
}

.site-header__title {
    color: rgba(255, 255, 255, 0.92);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 0;
}

.site-header__subtitle {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    margin: 6px 0 0;
}

/* Grid */
.grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

@media (min-width: 760px) {
    .grid {
        align-items: start;
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1040px) {
    .grid {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.card h2 {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 0 10px;
}

/* Dropzone */
.dropzone {
    background: rgba(37, 99, 235, 0.06);
    border: 2px dashed rgba(37, 99, 235, 0.28);
    border-radius: calc(var(--radius) - 6px);
    cursor: pointer;
    display: grid;
    gap: 10px;
    min-height: 120px;
    padding: 18px;
    place-items: center;
    text-align: center;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone strong {
    font-size: 14px;
}

.dropzone small {
    color: var(--muted);
}

.dropzone.is-dragover {
    background: rgba(37, 99, 235, 0.10);
    border-color: rgba(37, 99, 235, 0.60);
    transform: translateY(-1px);
}

.dropzone:focus-visible,
.btn:focus-visible,
input[type="text"]:focus-visible {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
    outline: none;
}

/* Rows */
.row {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

/* Progress Bar */
.progress {
    background: rgba(2, 6, 23, 0.08);
    border: 1px solid rgba(2, 6, 23, 0.06);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.progress__bar {
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    height: 100%;
    transition: width 120ms ease;
    width: 0%;
}

/* Form Fields */
.field {
    display: grid;
    gap: 6px;
}

.field label {
    color: var(--muted);
    font-size: 12px;
}

.input-with-action {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr auto;
}

input[type="text"] {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    padding: 10px 12px;
    width: 100%;
}

input[type="text"]:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
    outline: none;
}

/* Buttons */
.btn {
    appearance: none;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    border: 0;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.20);
    color: white;
    cursor: pointer;
    font-weight: 700;
    padding: 10px 12px;
}

.btn:hover {
    filter: brightness(1.02);
}

.btn:active {
    transform: translateY(1px);
}

.btn--ghost {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: none;
    color: var(--text);
}

.btn--small {
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    padding: 8px 10px;
}

/* Status */
.status {
    color: var(--muted);
    font-size: 12px;
    margin-top: 10px;
}

.status.is-error {
    color: var(--danger);
}

.status.is-ok {
    color: var(--ok);
}

/* Preview */
.preview {
    display: grid;
    gap: 10px;
}

.preview img {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: calc(var(--radius) - 6px);
    max-height: 360px;
    object-fit: contain;
    width: 100%;
}

/* Muted Text */
.muted {
    color: var(--muted);
    font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}