/* stain-upload 전용 스타일 */
.mobile-container.input-page {
    padding: 0;
    max-height: 100vh;
    /* 화면 높이에 맞춤 */
    display: flex;
    flex-direction: column;
    background-color: var(--color-primary);
}

/* --- 상단 파란색 영역--- */
.upload-header-section {
    padding: 10px 20px 0px;
    /* 패딩 조정 */
    color: var(--color-container);
    flex-shrink: 0;
    /* 높이가 줄어들지 않도록 설정 */
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    /* 자식 요소의 absolute 포지셔닝 기준 */
    height: 56px;
    /* 고정 높이 */
}

.icon-btn {
    background: none;
    border: none;
    color: var(--white-background);
    cursor: pointer;
    font-size: 16px;
    z-index: 2;
}

.header-tabs {
    display: flex;
    background-color: white;
    border-radius: 50px;
    padding: 4px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.tab-btn {
    border: none;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background-color: transparent;
    color: var(--color-primary);
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    text-decoration: none;
}

.tab-btn.active {
    background-color: var(--color-primary);
    color: var(--color-container);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

/*--- 하단 흰색 영역--- */
.manual-input-section {
    padding: 30px 20px 0;
    /* 하단 패딩 제거 */
    background-color: var(--color-container);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    position: relative;
    z-index: 1;
    min-height: 0;
    /* flex 자식 요소의 높이 계산 오류 방지 */
    overflow: hidden;
    /* 내부 스크롤을 위해 부모에서 스크롤 방지 */
    padding-bottom: 10px;
    /* 하단 버튼 공간 확보 */
}

.content-block {
    margin-bottom: 0px;
}

.vertical-scroll-block {
    flex-grow: 1;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.arrow-btn {
    background-color: var(--color-background);
    color: var(--color-text-secondary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    border: none;
}

/* --- NEW: Horizontal Scroll Section --- */
.horizontal-scroll-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    /* 스크롤바와 콘텐츠 간격 */
    margin: 0 -20px;
    /* 좌우 여백 제거하여 화면 끝까지 채움 */
    padding: 0 20px;
    /* 내부 아이템을 위한 패딩 */
}

.horizontal-scroll-container::-webkit-scrollbar {
    display: none;
    /* 스크롤바 숨기기 */
}

.h-scroll-item {
    flex: 0 0 110px;
    /* 아이템 크기 고정 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;

}

.h-scroll-img-placeholder {
    width: 110px;
    height: 110px;
    background-color: var(--color-background);
    border-radius: 15px;

}

.h-scroll-item span {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary)
}

/* --- MODIFIED: Vertical Scroll Section --- */
.vertical-scroll-content {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
    margin: 0 -20px;
    /* 좌우 여백 제거 */
    padding: 0 20px;
    /* 내부 콘텐츠 패딩 */
}

.vertical-scroll-content::-webkit-scrollbar {
    display: none;
    /* 스크롤바 숨기기 */
}

.stain-group-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
    margin-top: 5px;
}

.stain-group-title:first-child {
    margin-top: 0;
}

.stain-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0px 15px;
}

.stain-grid-item {
    /* background-color: var(--color-background); */
    border-radius: 15px;
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s;
    display: flex;
    flex-direction: column;
    height: auto;
    text-decoration: none;
}

.stain-image-placeholder {
    width: 100%;
    background-color: var(--color-background);
    border: 2px solid transparent;
    transition: border-color 0.2s;
    border-radius: 15px;
    aspect-ratio: 1 / 1;
    /* flex-grow: 1;  */
}

.stain-image-placeholder-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

.stain-label {
    display: flex;
    justify-content: center;
    /* 가운데 정렬 */
    align-items: center;
    padding: 5px 10px 20px 10px;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-primary);
    flex-shrink: 0;
}

/* --- 하단 고정 버튼 --- */
.bottom-button-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 20px 30px;
    background: white;
    z-index: 2;
    border-top: 1px solid var(--color-border);
}

.submit-button {
    width: 100%;
    background-color: var(--color-primary);
    color: var(--color-container);
    padding: 16px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
}