/* 레이아웃 */
header {
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
    min-width: 330px;
    background-color: white;
    height: 60px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 1300;
    box-shadow: 0 1px 10px rgba(0,0,0,.06);
}

body.home header .menu-toggle {
    display: none !important;
}

.logo {
    display: flex;
    align-items: center;
}
.logo img {
    height: 45px;
    margin-right: 2px;
}
.logo-text {
    font-size: 27px;
    color: #2338A0;
    font-weight: 900;
    margin: 0;
    white-space: nowrap; /* 줄바꿈 방지 */
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* 헤더 안의 버튼만 모양 통일 */
header .btn {
    --bs-btn-border-width: 1px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.25;
    min-width: 80px;
    white-space: nowrap;  /* 줄바꿈 방지 */
}
header .btn-primary {
    background-color: #2338A0;
    border: 1px solid #3b50c2;
}
header .btn-light,
header .btn-secondary {
    background-color: #fff;
    color: #000;
    border: 1px solid #ccc;
}

header .user-name {
    color: #2338A0;
    font-weight: 700;
}

/* 햄버거 버튼 */
.menu-toggle {
    display: none;
    font-size: 20px;
    background: none;
    border: none;
    color: #2338A0;
    padding: 6px;
    margin-right: 10px;
}

/* flex 수축/확장 균형 잡기 */
header > .d-flex { min-width: 0; }           /* 왼쪽 영역이 이상하게 밀리지 않도록 */
.header-right { flex-shrink: 0; }            /* 버튼 영역 과도한 수축 방지 */

/* 매우 좁은 화면 대응 */
@media (max-width: 405px) {
    .user-name { display: none; }       /* 유저명 숨김 → 버튼만 남겨 폭 절약 */
    header .btn { min-width: 64px; }    /* 버튼 최소폭 축소(가독성 유지) */
}

/* 390px 이하에서 크기 조정 */
@media (max-width: 550px) {
    header { padding: 0 10px; height: 60px; }
    .logo img { height: 30px; }
    .logo-text { font-size: 18px; font-weight: 800; }

    .header-right { gap: 6px; }
    header .btn {
        padding: 6px 10px;
        min-width: 60px;
        font-size: 12px;
        line-height: 1.2;
    }
}

/* 1370px 이하에서 햄버거 노출 */
@media (max-width: 1370px) {
    .menu-toggle {
        display: block;
    }
}