:root {
    --primary: #000000;       
    --bg: #F5F5F7;           
    --card: #FFFFFF;
    --text-main: #1D1D1F;    
    --text-sub: #86868B;     
    --input-bg: #E8E8ED;     
    --border: #D2D2D7;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

/* 공통 설정 */
body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "San Francisco", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.5; color: var(--text-main);
    background-color: var(--bg);
    -webkit-user-select: none; user-select: none;
}

/* --------------------------------------
   [1] 로그인 페이지 전용 스타일
   -------------------------------------- */
body.login-page {
    height: 100vh;
    display: flex; justify-content: center; align-items: center;
    overflow: hidden; /* 스크롤 없음 */
    padding: 20px;
}

.login-container {
    width: 100%; display: flex; justify-content: center;
}
.login-box {
    background: white; padding: 40px; border-radius: 30px;
    text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    max-width: 320px; width: 100%;
}
.login-icon { font-size: 4rem; margin-bottom: 20px; }
.login-box h1 { margin: 0 0 10px 0; font-size: 1.5rem; }
.login-box p { color: var(--text-sub); margin-bottom: 30px; font-size: 0.95rem; }

.btn-google {
    width: 100%; padding: 14px; border: 1px solid #ddd;
    background: white; border-radius: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 1rem; font-weight: 600; color: #333;
    transition: background 0.2s; margin-bottom: 12px;
}
.btn-google:hover { background-color: #f5f5f5; }
/* 구글 로고 크기 고정 */
.btn-google img { width: 20px  ; height: 20px  ; flex-shrink: 0; }

.btn-guest {
    width: 100%; padding: 14px; border: none;
    background: #F2F2F7; border-radius: 12px; cursor: pointer;
    font-size: 0.95rem; font-weight: 500; color: var(--text-sub);
    transition: all 0.2s;
}
.btn-guest:hover { background-color: #E5E5EA; color: var(--text-main); }


/* --------------------------------------
   [2] 메인 앱 페이지 전용 스타일
   -------------------------------------- */
body.app-page {
    /* 모바일 기본: 스크롤 허용 (강제) */
    display: block  ; 
    height: auto  ; min-height: 100vh;
    overflow-y: auto  ; 
    padding: 20px;
}

.container {
    width: 100%; max-width: 460px; 
    height: auto  ; min-height: 80vh; 
    margin: 0 auto; padding: 30px;
    border-radius: 30px; 
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: block  ; overflow: visible  ;
}
.input-section { 
    width: 100%; display: block; 
    height: auto  ; overflow: visible  ; 
}
.list-section { 
    width: 100%; display: block; margin-top: 20px; 
    height: auto  ; overflow: visible  ; 
}

/* PC 화면 (768px 이상) */
@media (min-width: 768px) {
    body.app-page {
        display: flex  ; align-items: center; justify-content: center;
        height: 100vh  ; overflow: hidden  ; padding: 40px;
    }

    .container {
        display: flex  ; flex-direction: row; 
        align-items: flex-start  ;
        max-width: 1000px; height: 90vh  ;
        overflow: hidden  ; padding: 40px; gap: 50px;
    }
    
    .input-section {
        width: 360px; flex-shrink: 0; 
        height: auto  ; max-height: 100%  ; 
        overflow-y: auto  ; display: block;
        padding: 10px 10px;
    }
    .input-section::-webkit-scrollbar { width: 0; }
    
    .list-section {
        flex-grow: 1; 
        height: 100%  ; 
        display: flex  ; 
        flex-direction: column; 
        /* [수정] 부모에서 자식의 스크롤을 막지 않도록 변경 */
        overflow: auto  !important; 
        margin-top: 0  ;
    }

    #tracking-list {
        /* [핵심 수정] height: 100%를 지우고 flex: 1을 줍니다 */
        /* 이렇게 해야 [필터버튼]을 뺀 나머지 공간만 차지해서 스크롤이 생깁니다 */
        flex: 1; 
        height: visible !important;
        min-height: 0; /* 파이어폭스 등 호환성용 */
        
        overflow-y: auto !important; 
        padding-bottom: 10px;
    }
    
    /* 스크롤바 디자인 */
    #tracking-list::-webkit-scrollbar { width: 6px; }
    #tracking-list::-webkit-scrollbar-track { background: transparent; }
    #tracking-list::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.2); border-radius: 10px; }
    #tracking-list::-webkit-scrollbar-thumb:hover { background-color: rgba(0, 0, 0, 0.4); }
}

/* --------------------------------------
   [3] 공통 UI 요소들
   -------------------------------------- */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
h1 { font-size: 1.8rem; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.btn-logout { background: rgba(0,0,0,0.05); border: none; padding: 6px 12px; border-radius: 8px; font-size: 0.8rem; cursor: pointer; color: var(--text-sub); }

.carrier-info { text-align: center; margin-bottom: 20px; }
.carrier-pill { display: inline-block; font-size: 0.8rem; color: var(--text-sub); background-color: rgba(0,0,0,0.03); padding: 8px 14px; border-radius: 99px; font-weight: 500; }

.input-group { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; padding: 10px 10px;}
/* input, select { width: 100%; padding: 18px; border: none; border-radius: 14px; font-size: 1.05rem; outline: none; background: var(--input-bg); color: var(--text-main); transition: background 0.2s; -webkit-user-select: text; user-select: text; }
input:focus, select:focus { background: #FFFFFF; box-shadow: 0 0 0 2px #0071E3; } */
input, select {
    width: 100%;
    
    /* 높이 강제 고정 */
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    
    /* 패딩: 상하 0, 좌우 18px */
    padding: 0 18px !important;
    margin: 0;
    
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    outline: none;
    background: var(--input-bg);
    color: var(--text-main);
    transition: background 0.2s;
    
    /* 기본 스타일 제거 */
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

/* 포커스 효과 */
input:focus, select:focus {
    background: #FFFFFF;
    box-shadow: 0 0 0 2px #0071E3;
}

/* [2] 날짜 입력창(Date) 아이폰 전용 해결책 */
input[type="date"] {
    display: block;
    overflow: hidden;
    
    /* 중요: line-height를 normal로 풀어줘야 내부 flex가 먹힙니다 */
    line-height: normal !important; 
    
    /* 텍스트가 위로 붙는 현상 방지용 패딩 미세 조정 (필요시) */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ★ 여기가 핵심입니다 (아이폰 내부 요소 강제 정렬) ★ */
input[type="date"]::-webkit-date-and-time-value {
    /* 내부 요소를 Flex 박스로 만듦 */
    display: flex !important;
    
    /* 수직 중앙 정렬 명령 */
    align-items: center !important;
    
    /* 높이를 부모(56px)와 똑같이 맞춤 */
    height: 56px !important;
    min-height: 56px !important;
    
    /* 잡다한 여백 제거 */
    margin: 0 !important;
    padding: 0 !important;
    
    /* 텍스트 왼쪽 정렬 */
    text-align: left;
}

/* 자동 감지/변경 버튼 영역 */
.prediction-area { display: flex; justify-content: space-between; align-items: center; background-color: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); padding: 12px 18px; border-radius: 14px; font-size: 0.95rem; color: #0071E3; font-weight: 600; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.04); display: none; margin-top: -5px; animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.prediction-area.show { display: flex; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.btn-change { background: rgba(0,0,0,0.05); border: none; color: var(--text-sub); padding: 6px 12px; border-radius: 8px; font-size: 0.8rem; cursor: pointer; font-weight: 600; }
#carrierSelect { display: none; }
#carrierSelect.show { display: block; }

/* 조회 및 추가 버튼 */
button.btn-add { width: 100%; padding: 18px; border: none; background-color: var(--primary); color: white; border-radius: 16px; cursor: pointer; font-weight: 600; font-size: 1.05rem; transition: transform 0.1s, background-color 0.2s; }
button.btn-add:hover { background-color: #333333; }
button.btn-add:active { transform: scale(0.98); }
button.btn-add:disabled { background-color: #D1D1D6; cursor: not-allowed; }

/* [NEW] 하단 통관 조회 섹션 스타일 */
.customs-area {
    margin-top: 30px; /* 위쪽 여백 */
    padding-top: 25px;
    border-top: 1px solid rgba(0,0,0,0.05); /* 구분선 */
    text-align: center;
}
.section-label {
    font-size: 0.9rem; font-weight: 600; color: var(--text-sub);
    margin: 0 0 15px 0;
}
.link-group { 
    display: flex; gap: 25px; justify-content: center; 
}
.customs-btn {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    text-decoration: none; cursor: pointer;
    transition: transform 0.2s;
}
.customs-btn:hover { transform: scale(1.05); }

.customs-btn img {
    width: 46px; height: 46px; 
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.customs-btn span {
    font-size: 0.8rem; font-weight: 500; color: var(--text-sub);
    transition: color 0.2s;
}
.customs-btn:hover span { color: var(--text-main); }


/* 리스트 필터 및 아이템 */
.filter-box { margin-bottom: 20px; padding: 3px; background: #7676801f; border-radius: 10px; flex-shrink: 0; }
.filter-tabs { display: flex; position: relative; border-radius: 8px; height: 32px; }
.filter-btn { flex: 1; border: none; background: transparent; font-size: 0.85rem; font-weight: 500; color: var(--text-main); cursor: pointer; z-index: 2; transition: opacity 0.2s; line-height: 32px; padding: 0; }
.filter-btn.active { font-weight: 600; }
.tab-glider { position: absolute; top: 0; left: 0; height: 100%; width: 33.333%; background-color: #FFFFFF; border-radius: 7px; box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 3px 1px rgba(0,0,0,0.04); z-index: 1; transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); }

#tracking-list { list-style: none; padding: 0; margin: 0; height: auto  ; overflow: visible  ; }
#tracking-list li { background-color: #FFFFFF; padding: 24px; border-radius: 18px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: flex-start; box-shadow: 0 2px 10px rgba(0,0,0,0.02); border: 1px solid rgba(0,0,0,0.03); transition: transform 0.2s; }
.info-area { flex-grow: 1; min-width: 0; margin-right: 20px; }
.item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.item-title { font-size: 1.1rem; font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.carrier-badge { font-size: 0.75rem; background: #F2F2F7; color: #6e6e73; padding: 4px 10px; border-radius: 6px; font-weight: 600; }
.d-day-badge { font-size: 0.7rem; color: #fff; background-color: #FF2D55; padding: 2px 8px; border-radius: 10px; font-weight: 700; margin-left: 5px; vertical-align: middle; }
.meta-row { display: flex; flex-direction: column; gap: 4px; }
.number { text-decoration: none; cursor: pointer; font-size: 0.9rem; color: #86868B; transition: color 0.2s; }
.status-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.status-text { font-size: 0.95rem; font-weight: 600; color: var(--text-main); }
.detail-text { font-size: 0.85rem; color: var(--text-sub); }
.status-delivered .status-text { color: #34C759; }
.status-error .status-text { color: #FF3B30; }
.status-global .status-text { color: #AF52DE; } 
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions button { padding: 8px 16px; border: none; border-radius: 18px; cursor: pointer; font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.btn-track { background-color: #F2F2F7; color: var(--text-main); }
.btn-delete { background-color: rgba(255, 59, 48, 0.1); color: #FF3B30; }
.empty-msg { display: flex; align-items: center; justify-content: center; color: #86868B; font-size: 1rem; min-height: 100px; }
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); background: rgba(30, 30, 30, 0.85); backdrop-filter: blur(10px); color: white; padding: 12px 24px; border-radius: 30px; font-size: 0.9rem; display: none; z-index: 2000; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
















