body {
    margin: 0;
    font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    background-color: #eef3fb;
    color: #2a3a4d;
}

h1 {
    margin: 0;
    text-align: center;
    font-size: clamp(1.8rem, 2vw + 1rem, 2.4rem);
    font-weight: 700;
}

.layout {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    box-shadow: 0 12px 28px -24px rgba(46, 74, 120, 0.6);
}

button {
    border-radius: 999px;
    border: 1px solid #b6c6dd;
    background: linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
    color: #2a3a4d;
    font-weight: 600;
    padding: 0.55rem 1.35rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

button:hover {
    border-color: #7da7f5;
    box-shadow: 0 12px 24px -16px rgba(58, 102, 175, 0.55);
    transform: translateY(-1px);
}

button:focus-visible {
    outline: 3px solid rgba(122, 162, 255, 0.45);
    outline-offset: 2px;
}

button:active {
    transform: translateY(0);
    box-shadow: none;
}

.modeButton {
    border: 1px solid transparent;
    background: transparent;
    color: #556987;
    font-weight: 600;
    padding-inline: 1.75rem;
    box-shadow: none;
}

.modeButton:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(96, 134, 206, 0.2);
}

.modeButton.selected {
    background: #ffffff;
    border-color: #4a8dff;
    color: #1f3f70;
    box-shadow: 0 14px 32px -24px rgba(50, 88, 168, 0.75);
}

.form-panel {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem clamp(1.25rem, 1.5vw + 1rem, 2.5rem);
    box-shadow: 0 18px 35px -25px rgba(32, 57, 96, 0.45), 0 6px 12px -6px rgba(32, 57, 96, 0.25);
    border: 1px solid rgba(73, 115, 160, 0.08);
}

.form-row {
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr;
    gap: 0.75rem 1.5rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.form-row label {
    font-weight: 600;
    text-align: right;
    color: #2a3a4d;
    padding-top: 0.4rem;
}

.field-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.field-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.field-line > input[type="text"] {
    flex: 1 1 260px;
}

.field-line > select {
    flex: 0 0 auto;
}

.newline-select {
    width: auto;
    min-width: 160px;
}

.field-actions {
    display: flex;
    gap: 0.75rem;
}

input[type="text"],
select,
textarea {
    width: 100%;
    border: 1px solid #d6dce5;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    background-color: #fdfdfd;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

input[type="text"] {
    height: 2rem;
    min-height: 2rem;
    line-height: 1.15;
}

textarea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.5;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    border-color: #4a8dff;
    box-shadow: 0 0 0 3px rgba(74, 141, 255, 0.18);
    outline: none;
}

textarea[readonly] {
    background-color: #f8faff;
}

input[type="file"] {
    width: 100%;
    font-size: 1rem;
    color: #2a3a4d;
}

input[type="file"]::file-selector-button {
    margin-right: 1rem;
    border-radius: 999px;
    border: 1px solid #b6c6dd;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8ff 100%);
    padding: 0.45rem 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

input[type="file"]::file-selector-button:hover {
    border-color: #7da7f5;
    box-shadow: 0 8px 20px -14px rgba(58, 102, 175, 0.55);
    transform: translateY(-1px);
}

.primary-button {
    background: linear-gradient(135deg, #4f8bff 0%, #3558dd 100%);
    color: #ffffff;
    border-color: transparent;
}

.primary-button:hover {
    border-color: transparent;
    box-shadow: 0 14px 30px -18px rgba(53, 88, 193, 0.7);
}

.primary-button:focus-visible {
    outline: 3px solid rgba(74, 141, 255, 0.55);
    outline-offset: 1px;
}

.help-text {
    margin: 0;
    font-size: 0.85rem;
    color: #6b7a90;
}

@media (max-width: 720px) {
    .layout {
        padding: 2.5rem 1.25rem 3rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row label {
        text-align: left;
        padding-top: 0;
    }

    .field-line {
        flex-direction: column;
        align-items: stretch;
    }

    .field-line > input[type="text"] {
        flex: 0 0 auto;
    }

    .newline-select {
        width: 100%;
    }

    .mode-toggle {
        border-radius: 18px;
    }
}
