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-ui {
    display: none;
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 1000;
    background: #fff3cd;
    border: 1px solid #e6c980;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .88rem;
    color: #5b4a12;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
    max-width: min(640px, calc(100vw - 24px));
}
#blazor-error-ui .reload,
#blazor-error-ui .hm-err-btn {
    color: #2c5aa0;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 8px;
}
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 10px; font-weight: 700; }
#hm-error-detail {
    display: none;
    margin: 8px 0 0;
    background: #222;
    color: #ffb4b4;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: .74rem;
    line-height: 1.5;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.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: linear-gradient(90deg, #ffffff 0%, #ffffff 14%, #2c5aa0 60%);
    color: #fff;
    flex-shrink: 0;
}

.hm-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2c5aa0; /* 좌측은 흰 배경이므로 파란 글자 */
    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-ver { font-size: .68rem; color: rgba(255, 255, 255, .55); }

.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: 0 0 8px; /* 첫 항목이 헤더 바로 아래부터 시작 (사용자 선택 B안) */
    gap: 2px;
    flex-shrink: 0;
}

/* 레일 항목은 고정 높이 56px 밴드 — 사이드바 버튼줄·목록 제목줄과 같은 기준선.
   이모지 글리프가 글자 박스 안에서 ~3px 아래에 그려지므로 padding을 5px로 줄여
   눈에 보이는 아이콘 상단이 메일쓰기 버튼 상단(68px 라인)과 일치하게 한다 */
.hm-rail a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    height: 56px;
    padding-top: 5px;
    box-sizing: border-box;
    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; }

