:root {
    --bg: #f2f4f7;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: rgba(255, 255, 255, 0.96);
    --line: rgba(15, 23, 42, 0.1);
    --text: #111827;
    --muted: #667085;
    --accent: #0a84ff;
    --accent-strong: #0059d6;
    --shadow: 0 30px 80px rgba(15, 23, 42, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --font-sans: "SF Pro Display", "SF Pro Text", "Hiragino Sans", "Noto Sans JP", sans-serif;
    --font-mono: "SFMono-Regular", "UDEV Gothic NF", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(157, 214, 255, 0.45), transparent 34%),
        radial-gradient(circle at top right, rgba(255, 209, 161, 0.35), transparent 28%),
        linear-gradient(180deg, #f9fbfd 0%, #eef2f7 100%);
}

body.loading {
    overflow: hidden;
}

.app-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 64px;
}

.hero {
    padding: 30px 32px 22px;
}

.eyebrow,
.step-label {
    margin: 0 0 10px;
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero h1,
.step-panel h2,
.slides-head h2 {
    margin: 0;
    letter-spacing: -0.03em;
}

.hero h1 {
    font-size: clamp(2.4rem, 4vw, 4.4rem);
    line-height: 1.02;
}

.lead,
.helper,
.empty,
.loading-stage,
.progress-text {
    color: var(--muted);
}

.lead {
    width: min(720px, 100%);
    margin: 16px 0 0;
    font-size: 1.02rem;
    line-height: 1.75;
}

.primary-tabs {
    display: flex;
    gap: 10px;
    margin: 0 32px 18px;
}

.primary-tab,
.slide-page-tab,
.button,
select {
    border: 1px solid var(--line);
    border-radius: 999px;
    font: inherit;
}

.primary-tab,
.slide-page-tab {
    padding: 11px 18px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-tab.is-active,
.slide-page-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border-color: transparent;
    box-shadow: 0 12px 28px rgba(10, 132, 255, 0.24);
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.panel {
    background: var(--panel);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.step-panel,
.slides-panel {
    margin: 0 32px 18px;
    padding: 28px;
}

.step-panel h2,
.slides-head h2 {
    font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.field {
    display: block;
    margin-top: 18px;
}

.toggle-field {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    font-weight: 700;
}

.toggle-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.toggle-field span {
    display: inline;
    margin: 0;
}

.field span {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
}

textarea,
select {
    width: 100%;
    background: var(--panel-strong);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px 18px;
    font: inherit;
}

textarea {
    resize: vertical;
    line-height: 1.7;
}

textarea::placeholder {
    color: #98a2b3;
}

.actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 18px;
}

.button {
    cursor: pointer;
    padding: 13px 20px;
    background: #fff;
}

.button-primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 16px 34px rgba(10, 132, 255, 0.22);
}

.button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.message {
    margin: 0 32px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(220, 38, 38, 0.16);
    background: rgba(255, 243, 242, 0.92);
    color: #b42318;
}

.message.is-success {
    border-color: rgba(12, 166, 120, 0.14);
    background: rgba(236, 253, 243, 0.92);
    color: #027a48;
}

.slides-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.slide-page-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.swipe-hint {
    margin: 0 0 14px;
}

.slide-frame-shell {
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: #fff;
    touch-action: pan-y;
    cursor: grab;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
}

.slide-frame-shell.is-dragging {
    cursor: grabbing;
}

.slide-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
    pointer-events: none;
    object-fit: contain;
    display: block;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(18, 19, 21, 0.42);
    backdrop-filter: blur(8px);
    z-index: 40;
}

.loading-overlay[hidden] {
    display: none;
}

.loading-card {
    width: min(520px, calc(100% - 32px));
    padding: 28px;
    border-radius: 28px;
    background: rgba(255, 250, 242, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    text-align: center;
}

.loading-wave {
    width: 300px;
    max-width: 100%;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin: 0 auto 12px;
}

.loading-bar {
    width: 20px;
    height: 10px;
    margin: 0 5px;
    background-color: #3498db;
    border-radius: 5px;
    animation: loading-wave-animation 1s ease-in-out infinite;
}

.loading-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.loading-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.loading-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.loading-title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 700;
}

.progress {
    margin: 16px 0 10px;
    height: 12px;
    border-radius: 999px;
    background: #e7ddd0;
    overflow: hidden;
}

.progress-bar {
    width: 4%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0d7a63, #35b198);
    transition: width 0.7s ease;
}

@keyframes loading-wave-animation {
    0% {
        height: 10px;
    }

    50% {
        height: 50px;
    }

    100% {
        height: 10px;
    }
}

@media (max-width: 900px) {
    .app-shell {
        width: min(100%, calc(100% - 20px));
        padding-top: 24px;
    }

    .hero,
    .step-panel,
    .slides-panel,
    .primary-tabs,
    .message {
        margin-left: 0;
        margin-right: 0;
    }

    .hero,
    .step-panel,
    .slides-panel {
        padding: 22px;
    }

    .slides-head {
        flex-direction: column;
    }

    .slide-page-tabs {
        justify-content: flex-start;
    }

    .slide-frame {
        height: auto;
    }
}
