html, body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    height: 100%;
}

h1:focus {
    outline: none;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "오류가 발생했습니다.";
}

/* ─── 공통 셸 ─────────────────────────────── */
.hm-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.hm-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 52px;
    background: #2c5aa0;
    color: #fff;
    flex-shrink: 0;
}

.hm-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}
.hm-brand:hover { opacity: .85; }

.hm-spacer { flex: 1; }

.hm-user { font-size: .9rem; opacity: .9; }

.hm-logout-form { margin: 0; }

.hm-logout-btn {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff;
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: .85rem;
}
.hm-logout-btn:hover { background: rgba(255,255,255,.28); }

.hm-body-row {
    display: flex;
    flex: 1;
    min-height: 0;
}

.hm-main {
    flex: 1;
    min-height: 0;
    min-width: 0;
}

/* ─── 좌측 아이콘 레일 (메일/주소록/…) ─────── */
.hm-rail {
    display: flex;
    flex-direction: column;
    width: 64px;
    background: #fff;
    border-right: 1px solid #e0e6ed;
    padding: 8px 0;
    gap: 2px;
    flex-shrink: 0;
}

.hm-rail a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 9px 0;
    text-decoration: none;
    color: #7b8794;
    border-left: 3px solid transparent;
    font-size: .68rem;
}
.hm-rail a:hover { color: #2c5aa0; background: #f4f8fd; }
.hm-rail a.active { color: #2c5aa0; border-left-color: #2c5aa0; background: #eef4fb; font-weight: 700; }
.hm-rail-ico { font-size: 1.15rem; }

/* ─── 메일함 레이아웃 (사이드바 + 목록, 열람 시 본문 대체) ── */
.hm-mail {
    display: grid;
    grid-template-columns: 230px 1fr;
    height: 100%;
    min-height: 0;
}
.hm-mail .hm-view { display: none; }
.hm-mail.hm-detail-open .hm-list { display: none; }
.hm-mail.hm-detail-open .hm-view { display: flex; }

/* 사이드바 상단 버튼 */
.hm-side-btns { display: flex; gap: 6px; padding: 4px 12px 12px; }

.hm-compose-btn {
    flex: 1.4;
    background: #2c5aa0;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 4px;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
}
.hm-compose-btn:hover { background: #244b86; }

.hm-tome-btn {
    flex: 1;
    background: #fff;
    border: 1px solid #c9d3de;
    border-radius: 6px;
    padding: 10px 4px;
    font-size: .88rem;
    color: #444;
    cursor: pointer;
}
.hm-tome-btn:hover { border-color: #2c5aa0; color: #2c5aa0; }

/* 폴더 */
.hm-folders {
    border-right: 1px solid #dde3ea;
    background: #f7f9fb;
    overflow-y: auto;
    padding: 10px 0;
}

.hm-folders ul { list-style: none; margin: 0; padding: 0; }

.hm-folders li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    cursor: pointer;
    font-size: .95rem;
}
.hm-folders li:hover { background: #e9eff7; }
.hm-folders li.active { background: #dbe7f5; font-weight: 700; }

.hm-badge {
    background: #e5484d;
    color: #fff;
    border-radius: 10px;
    font-size: .75rem;
    padding: 1px 7px;
}

.hm-folder-acts { display: inline-flex; align-items: center; gap: 4px; }
.hm-folder-act {
    cursor: pointer;
    font-size: .8rem;
    opacity: .35;
    padding: 0 1px;
}
.hm-folders li:hover .hm-folder-act { opacity: .75; }
.hm-folder-act:hover { opacity: 1; }

.hm-folder-rename {
    flex: 1;
    min-width: 0;
    border: 1px solid #2c5aa0;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: .88rem;
}

.hm-folder-add { padding: 8px 12px; }
.hm-folder-addbtn {
    background: none;
    border: 1px dashed #b6c2d0;
    border-radius: 6px;
    color: #6b7684;
    padding: 6px 10px;
    width: 100%;
    cursor: pointer;
    font-size: .85rem;
}
.hm-folder-addbtn:hover { background: #eef3f9; color: #2c5aa0; border-color: #2c5aa0; }

/* 빠른 필터 (안 읽음/중요/첨부) */
.hm-folders .hm-quick {
    list-style: none;
    margin: 0 0 6px;
    padding: 0 0 8px;
    border-bottom: 1px solid #e4e9f0;
}
.hm-quick li {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 9px 16px;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
    color: #333;
}
.hm-quick li:hover { background: #e9eff7; }
.hm-quick li.active { color: #2c5aa0; font-weight: 700; background: #dbe7f5; }
.hm-quick-ico { width: 18px; text-align: center; font-size: 1.02rem; }
.hm-q-unseen .hm-quick-ico { color: #2c5aa0; }   /* 안 읽음: 파란 봉투 */
.hm-q-flag .hm-quick-ico { color: #f5b301; }     /* 중요: 노란 별 */
.hm-q-attach .hm-quick-ico { color: #6b7684; }   /* 첨부: 회색 클립 */
.hm-quick-badge { margin-left: auto; }           /* 안읽음 개수는 오른쪽 끝에 */

/* 사이드바 섹션 제목 (내 메일함) */
.hm-side-sec {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 4px;
    font-size: .8rem;
    color: #8a97a5;
    font-weight: 700;
}
.hm-side-add { cursor: pointer; font-size: .95rem; padding: 0 2px; }
.hm-side-add:hover { color: #2c5aa0; }

/* 내 메일함(사용자 폴더): 불릿 표시 */
.hm-customlist li .hm-folder-name::before { content: "•"; color: #c3ccd6; margin-right: 8px; }

/* 내 메일함 ⋮ 메뉴: 마우스를 올리면 나타나고, 클릭 시 팝업 */
.hm-folders li { position: relative; }
.hm-folder-right { display: inline-flex; align-items: center; gap: 4px; }

.hm-kebab {
    visibility: hidden;
    cursor: pointer;
    color: #8a97a5;
    font-weight: 700;
    padding: 0 5px;
    border-radius: 4px;
    line-height: 1.2;
}
.hm-folders li:hover .hm-kebab,
.hm-kebab.open { visibility: visible; }
.hm-kebab:hover, .hm-kebab.open { background: #dbe3ec; color: #2c5aa0; }

.hm-folder-menu {
    position: absolute;
    top: calc(100% - 4px);
    right: 8px;
    z-index: 30;
    background: #fff;
    border: 1px solid #c9d3de;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
    padding: 4px;
    display: flex;
    flex-direction: column;
    min-width: 132px;
}
.hm-folder-menu button {
    background: none;
    border: none;
    text-align: left;
    padding: 7px 12px;
    font-size: .85rem;
    cursor: pointer;
    border-radius: 5px;
    color: #333;
    font-family: inherit;
    white-space: nowrap;
}
.hm-folder-menu button:hover:not(:disabled) { background: #eef4fb; color: #2c5aa0; }
.hm-folder-menu button:disabled { opacity: .35; cursor: default; }
.hm-menu-sep { height: 1px; background: #e4e9f0; margin: 3px 6px; }

.hm-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: transparent;
}

/* 스팸함/휴지통 + 비우기 */
.hm-folders .hm-utillist { margin-top: 8px; border-top: 1px solid #e4e9f0; padding-top: 6px; }
.hm-util-count { font-size: .78rem; color: #98a3b0; margin-left: 6px; font-weight: 400; }

.hm-empty-btn {
    background: #fff;
    border: 1px solid #c9d3de;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: .75rem;
    color: #666;
    cursor: pointer;
    flex-shrink: 0;
}
.hm-empty-btn:hover { border-color: #e5484d; color: #e5484d; }

/* 메일 목록 */
.hm-list {
    border-right: 1px solid #dde3ea;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 목록 제목: "받은 메일함  0 / 7,079" */
.hm-list-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 8px;
    background: #fff;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.hm-list-title h2 { margin: 0; font-size: 1.15rem; }
.hm-count { font-size: .95rem; color: #666; }
.hm-count b { color: #2c5aa0; }

/* 목록 툴바: 삭제/스팸/답장/… + 페이징 */
.hm-toolbar {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-top: 1px solid #eef1f5;
    border-bottom: 1px solid #dde3ea;
    background: #fff;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.hm-selall { display: flex; align-items: center; padding: 0 4px 0 2px; }
.hm-tb-sep { width: 1px; height: 18px; background: #e0e6ed; margin: 0 4px; }

.hm-paging { font-size: .85rem; color: #555; }

.hm-btn {
    background: #fff;
    border: 1px solid #c9d3de;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: .85rem;
}
.hm-btn:hover:not(:disabled) { background: #eef3f9; }
.hm-btn:disabled { opacity: .45; cursor: default; }

.hm-msgs {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

/* 한 줄 행: [체크][별][봉투][보낸사람][📎][제목][날짜][크기] */
.hm-row {
    display: grid;
    grid-template-columns: 30px 24px 26px 170px 22px 1fr 74px 64px;
    align-items: center;
    padding: 0 10px;
    height: 38px;
    border-bottom: 1px solid #f0f3f7;
    cursor: pointer;
    font-size: .88rem;
}
.hm-row:hover { background: #f4f8fd; }
.hm-row.unread { background: #fbfdff; }
.hm-row input[type="checkbox"] { margin: 0; }

.hm-row-env { color: #c9d3de; text-align: center; font-size: .95rem; }
.hm-row.unread .hm-row-env { color: #2c5aa0; }

.hm-row-from {
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
}
.hm-row.unread .hm-row-from,
.hm-row.unread .hm-row-subject { font-weight: 700; }

.hm-row-clip { text-align: center; font-size: .8rem; }

.hm-row-subject {
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 10px;
}

.hm-row-date { font-size: .8rem; color: #888; text-align: right; }
.hm-row-size { font-size: .78rem; color: #98a3b0; text-align: right; }

.hm-msg-focused { box-shadow: inset 3px 0 0 #2c5aa0; background: #eef4fb; }

/* 대화(스레드) 행 */
.hm-trow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 38px;
    border-bottom: 1px solid #f0f3f7;
    cursor: pointer;
    font-size: .88rem;
}
.hm-trow:hover { background: #f4f8fd; }
.hm-trow.unread .hm-row-from,
.hm-trow.unread .hm-row-subject { font-weight: 700; }
.hm-trow .hm-row-from { flex: 0 0 150px; }
.hm-trow .hm-row-subject { flex: 1; }
.hm-trow-mark { width: 14px; color: #8a97a5; flex-shrink: 0; }

.hm-msg-folder {
    font-size: .72rem;
    background: #e8eef6;
    color: #46617f;
    border-radius: 3px;
    padding: 0 6px;
    margin-left: auto;
    margin-right: 6px;
    flex-shrink: 0;
}

.hm-searchopts {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 12px;
    background: #f4f8fd;
    border-bottom: 1px solid #dde3ea;
    font-size: .85rem;
    flex-wrap: wrap;
}
.hm-searchopts label { display: flex; align-items: center; gap: 6px; color: #555; }

.hm-thread-count {
    background: #2c5aa0;
    color: #fff;
    border-radius: 9px;
    font-size: .72rem;
    padding: 0 7px;
    flex-shrink: 0;
}

.hm-thread-child {
    padding-left: 28px !important;
    background: #fbfcfe;
    border-left: 3px solid #dbe3ec;
}

/* 본문 (열람 시에만 표시 — .hm-mail.hm-detail-open 규칙이 켠다) */
.hm-view {
    flex-direction: column;
    min-height: 0;
    background: #fff;
}

.hm-view-head {
    padding: 14px 18px;
    border-bottom: 1px solid #dde3ea;
    flex-shrink: 0;
}

.hm-view-head h2 { margin: 0 0 8px; font-size: 1.15rem; }

.hm-view-meta { font-size: .85rem; color: #555; display: grid; gap: 2px; }
.hm-view-meta b { display: inline-block; width: 64px; color: #888; font-weight: 600; }

.hm-attachments { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }

.hm-attachment {
    border: 1px solid #c9d3de;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: .85rem;
    text-decoration: none;
    color: #2c5aa0;
    background: #f7f9fb;
}
.hm-attachment:hover { background: #e9eff7; }

.hm-imgblock {
    margin-top: 10px;
    background: #fff8e1;
    border: 1px solid #f0dc9c;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hm-body {
    flex: 1;
    overflow: auto;
    padding: 18px;
}

.hm-body img { max-width: 100%; }

.hm-plaintext {
    white-space: pre-wrap;
    font-family: inherit;
    margin: 0;
}

/* ─── 메일쓰기 ────────────────────────────── */
.hm-compose {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #fff;
}

.hm-compose-head {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 18px 12px;
    border-bottom: 1px solid #dde3ea;
    flex-shrink: 0;
}

.hm-btn-primary {
    background: #2c5aa0;
    color: #fff;
    border-color: #2c5aa0;
    font-weight: 700;
}
.hm-btn-primary:hover:not(:disabled) { background: #244b86; }

.hm-autosave { font-size: .78rem; color: #9aa5b1; margin-left: 6px; }

.hm-schedule {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .82rem;
    color: #555;
}
.hm-schedule input {
    border: 1px solid #c9d3de;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: .82rem;
}

.hm-sendbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #eaf3ff;
    border-bottom: 1px solid #b9d4f0;
    font-size: .9rem;
    color: #234;
}

/* 제목줄: '메일 쓰기' + 자동저장 표시 */
.hm-compose-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 14px 18px 6px;
    flex-shrink: 0;
}
.hm-compose-title h2 { margin: 0; font-size: 1.15rem; }

/* 좌측 라벨 + 밑줄형 입력 행 (메일플러그 스타일) */
.hm-cfields {
    padding: 0 18px;
    flex-shrink: 0;
}

.hm-cfield {
    display: grid;
    grid-template-columns: 92px 1fr;
    align-items: center;
    border-bottom: 1px solid #eef1f5;
    min-height: 44px;
}
.hm-cfield:focus-within { border-bottom-color: #2c5aa0; }

.hm-cfield > label {
    font-size: .85rem;
    color: #666;
    font-weight: 600;
}

.hm-cfield > input {
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 2px;
    font-size: .92rem;
    min-width: 0;
}

.hm-cattach {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

/* 에디터 서식 도구줄 */
.hm-etoolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 18px;
    border-top: 1px solid #eef1f5;
    border-bottom: 1px solid #eef1f5;
    margin-top: 8px;
    flex-shrink: 0;
}

.hm-etoolbar button {
    background: #fff;
    border: 1px solid #c9d3de;
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    font-size: .85rem;
}
.hm-etoolbar button:hover { background: #eef3f9; }

.hm-tb-select {
    border: 1px solid #c9d3de;
    border-radius: 4px;
    padding: 3px 4px;
    font-size: .82rem;
}
.hm-tb-color {
    width: 28px;
    height: 26px;
    padding: 0;
    border: 1px solid #c9d3de;
    border-radius: 4px;
    cursor: pointer;
}
.hm-tb-linkinput {
    border: 1px solid #2c5aa0;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: .82rem;
    width: 160px;
}
.hm-tb-img {
    background: #fff;
    border: 1px solid #c9d3de;
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
}
.hm-tb-img:hover { background: #eef3f9; }

.hm-editor {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 18px;
    outline: none;
    font-size: .95rem;
    line-height: 1.6;
}

.hm-file-label { display: inline-block; cursor: pointer; }

.hm-attach-hint { font-size: .78rem; color: #999; }

.hm-attach-remove {
    cursor: pointer;
    color: #b32121;
    margin-left: 4px;
    font-weight: 700;
}

.hm-view-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.hm-notice {
    margin: 10px;
    padding: 10px 14px;
    background: #e8f5ec;
    border: 1px solid #a9d8b8;
    border-radius: 4px;
    color: #1c7c3c;
    font-size: .85rem;
}

/* ─── 목록 확장 (별표/검색) ──────────────── */
.hm-star {
    cursor: pointer;
    color: #ccc;
    font-size: 1rem;
    line-height: 1;
    user-select: none;
}
.hm-star.on { color: #f5b301; }
.hm-star:hover { color: #f5b301; }

.hm-search {
    border: 1px solid #c9d3de;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: .85rem;
    width: 170px;
}

.hm-move-select {
    border: 1px solid #c9d3de;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: .85rem;
}

/* 쿼터 */
.hm-quota {
    padding: 12px 14px;
    border-top: 1px solid #dde3ea;
    font-size: .78rem;
    color: #777;
}

.hm-quota-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-bottom: 5px;
    overflow: hidden;
}

.hm-quota-fill {
    height: 100%;
    background: #2c5aa0;
    border-radius: 3px;
}
.hm-quota-fill.danger { background: #e5484d; }


/* ─── 일반 페이지 (주소록/설정) ───────────── */
.hm-page {
    padding: 22px 26px;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

.hm-page h2 { margin: 0 0 16px; font-size: 1.3rem; }

.hm-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid #dde3ea; }

.hm-tabs button {
    background: none;
    border: none;
    padding: 9px 18px;
    font-size: .95rem;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.hm-tabs button.active { color: #2c5aa0; font-weight: 700; border-bottom-color: #2c5aa0; }

.hm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.hm-table th {
    text-align: left;
    padding: 8px 10px;
    background: #f7f9fb;
    border-bottom: 2px solid #dde3ea;
    color: #555;
    font-size: .82rem;
}
.hm-table td { padding: 8px 10px; border-bottom: 1px solid #eef1f5; }
.hm-table a { color: #2c5aa0; text-decoration: none; }
.hm-table a:hover { text-decoration: underline; }

.hm-contact-add {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.hm-contact-add input {
    border: 1px solid #c9d3de;
    border-radius: 4px;
    padding: 7px 10px;
    font-size: .88rem;
    flex: 1;
    min-width: 120px;
}

.hm-contact-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    font-size: .85rem;
    color: #555;
}
.hm-contact-toolbar a.hm-btn { text-decoration: none; color: #2c5aa0; }

/* 환경설정: 좌측 카테고리 메뉴 + 우측 콘텐츠 (메일플러그 스타일) */
.hm-settings {
    display: flex;
    height: 100%;
    min-height: 0;
}

.hm-set-nav {
    width: 210px;
    flex-shrink: 0;
    border-right: 1px solid #dde3ea;
    background: #f7f9fb;
    padding: 14px 0;
    overflow-y: auto;
}
.hm-set-nav h2 { margin: 0; padding: 0 18px 12px; font-size: 1.15rem; }
.hm-set-nav ul { list-style: none; margin: 0; padding: 0; }
.hm-set-nav li {
    padding: 10px 18px;
    cursor: pointer;
    font-size: .92rem;
    color: #444;
}
.hm-set-nav li:hover { background: #e9eff7; }
.hm-set-nav li.active { background: #dbe7f5; color: #2c5aa0; font-weight: 700; }

.hm-set-nav li .hm-badge { margin-left: 6px; }

/* 하위 항목(주소록 그룹 등): 들여쓰기 + 불릿 */
.hm-set-nav li.hm-set-sub { padding-left: 34px; font-size: .88rem; color: #555; }
.hm-set-nav li.hm-set-sub::before { content: "•"; color: #c3ccd6; margin-right: 8px; }
.hm-set-nav li.hm-set-sub.active { color: #2c5aa0; }

/* 콘텐츠 상단 제목줄 (제목 + 카운트 + 우측 버튼들) */
.hm-content-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.hm-content-title h3 { margin: 0; font-size: 1.1rem; }
.hm-content-title .hm-count { font-size: .9rem; color: #2c5aa0; font-weight: 700; margin-left: 4px; }

.hm-set-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 22px 26px;
}

.hm-settings-sec {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}
.hm-settings-sec h3 { margin: 0; font-size: 1.05rem; }

.hm-hint { margin: 0; font-size: .82rem; color: #888; }

.hm-input, .hm-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c9d3de;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: .9rem;
    font-family: inherit;
}

.hm-check { font-size: .9rem; display: flex; align-items: center; gap: 6px; }

.hm-signature { color: #666; font-size: .9em; }

/* 서명 HTML 편집기 */
.hm-sig-editorbox {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.hm-sig-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hm-sig-editor {
    border: 1px solid #c9d3de;
    border-radius: 6px;
    min-height: 130px;
    padding: 10px 12px;
    font-size: .92rem;
    line-height: 1.6;
    outline: none;
    background: #fff;
    overflow-y: auto;
}
.hm-sig-editor:focus { border-color: #2c5aa0; }
.hm-sig-editor img { max-width: 100%; }
.hm-sig-actions { display: flex; align-items: center; gap: 14px; }

/* 저장된 서명 미리보기 (표 안) */
.hm-sig-preview {
    color: #555;
    font-size: .85rem;
    max-width: 420px;
    max-height: 110px;
    overflow: auto;
}
.hm-sig-preview img { max-width: 180px; max-height: 80px; }

/* ─── 추가 이미지 / EML 뷰어 ──────────────── */
.hm-extra-sep { margin: 18px 0 10px; border: 0; border-top: 1px dashed #c9d3de; }

.hm-extra-images { display: flex; flex-wrap: wrap; gap: 12px; }

.hm-extra-img { margin: 0; }
.hm-extra-img img { max-width: 380px; max-height: 300px; border: 1px solid #e2e8f0; border-radius: 4px; }
.hm-extra-img figcaption { font-size: .75rem; color: #999; margin-top: 3px; }

.hm-eml-filename {
    font-size: .85rem;
    color: #666;
    background: #eef1f5;
    border-radius: 10px;
    padding: 2px 10px;
}

.hm-eml-view {
    border: 1px solid #dde3ea;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.hm-eml-view .hm-body { max-height: 60vh; }

.hm-attachment a { color: #2c5aa0; text-decoration: none; }
.hm-attachment a:hover { text-decoration: underline; }

/* ─── 관리자 ─────────────────────────────── */
.hm-admin { max-width: 1100px; }

.hm-row-inactive { opacity: .45; }

.hm-cell-actions { display: flex; gap: 4px; flex-wrap: wrap; }

.hm-btn-danger {
    background: #e5484d;
    color: #fff;
    border-color: #e5484d;
    font-weight: 700;
}

.hm-pwbox {
    background: #fff8e1;
    border: 1px solid #f0dc9c;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: .92rem;
}
.hm-pwbox code {
    background: #333;
    color: #7CFC00;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 1.05rem;
    letter-spacing: 1px;
    user-select: all;
}

/* 상태 표시 */
.hm-loading, .hm-empty {
    padding: 30px;
    text-align: center;
    color: #999;
    font-size: .9rem;
}

.hm-loading::before {
    content: "";
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid #c9d3de;
    border-top-color: #2c5aa0;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: -3px;
    animation: hmspin .8s linear infinite;
}

@keyframes hmspin {
    to { transform: rotate(360deg); }
}

.hm-btn-active {
    background: #dbe7f5;
    border-color: #2c5aa0;
    color: #2c5aa0;
    font-weight: 700;
}

.hm-inline-input {
    border: 1px solid #c9d3de;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: .85rem;
    width: 100%;
    box-sizing: border-box;
}

/* ─── 모바일 반응형 ───────────────────────── */
@media (max-width: 820px) {
    /* 레일: 상단 가로 바로 전환 */
    .hm-body-row { flex-direction: column; }
    .hm-rail {
        flex-direction: row;
        width: auto;
        border-right: none;
        border-bottom: 1px solid #e0e6ed;
        padding: 0 4px;
    }
    .hm-rail a { flex-direction: row; gap: 4px; padding: 7px 9px; border-left: none; border-bottom: 3px solid transparent; }
    .hm-rail a.active { border-bottom-color: #2c5aa0; }

    .hm-mail { display: flex; flex-direction: column; }

    /* 사이드바: 상단 가로 스크롤 바로 전환 */
    .hm-folders {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 4px;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid #dde3ea;
        padding: 6px 8px;
        flex-shrink: 0;
    }
    .hm-folders ul { display: flex; flex-direction: row; gap: 2px; margin: 0; padding: 0; border: none; }
    .hm-folders li { padding: 7px 10px; white-space: nowrap; border-radius: 14px; }
    .hm-side-btns { padding: 0; flex-shrink: 0; }
    .hm-compose-btn, .hm-tome-btn { padding: 8px 12px; font-size: .85rem; border-radius: 14px; }
    .hm-side-sec, .hm-quota, .hm-empty-btn, .hm-util-count { display: none; }
    .hm-quick { border: none; margin: 0; padding: 0; }
    .hm-quick li { border-radius: 14px; white-space: nowrap; padding: 7px 10px; }

    /* 목록/본문: 한 화면씩 전환 (본문 열람 시 사이드바도 숨김) */
    .hm-list { flex: 1; min-height: 0; border-right: none; }
    .hm-mail.hm-detail-open .hm-folders { display: none; }
    .hm-mail.hm-detail-open .hm-view { flex: 1; min-height: 0; }

    /* 상단바 압축 */
    .hm-user { display: none; }
    .hm-brand { font-size: 1rem; }

    /* 목록 헤더 압축 */
    .hm-search { width: 110px; }
    .hm-list-title, .hm-toolbar { flex-wrap: wrap; }

    /* 행 압축: 크기 열 숨김 */
    .hm-row { grid-template-columns: 26px 22px 22px 110px 18px 1fr 62px; }
    .hm-row-size { display: none; }

    /* 표는 가로 스크롤 */
    .hm-table { display: block; overflow-x: auto; }

    /* 환경설정: 좌측 메뉴를 상단 가로 바로 전환 */
    .hm-settings { flex-direction: column; }
    .hm-set-nav {
        width: auto;
        border-right: none;
        border-bottom: 1px solid #dde3ea;
        padding: 8px;
        overflow-x: auto;
    }
    .hm-set-nav h2 { display: none; }
    .hm-set-nav ul { display: flex; gap: 2px; }
    .hm-set-nav li { padding: 7px 10px; white-space: nowrap; border-radius: 14px; }
    .hm-set-content { padding: 12px 10px; }

    .hm-page { padding: 14px 10px; }
    .hm-body { padding: 12px; }
    .hm-view-head { padding: 10px 12px; }
}

.hm-error {
    margin: 10px;
    padding: 10px 14px;
    background: #fdecec;
    border: 1px solid #f5b5b5;
    border-radius: 4px;
    color: #b32121;
    font-size: .85rem;
}

/* ─── 로그인 ─────────────────────────────── */
.hm-login-wrap {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c5aa0, #1d3c6e);
}

.hm-login-box {
    background: #fff;
    border-radius: 10px;
    padding: 36px 32px;
    width: 340px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hm-login-box h1 { margin: 0; font-size: 1.5rem; text-align: center; }

.hm-login-sub { margin: 0 0 8px; text-align: center; color: #888; font-size: .9rem; }

/* 밑줄형 입력줄 — 입력칸을 줄 하나로 표현해 화면을 단순하게 (메일플러그 스타일 참고) */
.hm-uline {
    display: flex;
    align-items: center;
    border-bottom: 1.5px solid #c9d3de;
    padding: 2px;
}
.hm-uline:focus-within { border-bottom-color: #2c5aa0; }
.hm-uline input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 4px;
    font-size: .95rem;
}

.hm-login-box button {
    background: #2c5aa0;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 11px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
}
.hm-login-box button:hover { background: #244b86; }

.hm-login-error {
    background: #fdecec;
    border: 1px solid #f5b5b5;
    border-radius: 6px;
    padding: 9px 12px;
    color: #b32121;
    font-size: .85rem;
}

/* 아이디줄의 자동 도메인 표시 (클릭 시 직접 입력으로 전환) */
.hm-idrow #hm-dom-text {
    color: #222;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    padding: 0 2px;
}
.hm-idrow #hm-dom-text:hover { color: #2c5aa0; }
#hm-dom-input { display: none; flex: 0 1 48%; color: #2c5aa0; font-weight: 600; }
#hm-dom-input.hm-show { display: block; }

/* 재접속 모드: 기억된 계정 표시 */
.hm-login-account {
    align-self: center;
    color: #222;
    font-weight: 600;
    font-size: .98rem;
    text-decoration: none;
    padding: 6px 2px;
}
.hm-login-account:hover { color: #2c5aa0; }
.hm-login-account .hm-caret { color: #888; font-size: .8rem; }

/* 하단 링크 (버튼도 링크처럼) */
.hm-login-links { display: flex; justify-content: center; gap: 20px; margin-top: 4px; }
.hm-login-links a, .hm-login-links button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #2c5aa0;
    font-size: .85rem;
    font-family: inherit;
    text-decoration: none;
}
.hm-login-links a:hover, .hm-login-links button:hover { text-decoration: underline; }

.hm-apply-link {
    text-align: center;
    color: #2c5aa0;
    font-size: .85rem;
    text-decoration: none;
    margin-top: 4px;
}
.hm-apply-link:hover { text-decoration: underline; }

/* ─── 계정 신청 ───────────────────────────── */
.hm-apply-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c5aa0, #1d3c6e);
    padding: 24px 12px;
    box-sizing: border-box;
}

.hm-apply-box {
    background: #fff;
    border-radius: 10px;
    padding: 30px 28px;
    width: 400px;
    max-width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hm-apply-box h1 { margin: 0; font-size: 1.35rem; text-align: center; }
.hm-apply-sub { margin: 0 0 6px; text-align: center; color: #888; font-size: .82rem; line-height: 1.5; }

.hm-apply-field { display: flex; flex-direction: column; gap: 4px; }
.hm-apply-field label { font-size: .82rem; color: #555; font-weight: 600; }
.hm-apply-field input, .hm-apply-field select, .hm-apply-field textarea {
    border: 1px solid #c9d3de;
    border-radius: 6px;
    padding: 9px 10px;
    font-size: .9rem;
    font-family: inherit;
    box-sizing: border-box;
}
.hm-apply-field input:focus, .hm-apply-field select:focus, .hm-apply-field textarea:focus {
    outline: 2px solid #2c5aa0;
    border-color: transparent;
}

.hm-apply-idrow { display: flex; align-items: center; gap: 6px; }
.hm-apply-idrow input { flex: 1; }
.hm-apply-idrow span { color: #888; }
.hm-apply-idrow select { max-width: 55%; }

.hm-captcha-row { display: flex; align-items: center; gap: 8px; }
.hm-captcha-img {
    border: 1px solid #c9d3de;
    border-radius: 6px;
    height: 56px;
    background: #f5f7fa;
}

.hm-apply-submit {
    background: #2c5aa0;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
}
.hm-apply-submit:hover:not(:disabled) { background: #244b86; }
.hm-apply-submit:disabled { opacity: .6; cursor: default; }