/* 사이드바 상단 버튼 — 레일 아이콘과 같은 68px 상단선에서 시작 */
.hm-side-btns {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    height: 56px;
    box-sizing: border-box;
    padding: 8px 12px 0;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.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;
    padding: 8px 0 10px; /* 상단은 레일과 같은 8px에서 시작 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hm-folders-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* 마우스를 올렸을 때만 보이는 스크롤바 (사이드바·메일 목록 공용) */
.hm-hoverbar {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
.hm-hoverbar:hover { scrollbar-color: #b9c2cf transparent; }
.hm-hoverbar::-webkit-scrollbar { width: 8px; }
.hm-hoverbar::-webkit-scrollbar-track { background: transparent; }
.hm-hoverbar::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.hm-hoverbar:hover::-webkit-scrollbar-thumb { background: #b9c2cf; }

.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-folder-path { color: #9aa5b1; font-weight: normal; }
.hm-folders li.hm-folder-child-add { display: flex; align-items: center; gap: 6px; padding-top: 4px; padding-bottom: 4px; }
.hm-folder-child-add .hm-folder-rename { flex: 1; min-width: 0; }

/* 내 메일함 ⋮ 메뉴: 마우스를 올리면 나타나고, 클릭 시 팝업 */
.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: flex-start;
    gap: 10px;
    /* 제목도 레일 아이콘·메일쓰기 버튼과 같은 68px 상단선에서 시작 (52+16) */
    min-height: 64px;
    box-sizing: border-box;
    padding: 16px 16px 0;
    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-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 12px 0 16px;
    flex-shrink: 0;
}
.hm-pg {
    min-width: 30px;
    height: 30px;
    border: 1px solid transparent;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: .88rem;
    color: #556;
}
.hm-pg:hover:not(:disabled) { background: #eef3f9; }
.hm-pg:disabled { opacity: .3; cursor: default; }
.hm-pg.active { border-color: #2c5aa0; color: #2c5aa0; font-weight: 700; }

.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 108px 64px;   /* 날짜 열: '26-09-21 11:08' (시:분 포함) */
    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; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hm-d-short { display: none; }   /* 모바일에서만: '09-21 11:08' */
.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; font-size: 1.2rem; }

/* 제목줄: 별표 + 제목 */
.hm-view-subject {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0 10px;
    border-bottom: 1px solid #eef1f5;
    margin-bottom: 8px;
}
.hm-view-star { font-size: 1.1rem; }

/* 메타 정보: 보낸 사람/받는 사람 + 우측 날짜/발송 국가 (메일플러그 스타일) */
.hm-view-meta { font-size: .85rem; color: #555; display: grid; gap: 3px; }
.hm-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hm-meta-label { width: 64px; flex-shrink: 0; color: #888; font-weight: 600; }
.hm-meta-value { color: #333; }
.hm-meta-date { color: #666; }
.hm-meta-sub { margin-top: -2px; }

/* 수신자 다수 메일: 기본 2줄로 접고 '전체 보기'로 펼친다 */
.hm-meta-recips { flex: 1; min-width: 0; word-break: break-all; }
.hm-meta-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hm-meta-more {
    color: #2c5aa0;
    cursor: pointer;
    white-space: nowrap;
    font-size: .8rem;
    align-self: flex-start;
}
.hm-meta-more:hover { text-decoration: underline; }
.hm-sender-acts a { color: #556; cursor: pointer; text-decoration: none; }
.hm-sender-acts a:hover { color: #2c5aa0; text-decoration: underline; }
.hm-meta-sep { color: #ccc; }
.hm-block-link { color: #d9534f !important; }

/* 본문 이동 드롭다운 */
.hm-move-wrap { position: relative; }
.hm-move-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 500;
    background: #fff;
    border: 1px solid #c9d3de;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
    display: flex;
    flex-direction: column;
    min-width: 150px;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px 0;
}
.hm-move-menu button {
    background: none;
    border: none;
    text-align: left;
    padding: 7px 14px;
    font-size: .86rem;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
}
.hm-move-menu button:hover { background: #eef4fb; color: #2c5aa0; }

/* 확인 모달 (스팸 등록 등) */
.hm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .25);
    z-index: 900;
}
.hm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 901;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
    padding: 20px 24px;
    width: min(420px, 90vw);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: .9rem;
}
.hm-modal h3 { margin: 0; font-size: 1.05rem; }
.hm-modal p { margin: 0; }
.hm-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* 첨부 미리보기 */
.hm-attach-preview {
    margin-left: 6px;
    color: #2c5aa0;
    font-size: .8rem;
    cursor: pointer;
    white-space: nowrap;
}
.hm-attach-preview:hover { text-decoration: underline; }
.hm-attpreview-modal {
    /* 화면을 거의 꽉 채우는 전체 화면 미리보기 */
    width: 98vw;
    height: 96vh;
    max-width: none;
    display: flex;
    flex-direction: column;
    padding: 14px 18px;
}
.hm-attpreview-head { display: flex; align-items: center; gap: 8px; }
.hm-attpreview-frame {
    flex: 1;
    min-height: 0;
    border: 1px solid #dde3ea;
    border-radius: 6px;
    background: #f7f9fb;
    margin-top: 8px;
    width: 100%;
}

/* 계정 신청 — 접속 도메인 고정 표시 */
.hm-apply-domain { font-weight: 600; color: #2c5aa0; white-space: nowrap; }

/* 메일 쓰기 — 보내는 사람 선택 */
.hm-from-select { max-width: 320px; }

/* 메일 쓰기 — 옵션 행 / 미리보기 모달 */
.hm-copts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hm-preview-modal { width: min(720px, 94vw); max-height: 84vh; }
.hm-preview-meta {
    font-size: .85rem;
    color: #555;
    display: grid;
    gap: 3px;
    border-bottom: 1px solid #e4e9f0;
    padding-bottom: 8px;
}
.hm-preview-meta b { display: inline-block; width: 74px; color: #888; }
.hm-preview-body {
    overflow-y: auto;
    max-height: 55vh;
    padding: 8px 2px;
    font-size: .95rem;
    line-height: 1.6;
}
.hm-preview-body img { max-width: 100%; }

/* 주소록 빠른 등록 패널 */
.hm-quickadd {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    padding: 8px 12px;
    background: #f4f8fd;
    border: 1px solid #c9d9ee;
    border-radius: 6px;
    font-size: .85rem;
    flex-wrap: wrap;
}

/* 인쇄: 본문 영역만 */
@media print {
    .hm-topbar, .hm-rail, .hm-folders, .hm-list, .hm-view-actions,
    .hm-sender-acts, #blazor-error-ui { display: none !important; }
    .hm-shell, .hm-body-row, .hm-main, .hm-mail, .hm-view { display: block !important; overflow: visible !important; }
    .hm-body { overflow: visible !important; }
}

.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-spam-card {
    margin-top: 12px;
    background: #fdf3f3;
    border: 1px solid #eec3c3;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: .88rem;
}
.hm-spam-head { font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
.hm-spam-sub { color: #556; margin-bottom: 8px; }
.hm-spam-table { background: #fff; border-radius: 6px; margin-bottom: 8px; }
.hm-spam-table td { padding: 4px 10px !important; font-size: .84rem; }
.hm-spam-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 설정 → 스팸 관리 소제목 */
.hm-spam-h { margin: 18px 0 4px; font-size: .95rem; }

/* 이전 로그인 정보 토스트 (로그인 직후 우측 하단 3초) */
.hm-login-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 4000;
    background: #2b3a55;
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: .85rem;
    line-height: 1.6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .35s, transform .35s;
    cursor: default;
}
.hm-login-toast.show { opacity: 1; transform: translateY(0); }

/* 비밀번호 변경 안내(/pw-change) */
.hm-pwchange-wrap {
    display: flex;
    justify-content: center;
    padding: 60px 16px;
}
.hm-pwchange-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid #dde3ec;
    border-radius: 12px;
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hm-pwchange-card h2 { font-size: 1.15rem; }
.hm-pwchange-actions { display: flex; gap: 8px; margin-top: 6px; }

/* 화면 관리(브랜딩) — 상단/로그인 로고와 관리 화면 미리보기 */
.hm-brand-logo { height: 30px; max-width: 200px; object-fit: contain; display: block; }
.hm-login-logo { display: flex; justify-content: center; margin: 0 0 6px; }
.hm-login-logo img { max-width: 336px; max-height: 82px; object-fit: contain; }
.hm-brand-upload { display: flex; gap: 8px; align-items: center; }
.hm-brand-preview {
    background: #f4f6f9;
    border: 1px solid #dde3ec;
    border-radius: 8px;
    padding: 12px 18px;
    display: inline-flex;
    justify-content: center;
    min-width: 220px;
}
.hm-brand-preview img { max-width: 336px; max-height: 82px; object-fit: contain; }

/* 폴더 통수 대조 — 불일치 강조 */
.hm-cmp-bad td { background: #fdecec; color: #b32121; font-weight: 600; }

/* 관리자 화면 — 관리 대상 도메인 표시 */
.hm-scope-domain {
    margin: -6px 0 10px;
    padding: 4px 10px;
    background: #eef3fb;
    border-radius: 6px;
    color: #2a5699;
    font-size: .85rem;
    font-weight: 600;
}

/* DMARC 리포트 요약 카드 */
.hm-dmarc {
    margin-top: 12px;
    background: #f4f9f4;
    border: 1px solid #bfdec2;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: .88rem;
}
.hm-dmarc-head { font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
.hm-dmarc-sub { color: #556; margin-bottom: 8px; }
.hm-dmarc-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.hm-dmarc-ok { color: #1d7a2e; font-weight: 700; }
.hm-dmarc-clean { color: #1d7a2e; }
.hm-dmarc-warn { color: #b32121; font-weight: 700; }
.hm-dmarc-table { background: #fff; border-radius: 6px; }
.hm-dmarc-table td, .hm-dmarc-table th { padding: 5px 10px !important; font-size: .84rem; }
.hm-dmarc-bad { background: #fdecec; }

.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;
    overflow-y: auto;    /* 본문 칸 최소 높이를 넘으면 화면 전체가 스크롤 */
    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-compose-sticky {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    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-sendlock { margin: 8px 18px 0; }

/* 주소 그룹(보내는 사람·받는 사람·참조·숨은 참조) — 연한 파란 패널 + 왼쪽 강조선으로 다른 항목과 구분 */
.hm-cgroup-addr {
    margin: 10px 0 6px;
    padding: 2px 12px 2px 10px;
    background: #f3f7fd;
    border-left: 3px solid #2c5aa0;
    border-radius: 0 8px 8px 0;
}
.hm-cgroup-addr .hm-cfield {
    border-bottom-color: #dbe6f5;
    min-height: 40px;
}
.hm-cgroup-addr .hm-cfield:last-child { border-bottom: none; }
.hm-cgroup-addr .hm-cfield:focus-within { border-bottom-color: #2c5aa0; }
.hm-cgroup-addr .hm-cfield > label { color: #2c5aa0; }
.hm-cgroup-addr .hm-cfield > input,
.hm-cgroup-addr .hm-from-select { background: transparent; }
.hm-cgroup-addr .hm-cfield > input::placeholder { color: #9fb1c8; }

/* 주소 입력칸 + [주소록] 버튼 */
.hm-cinput { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hm-cinput > input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 2px;
    font-size: .92rem;
    min-width: 0;
}
.hm-cinput > input::placeholder { color: #9fb1c8; }

/* 주소 칩 칸(받는 사람·참조·숨은 참조 — AddressField.razor) — 한 사람씩 '이름 <주소>' 알약 모양, ✎ 고치기 · ✕ 빼기.
   칩이 많으면 8줄까지 늘고 그 뒤로는 칸 안에서 스크롤(세로가 낮은 화면은 4줄) */
.hm-cfield-multi { align-items: start; }
.hm-cfield-multi > label { padding-top: 12px; }
.hm-cfield-multi .hm-cinput { align-items: flex-start; }
.hm-cfield-multi .hm-cinput > .hm-btn-sm { margin-top: 8px; }
.hm-chips {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 6px;
    padding: 6px 2px;
    min-height: 41px;
    box-sizing: border-box;
    max-height: calc(8 * 31px + 12px);
    overflow-y: auto;
    overflow-x: hidden;
    cursor: text;
}
@media (max-height: 800px) {
    .hm-chips { max-height: calc(4 * 31px + 12px); }
}
.hm-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    height: 26px;
    padding: 0 3px 0 10px;
    border: 1px solid #d3e1f5;
    border-radius: 13px;
    background: #e9f1fc;
    color: #1f2d3d;
    font-size: .86rem;
    cursor: default;
}
.hm-chip { overflow: hidden; }
/* 이름은 길면 … 로 줄이고 주소는 늘 끝까지 — 긴 가짜 이름(사칭)이 실제 주소를 가리지 못하게 */
.hm-chip-text { display: inline-flex; align-items: baseline; min-width: 0; }
.hm-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hm-chip-addr { flex-shrink: 0; white-space: nowrap; }
.hm-chip-name + .hm-chip-addr { margin-left: 4px; }
.hm-chip-btn {
    flex-shrink: 0;
    border: none;
    background: none;
    padding: 0;
    width: 20px;
    height: 20px;
    margin-left: 1px;
    border-radius: 50%;
    color: #6f7f92;
    font-size: .8rem;
    line-height: 20px;
    cursor: pointer;
}
.hm-chip-btn:hover { background: #d3e2f6; color: #2c5aa0; }
/* 주소가 아닌 칩 — 빨간 테두리·글자 (보내기 때 '잘못된 이메일 주소' 로도 알려 준다) */
.hm-chip.invalid { background: #fdeeee; border-color: #efb3b3; color: #b3261e; }
.hm-chip.invalid .hm-chip-btn:hover { background: #f8d7d7; color: #b3261e; }
/* 빈 입력칸에서 Backspace 한 번 — 다음 Backspace 로 빠질 칩 */
.hm-chip.selected { border-color: #2c5aa0; box-shadow: inset 0 0 0 1px #2c5aa0; background: #d6e5f8; }
.hm-chip-input {
    flex: 1 0 150px;
    min-width: 150px;
    border: none;
    outline: none;
    background: transparent;
    padding: 4px 2px;
    font: inherit;
    font-size: .92rem;
}
.hm-chip-input::placeholder { color: #9fb1c8; }
.hm-chip-edit {
    box-sizing: border-box;
    height: 26px;
    max-width: 100%;
    padding: 0 10px;
    border: 1px solid #2c5aa0;
    border-radius: 13px;
    outline: none;
    background: #fff;
    font: inherit;
    font-size: .86rem;
}
/* 휴대폰: 칸 이름을 위로 올려 칩이 한 줄을 다 쓰게 하고(이름 <주소> 가 잘리지 않게), [주소록] 버튼은 아이콘만 */
@media (max-width: 600px) {
    .hm-cfield.hm-cfield-multi, .hm-cfield.hm-cc-summary { grid-template-columns: 1fr; }
    .hm-cc-summary > span:first-child { display: none; }
    .hm-cfield-multi > label { padding-top: 8px; }
    .hm-chip-input { min-width: 90px; flex-basis: 90px; }
    .hm-cinput .hm-btn-label { display: none; }
    /* 긴 주소는 칩 안에서 줄을 바꿔 끝까지 보이게 (잘린 주소로는 누구인지 알 수 없다) */
    .hm-chip { height: auto; min-height: 26px; padding-top: 2px; padding-bottom: 2px; }
    .hm-chip-text { display: block; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
    .hm-chip-name, .hm-chip-addr { display: inline; white-space: normal; }
}
.hm-btn-sm { padding: 3px 8px; font-size: .78rem; white-space: nowrap; }

/* 받는 사람 칸 이름 + 참조·숨은 참조 접기 버튼(^) — 메일플러그와 같게. 접으면 두 줄을 숨기고(칸은 그대로 남김),
   거기 든 사람이 있으면 받는 사람 아래에 '참조 2명 · 숨은 참조 1명 포함 — 펼치기' */
.hm-clabel { display: flex; align-items: center; gap: 2px; min-width: 0; }
.hm-cfield-multi > .hm-clabel { padding-top: 8px; align-self: start; }
.hm-clabel > label { font-size: .85rem; color: #666; font-weight: 600; }
.hm-cgroup-addr .hm-clabel > label { color: #2c5aa0; }
.hm-cc-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: none;
    color: #2c5aa0;
    cursor: pointer;
}
.hm-cc-toggle:hover { background: #dde8f7; }
.hm-cc-toggle svg { transition: transform .15s; }
.hm-cc-toggle.closed svg { transform: rotate(180deg); }
.hm-cfield.hm-cc-collapsed { display: none; }
.hm-cgroup-addr .hm-cfield.hm-cfield-last { border-bottom: none; }
.hm-cgroup-addr .hm-cfield.hm-cc-summary { min-height: 30px; }
.hm-cc-summary-btn {
    justify-self: start;
    background: none;
    border: none;
    padding: 4px 2px;
    color: #2c5aa0;
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
}
.hm-cc-summary-btn:hover { text-decoration: underline; }

/* 주소 자동완성 드롭다운 (addrpick.js 가 body 에 붙인다) */
.hm-ac {
    position: absolute;
    z-index: 950;
    background: #fff;
    border: 1px solid #c9d6e8;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
    padding: 4px 0;
    max-height: 320px;
    max-width: calc(100vw - 16px);
    overflow-y: auto;
    font-size: .88rem;
}
.hm-ac-item { display: flex; gap: 10px; align-items: baseline; padding: 6px 12px; cursor: pointer; min-width: 0; }
.hm-ac-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hm-ac-item.active, .hm-ac-item:hover { background: #eef4fc; }
.hm-ac-name { font-weight: 600; color: #223; }
.hm-ac-mail { color: #2c5aa0; }
.hm-ac-dept { color: #888; font-size: .8rem; margin-left: auto; }

/* 주소록 고르기 모달 */
.hm-pick-modal { width: min(640px, 94vw); max-height: 84vh; }
.hm-pick-head { display: flex; align-items: center; gap: 10px; }
.hm-pick-head h3 { margin-right: auto; }
.hm-pick-search { padding: 7px 10px; border: 1px solid #c9d6e8; border-radius: 6px; font-size: .9rem; }
.hm-pick-list { overflow-y: auto; flex: 1; min-height: 200px; border: 1px solid #eef1f5; border-radius: 6px; padding: 4px 0; }
.hm-pick-sec { background: #f3f7fd; padding: 6px 10px; margin-top: 4px; }
.hm-pick-sec .hm-check { font-size: .85rem; }
.hm-pick-row { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 24px; cursor: pointer; font-size: .88rem; }
.hm-pick-row:hover { background: #f7f9fc; }
.hm-pick-name { font-weight: 600; min-width: 90px; }
.hm-pick-mail { color: #2c5aa0; }
@media (max-width: 767px) {
    .hm-btn-sm { padding: 3px 6px; }
    .hm-pick-name { min-width: 0; }
}

/* ─── 수신 확인 (보낸 메일함 옆 버튼 + ReceiptsView) ── */
.hm-rc-pill {
    margin-left: auto;
    margin-right: 4px;
    border: 1px solid #c9d6e8;
    border-radius: 10px;
    padding: 0 8px;
    font-size: .74rem;
    font-weight: 400;
    color: #46617f;
    background: #fff;
    line-height: 1.6;
    white-space: nowrap;
}
.hm-rc-pill:hover { border-color: #2c5aa0; color: #2c5aa0; }
.hm-rc-pill.active { background: #2c5aa0; border-color: #2c5aa0; color: #fff; font-weight: 700; }
.hm-rc-info { color: #8a97a5; cursor: help; font-size: .95rem; align-self: center; white-space: pre-line; }

/* 행: [체크][받는 사람][📎][제목][보낸 시각][상태][관리] */
.hm-rc-row {
    display: grid;
    grid-template-columns: 30px 170px 22px 1fr 108px 130px 84px;
    align-items: center;
    padding: 0 10px;
    height: 38px;
    border-bottom: 1px solid #f0f3f7;
    cursor: pointer;
    font-size: .88rem;
}
.hm-rc-row:hover { background: #f4f8fd; }
.hm-rc-row input[type="checkbox"] { margin: 0; }
.hm-rc-head { cursor: default; height: 32px; background: #f7f9fc; color: #667; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.hm-rc-head:hover { background: #f7f9fc; }
.hm-rc-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; color: #333; }
.hm-rc-date { text-align: right; padding-right: 12px; }
.hm-rc-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.hm-rc-status small { color: #98a3b0; margin-left: 4px; }
.hm-rc-status.read { color: #1c7c3c; }
.hm-rc-status.unread { color: #b32121; }
.hm-rc-status.partial { color: #b26a00; }
.hm-rc-status.na { color: #98a3b0; }
.hm-rc-manage { text-align: center; color: #98a3b0; }

/* 수신 현황 모달 */
.hm-rc-modal { width: min(760px, 94vw); max-height: 86vh; }
.hm-rc-subject { color: #445; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-rc-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hm-rc-bar b { color: #2c5aa0; }
.hm-rc-tablewrap { overflow-y: auto; flex: 1; min-height: 120px; border: 1px solid #eef1f5; border-radius: 6px; }
.hm-rc-tablewrap .hm-table th { position: sticky; top: 0; z-index: 1; }
.hm-rc-via { margin-left: 6px; font-size: .74rem; background: #e8eef6; color: #46617f; border-radius: 3px; padding: 0 5px; }
.hm-rc-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hm-rc-cnt { color: #98a3b0; margin-left: 4px; }
.hm-rc-unread { color: #b32121; }
.hm-rc-na { color: #98a3b0; cursor: help; }
.hm-rc-recalled { color: #8a6d00; }

/* 모달 위에 뜨는 확인 창 (수신 현황 → 발송 취소 확인) */
.hm-modal-backdrop.hm-modal-top { z-index: 910; }
.hm-modal.hm-modal-top { z-index: 911; }

.hm-rc-failcnt { color: #b32121 !important; }

/* 중간 폭(사이드바가 남아 목록이 좁은 창): 보낸 시각 열을 빼 제목 자리를 남긴다 */
@media (min-width: 821px) and (max-width: 1000px) {
    .hm-rc-row { grid-template-columns: 30px 140px 22px 1fr 120px 80px; }
    .hm-rc-date { display: none; }
}
/* 좁은 화면(메일함 모바일 배치와 같은 820px 이하): [체크][받는 사람][제목][상태] — 날짜·관리는 수신 현황 창에서 */
@media (max-width: 820px) {
    .hm-rc-row { grid-template-columns: 24px 84px 1fr 96px; padding: 0 8px; }
    .hm-rc-row .hm-row-clip, .hm-rc-date, .hm-rc-manage { display: none; }
    .hm-rc-pill { margin-left: 6px; }
}

.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-dropzone {
    position: relative;
    border: 1px dashed #c9d3de;
    border-radius: 6px;
    padding: 8px 10px;
    min-height: 44px;
    transition: border-color .15s, background .15s;
}
.hm-dropzone.hm-drop-active {
    border-color: #2c5aa0;
    background: #eef4fc;
}
.hm-drop-overlay {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #2c5aa0;
    background: rgba(238, 244, 252, .92);
    border-radius: 6px;
    pointer-events: none;   /* 오버레이가 드롭 대상 판정을 가로채지 않게 */
}
.hm-dropzone.hm-drop-active .hm-drop-overlay { display: flex; }

/* 에디터 서식 도구줄 */
.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: 120px;   /* 주소칸이 커져도 본문 칸이 사라지지 않게 — 넘치면 메일 쓰기 화면 전체가 스크롤된다 */
    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-mig-log {
    background: #222;
    color: #9fdb9f;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: .76rem;
    line-height: 1.5;
    max-height: 240px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 메일 가져오기 — 작업 상태 표시(현황 표·진행 로그 머리줄 공용) */
.hm-state {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
.hm-state-wait { background: #f1f3f5; color: #5c6670; border-color: #dde1e6; }
.hm-state-run  { background: #e7f0fd; color: #1d5fbf; border-color: #b9d2f7; }
.hm-state-ok   { background: #e6f6ea; color: #1e7d38; border-color: #b7e2c2; }
.hm-state-warn { background: #fff4e0; color: #9a5b00; border-color: #f3d59a; }
.hm-state-stop { background: #ececf4; color: #4a4a6a; border-color: #cfcfe2; }
.hm-state-fail { background: #fdeaea; color: #b3261e; border-color: #f2b8b5; }
details > summary .hm-state { margin: 0 6px; }
/* 지금 진행 로그를 보고 있는 작업의 행 */
.hm-table tr.hm-row-sel > td { background: #f3f7fd; }

/* 관리자 계정 목록 — 사용량 미니 바 */
.hm-usage-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 4px;
    max-width: 140px;
    overflow: hidden;
}
.hm-usage-fill { height: 100%; background: #2c5aa0; border-radius: 2px; }
.hm-usage-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; height: auto; 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-folders-scroll {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 4px;
        flex: none;
        min-width: 0;
        overflow: visible;
    }
    .hm-side-btns { padding: 0; height: auto; margin-bottom: 0; align-items: center; 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-list-title { min-height: 0; padding: 8px 10px 4px; }

    /* 행 압축: 크기 열 숨김 */
    .hm-row { grid-template-columns: 26px 22px 22px 100px 18px 1fr 78px; }
    .hm-d-full { display: none; }
    .hm-d-short { display: inline; }
    .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: 12px;
    padding: 44px 48px;
    width: min(460px, 92vw);
    box-sizing: border-box;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.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; }

/* ─── 시스템 관리 → 🚫 스팸 관리 (SpamAdminView) ─────────────────────────────
   색: 거부 = 파랑 #2a78d6, 스팸함 = 주황 #eb6834 (검증된 범주형 1·2번 — 흰 배경에서 색각 이상 구분·대비 통과),
   정상 = 회색. 표·타일·차트 모두 같은 색 = 같은 결과. 글자는 색을 입히지 않고 옆의 점·막대가 구분한다. */
.hm-sp, .hm-sp-modal { --sp-rej: #2a78d6; --sp-junk: #eb6834; --sp-clean: #b9b7af; --sp-temp: #4a3aa7;
         --sp-grid: #e1e0d9; --sp-axis: #c3c2b7; --sp-muted: #898781; }
.hm-sp-subnav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.hm-sp-subtab { border: 1px solid #c9d3de; background: #fff; border-radius: 16px; padding: 5px 12px; cursor: pointer; font-size: .88rem; }
.hm-sp-subtab:hover { background: #eef3f9; }
.hm-sp-subtab.active { background: #2c5aa0; border-color: #2c5aa0; color: #fff; font-weight: 700; }
.hm-sp-sync { margin: 4px 0 10px; }
.hm-sp-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; font-size: .88rem; }
.hm-sp-filters label { display: flex; align-items: center; gap: 6px; color: #555; }

.hm-sp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.hm-sp-tile { border: 1px solid #e3e8ef; border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; background: #fff; }
.hm-sp-tile-label { font-size: .82rem; color: #52514e; display: flex; align-items: center; gap: 6px; }
.hm-sp-tile-value { font-size: 1.6rem; font-weight: 600; color: #0b0b0b; }
.hm-sp-tile-value small { font-size: .95rem; color: #52514e; font-weight: 400; }
.hm-sp-tile-sub { font-size: .76rem; color: #898781; }

.hm-sp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.hm-sp-dot.reject { background: var(--sp-rej); }
.hm-sp-dot.junk { background: var(--sp-junk); }
.hm-sp-dot.clean { background: var(--sp-clean); }
.hm-sp-dot.tempfail { background: var(--sp-temp); }
.hm-sp-status { display: inline-flex; align-items: center; gap: 6px; }

.hm-sp-card { border: 1px solid #e3e8ef; border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; background: #fff; }
.hm-sp-card h4 { margin: 0 0 8px; font-size: .95rem; }
.hm-sp-card h4 small { color: #898781; font-weight: 400; margin-left: 6px; }
.hm-sp-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hm-sp-legend { display: flex; gap: 14px; font-size: .82rem; color: #52514e; }
.hm-sp-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.hm-sp-key { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.hm-sp-key.rej { background: var(--sp-rej); }
.hm-sp-key.junk { background: var(--sp-junk); }

/* 날짜별 누적 막대: 막대 폭 최대 24px, 둥근 윗모서리 4px, 조각 사이 2px 틈, 가는 가로 격자 */
.hm-sp-chart { display: flex; gap: 8px; margin-top: 6px; }
.hm-sp-yaxis { display: flex; flex-direction: column; justify-content: space-between; height: 170px; font-size: .72rem;
               color: var(--sp-muted); text-align: right; min-width: 28px; font-variant-numeric: tabular-nums; }
.hm-sp-yaxis span { line-height: 1; transform: translateY(-50%); }
.hm-sp-yaxis span:last-child { transform: translateY(50%); }
.hm-sp-plotwrap { flex: 1; min-width: 0; }
.hm-sp-plot { position: relative; height: 170px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--sp-axis); }
.hm-sp-gridlines { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.hm-sp-gridlines i { display: block; height: 1px; background: var(--sp-grid); }
.hm-sp-gridlines i:last-child { background: transparent; }
.hm-sp-col { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end;
             align-items: center; outline: none; cursor: default; }
.hm-sp-col:hover, .hm-sp-col:focus-visible { background: rgba(44, 90, 160, .06); }
.hm-sp-stack { width: 100%; max-width: 24px; display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.hm-sp-seg { flex: 1 1 0; min-height: 2px; }
.hm-sp-seg.rej { background: var(--sp-rej); }
.hm-sp-seg.junk { background: var(--sp-junk); }
.hm-sp-col:hover .hm-sp-seg, .hm-sp-col:focus-visible .hm-sp-seg { filter: brightness(1.12); }
.hm-sp-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 20;
             background: #fff; border: 1px solid rgba(11, 11, 11, .12); border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
             padding: 6px 10px; font-size: .8rem; white-space: nowrap; color: #52514e; }
.hm-sp-col:hover .hm-sp-tip, .hm-sp-col:focus-visible .hm-sp-tip { display: block; }
.hm-sp-col:first-child .hm-sp-tip, .hm-sp-col:nth-child(2) .hm-sp-tip { left: 0; transform: none; }
.hm-sp-col:last-child .hm-sp-tip, .hm-sp-col:nth-last-child(2) .hm-sp-tip { left: auto; right: 0; transform: none; }
.hm-sp-tip b { color: #0b0b0b; margin-right: 3px; }
.hm-sp-tip-day { font-weight: 600; color: #0b0b0b; margin-bottom: 2px; }
.hm-sp-tipkey { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 6px; }
.hm-sp-tipkey.rej { background: var(--sp-rej); }
.hm-sp-tipkey.junk { background: var(--sp-junk); }
.hm-sp-tipkey.clean { background: var(--sp-clean); }
.hm-sp-xaxis { display: flex; gap: 2px; margin-top: 4px; }
.hm-sp-xaxis span { flex: 1; text-align: center; font-size: .7rem; color: var(--sp-muted); white-space: nowrap; overflow: visible; min-width: 0; }
.hm-sp-tableview { margin-top: 10px; font-size: .85rem; }
.hm-sp-tableview summary { cursor: pointer; color: #2c5aa0; }
.hm-sp-tableview .hm-table { margin-top: 6px; max-width: 520px; }
.hm-table td.num, .hm-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.hm-sp-tops { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.hm-sp-toplist { margin: 0; padding-left: 20px; font-size: .86rem; }
.hm-sp-toplist li { padding: 3px 0; }
.hm-sp-toplist li > * { vertical-align: middle; }
.hm-sp-toplist li b { float: right; font-variant-numeric: tabular-nums; color: #0b0b0b; }
.hm-sp-linkbtn { background: none; border: none; padding: 0; color: #2c5aa0; cursor: pointer; font: inherit; text-align: left;
                 max-width: calc(100% - 50px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-sp-linkbtn:hover { text-decoration: underline; }

.hm-sp-events { table-layout: fixed; }
.hm-sp-events th:nth-child(1) { width: 92px; }
.hm-sp-events th:nth-child(2) { width: 84px; }
.hm-sp-events th:nth-child(3) { width: 52px; }
.hm-sp-ell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-sp-clickrow { cursor: pointer; }
.hm-sp-clickrow:hover td, .hm-sp-clickrow:focus td { background: #f4f8fd; }
.hm-table td.nowrap { white-space: nowrap; }

.hm-sp-addrule { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.hm-sp-addrule .hm-search { width: 240px; }
.hm-sp-addrule .hm-sp-note { width: 320px; }

.hm-sp-modal { width: min(820px, 95vw); max-height: 88vh; overflow-y: auto; }
.hm-sp-modal h4 { margin: 10px 0 4px; font-size: .92rem; }
.hm-sp-modal h4 small { color: #898781; font-weight: 400; }
.hm-sp-kv { border-collapse: collapse; font-size: .86rem; width: 100%; table-layout: fixed; }
.hm-sp-kv th { text-align: left; color: #52514e; font-weight: 600; width: 110px; padding: 3px 8px 3px 0; vertical-align: top; }
.hm-sp-kv td { padding: 3px 0; word-break: break-all; }
.hm-sp-rules { max-height: 280px; overflow-y: auto; border: 1px solid #eef1f5; border-radius: 6px; }
.hm-sp-rules code { font-size: .8rem; }
.hm-sp-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 칸 6개 — 한 줄 6칸 또는 3칸×2줄로 (5+1 처럼 한 칸만 남지 않게) */
@media (min-width: 1280px) { .hm-sp-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 820px) {
    .hm-sp-tile-value { font-size: 1.3rem; }
    .hm-sp-ell { max-width: 140px; }
    .hm-sp-addrule .hm-search, .hm-sp-addrule .hm-sp-note { width: 100%; }
}
@media (max-width: 480px) {
    .hm-sp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .hm-sp-tile { padding: 8px 10px; }
    .hm-sp-tile-value { font-size: 1.15rem; }
    .hm-sp-subtab { padding: 4px 10px; font-size: .84rem; }
    .hm-sp-xaxis span.minor { visibility: hidden; }   /* 좁은 화면: 날짜 글자가 겹치지 않게 한 칸 걸러 */
}
