.upload-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #fff4fb 0%, #f1ecff 48%, #e9f7ff 100%);
}

.upload-main {
    width: min(920px, calc(100% - 32px));
    margin: 34px auto 70px;
}

.upload-card,
.child-test-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 24px;
    box-shadow: 0 10px 35px rgba(87, 69, 131, 0.13);
}

.upload-card {
    padding: 32px;
}

.upload-intro {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.intro-icon {
    font-size: 3.4rem;
}

.upload-intro h2 {
    color: #6c3fa0;
    font-size: 1.8rem;
    margin: 0 0 6px;
}

.upload-intro p {
    color: #666;
    margin: 0;
}

.upload-shortcuts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: -6px 0 20px;
}

.upload-shortcuts a {
    min-height: 42px;
    padding: 9px 15px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1eafa;
    color: #684083;
    text-decoration: none;
    font-weight: 750;
}

.server-status {
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-weight: 650;
}

.server-status.checking {
    color: #6c5a2d;
    background: #fff6d8;
}

.server-status.ready {
    color: #17673a;
    background: #e4f8ec;
}

.server-status.error {
    color: #9c2f3d;
    background: #ffe7eb;
}

.form-section {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 25px 0;
    border-top: 2px dashed #eadff6;
}

.step-number {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #9b59b6, #e91e63);
    color: white;
    font-size: 1.25rem;
    font-weight: 800;
}

.field-grow {
    flex: 1;
    min-width: 0;
}

.field-label {
    display: block;
    color: #55316f;
    font-weight: 750;
    margin-bottom: 8px;
}

.photo-source-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.source-button {
    min-height: 54px;
    padding: 12px 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 800;
    cursor: pointer;
}

.camera-button {
    color: white;
    background: linear-gradient(135deg, #e91e63, #9b59b6);
}

.gallery-button {
    color: #633d83;
    background: #f3eafa;
    border: 2px solid #c8a9dc;
}

.photo-picker {
    min-height: 260px;
    border: 3px dashed #b899d3;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fbf8ff;
    color: #76528e;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    padding: 18px;
}

.photo-picker:hover,
.photo-picker:focus-within {
    border-color: #e91e63;
    background: #fff7fb;
}

#imageInput,
#cameraInput {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.parent-pin-panel {
    margin-bottom: 15px;
    padding: 14px;
    border-radius: 14px;
    background: #fff6d8;
    color: #5f5128;
}

.parent-pin-panel input {
    width: 100%;
    min-height: 48px;
    border: 2px solid #d3bb64;
    border-radius: 11px;
    padding: 10px 12px;
    font: inherit;
    letter-spacing: 0.2em;
}

.parent-pin-panel p {
    margin: 8px 0 0;
    font-size: 0.9rem;
}

.load-edit-button {
    width: 100%;
    min-height: 46px;
    margin-top: 12px;
    border: none;
    border-radius: 11px;
    background: #7d4aa0;
    color: white;
    font-weight: 800;
    cursor: pointer;
}

#imagePreview {
    display: none;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: 14px;
}

.photo-picker.has-image {
    padding: 10px;
    min-height: 180px;
}

.photo-picker.has-image #pickerText {
    display: none;
}

.photo-picker.has-image #imagePreview {
    display: block;
}

.field-hint {
    margin: 8px 0 0;
    color: #777;
    font-size: 0.9rem;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.field.full-width {
    grid-column: 1 / -1;
}

.local-only-note {
    grid-column: 1 / -1;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eef7ff;
    color: #315d7d;
    line-height: 1.55;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 2px solid #d9c9e8;
    border-radius: 13px;
    padding: 13px 14px;
    font: inherit;
    color: #333;
    background: white;
}

.featured-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.checkbox-label {
    min-height: 50px;
    border: 2px solid #d9c9e8;
    border-radius: 13px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #55316f;
    font-weight: 700;
}

.checkbox-label input {
    width: 22px;
    height: 22px;
}

.advanced-fields {
    grid-column: 1 / -1;
    border: 2px solid #e4d7ee;
    border-radius: 14px;
    padding: 13px 15px;
    background: #fcfaff;
}

.advanced-fields summary {
    color: #694284;
    font-weight: 800;
    cursor: pointer;
}

.advanced-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

.field textarea {
    resize: vertical;
    min-height: 120px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 3px solid rgba(155, 89, 182, 0.17);
    border-color: #9b59b6;
}

.save-section {
    align-items: center;
}

.save-button {
    width: 100%;
    min-height: 58px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(90deg, #e91e63, #9b59b6);
    color: white;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 7px 20px rgba(155, 89, 182, 0.25);
}

.save-button:hover:not(:disabled) {
    transform: translateY(-2px);
}

.save-button:disabled {
    opacity: 0.58;
    cursor: wait;
}

.upload-status {
    min-height: 26px;
    margin-top: 10px;
    font-weight: 700;
}

.upload-status.error {
    color: #b42f42;
}

.upload-status.working {
    color: #724796;
}

.success-panel {
    text-align: center;
    border-top: 2px dashed #eadff6;
    padding: 32px 10px 8px;
}

.success-stars {
    font-size: 3rem;
}

.success-panel h2 {
    color: #7d3ea3;
    margin: 8px 0;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.primary-link,
.secondary-button {
    min-height: 48px;
    border-radius: 13px;
    padding: 12px 20px;
    font-weight: 750;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.primary-link {
    background: #9b59b6;
    color: white;
}

.secondary-button {
    background: white;
    color: #7d3ea3;
    border: 2px solid #b995d0;
    cursor: pointer;
}

.child-test-card {
    margin-top: 24px;
    padding: 25px 30px;
}

.child-test-card h2 {
    color: #5c4090;
    margin: 0 0 14px;
}

.child-test-card label,
.child-test-card > p {
    display: block;
    padding: 9px 0;
    color: #444;
    font-weight: 650;
}

.child-test-card .test-note {
    margin-bottom: 6px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f2ecff;
    color: #664580;
    font-weight: 500;
    line-height: 1.55;
}

.child-test-card input {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

@media (max-width: 680px) {
    .upload-main {
        width: min(calc(100% - 20px), 920px);
        margin-top: 16px;
    }

    .upload-page .nav-container {
        gap: 8px;
        padding: 0 10px;
    }

    .upload-page .nav-title {
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .upload-card {
        padding: 20px 16px;
        border-radius: 18px;
    }

    .upload-intro {
        align-items: flex-start;
    }

    .intro-icon {
        font-size: 2.5rem;
    }

    .upload-intro h2 {
        font-size: 1.35rem;
    }

    .form-section {
        gap: 12px;
    }

    .field-grow,
    .field-grid,
    .field,
    .photo-picker {
        min-width: 0;
        max-width: 100%;
    }

    #pickerText {
        overflow-wrap: anywhere;
    }

    .step-number {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .field.full-width {
        grid-column: auto;
    }

    .advanced-fields {
        grid-column: auto;
    }

    .advanced-grid {
        grid-template-columns: 1fr;
    }

    .advanced-grid .full-width {
        grid-column: auto;
    }

    .local-only-note {
        grid-column: auto;
    }

    .photo-picker {
        min-height: 210px;
    }

    .photo-source-buttons {
        grid-template-columns: 1fr;
    }

    .nav-title {
        font-size: 1.1rem;
    }
}
