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;
    height: 100dvh;   /* 휴대폰: 주소창·툴바가 보이는 실제 높이 (지원 안 하면 윗줄) */
}

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

/* 빠른 필터 (안 읽음/중요/첨부/메모 — 메모는 2026-10-17) */
.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-q-memo .hm-quick-ico { color: #8a6d00; }     /* 메모(2026-10-17): 목록 메모 띠와 같은 호박색(그림 글자로 보이는 기기에서) */
.hm-quick-badge { margin-left: auto; }           /* 안읽음 개수는 오른쪽 끝에 */

/* 안 읽은 메일만 보기(2026-10-20): '안 읽음' 줄 오른쪽 끝(개수 배지 오른쪽)의 체크 상자.
   누르는 자리는 체크 상자보다 넓게(30px — 터치 화면 40px, 아래 pointer: coarse) 잡되 음수 여백으로 줄 높이는 다른 빠른 필터 줄과 같게 */
.hm-uo-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    margin: -6px -8px -6px auto;
    border-radius: 6px;
    cursor: pointer;
}
.hm-quick-badge + .hm-uo-toggle { margin-left: -2px; }  /* 배지가 오른쪽 끝으로 밀어 두었다 — 그 바로 오른쪽 */
.hm-uo-toggle > input { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: #2c5aa0; }
.hm-uo-toggle:hover { background: #d3e0f0; }
.hm-uo-toggle > input:focus-visible { outline: 2px solid #2c5aa0; outline-offset: 2px; }
/* 켜짐: 줄 전체를 진한 파랑·흰 굵은 글자 — 안 읽은 메일만 보는 중임을 늘 알게(빠른 필터를 고른 표시 — 연한 파랑·파란 글자 — 와 다르다).
   개수 배지는 흰 바탕·파란 글자, 체크 상자는 흰 칸에 파란 체크(대비 6.8:1)를 직접 그린다 — 브라우저에 맡기면(accent-color #fff) 크로뮴은 짙은 체크를
   그리지만 아이폰 Safari(WebKit — 아이폰의 모든 브라우저·메신저 앱도)는 체크를 늘 흰색으로, 테두리 없이 그려 빈 흰 칸(꺼진 체크 상자)처럼 보였다 */
.hm-quick li.hm-uo-on { background: #2c5aa0; color: #fff; font-weight: 700; }
.hm-quick li.hm-uo-on:hover { background: #244b86; }
.hm-quick li.hm-uo-on .hm-quick-ico { color: #fff; }
.hm-quick li.hm-uo-on .hm-quick-badge { background: #fff; color: #2c5aa0; font-weight: 700; }
.hm-quick li.hm-uo-on .hm-uo-toggle > input {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    border-radius: 3px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%232c5aa0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}
.hm-quick li.hm-uo-on .hm-uo-toggle:hover { background: rgba(255, 255, 255, .2); }
.hm-quick li.hm-uo-on .hm-uo-toggle > input:focus-visible { outline-color: #fff; }
/* 켜짐 + 빠른 필터 '안 읽음'을 고른 채: 켜짐 모양이 앞서고, 고른 표시는 가장자리에서 4px 안쪽의 흰 테두리(2px)로 —
   바깥에 파란 띠를 두어야 사이드바의 밝은 바탕과 섞이지 않고 테두리로 보인다(마우스를 올리면 띠도 진한 파랑) */
.hm-quick li.hm-uo-on.active { box-shadow: inset 0 0 0 4px #2c5aa0, inset 0 0 0 6px #fff; }
.hm-quick li.hm-uo-on.active:hover { box-shadow: inset 0 0 0 4px #244b86, inset 0 0 0 6px #fff; }
/* 안 읽은 메일만 보기에서 내 메일함이 모두 숨었을 때의 한 줄 */
.hm-side-none { padding: 4px 16px 8px; font-size: .8rem; color: #6b7684; word-break: keep-all; }   /* 낱말 가운데서 끊지 않게('없/습니다') */
/* 안 읽은 메일만 보기: 스팸함·휴지통의 안 읽은 수(회색 수는 전체 메일 수) — [비우기] 바로 왼쪽(이름 칸이 먼저 줄어든다) */
.hm-util-unread { flex-shrink: 0; margin: 0 6px 0 auto; font-weight: 400; }

/* 목록 제목줄의 [안 읽은 메일만 ✕] (2026-10-20) — 사이드바의 켜진 '안 읽음' 줄과 같은 파랑. 누르면 끈다 */
.hm-uo-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    padding: 2px 5px 2px 10px;
    border: 0;
    border-radius: 12px;
    background: #2c5aa0;
    color: #fff;
    font-family: inherit;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.4;
    vertical-align: 1px;
    white-space: nowrap;
    cursor: pointer;
}
.hm-uo-chip:hover { background: #244b86; }
.hm-uo-chip:focus-visible { outline: 2px solid #2c5aa0; outline-offset: 2px; }
.hm-uo-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .22);
    font-size: .68rem;
    line-height: 1;
}

/* 사이드바 섹션 제목 (내 메일함) */
.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; }
/* 제목 칸은 글 길이로 폭을 셈하지 않는다(contain) — flex 줄은 칸의 글 길이만큼 목록(.hm-mail 의 1fr 칸)을 넓혀,
   긴 제목 하나로 PC 화면 전체가 옆으로 밀렸다(2026-10-16). 이제 남은 폭만 쓰고 넘치면 줄임표 */
.hm-trow .hm-row-subject { flex: 1; min-width: 0; contain: inline-size; }
.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;
}

/* ── 메일 메모 (2026-10-16 — 나만 보는 한 줄 메모. 목록 Mailbox·읽기 화면 MailMemoField) ──
   목록: 제목 뒤 노란 띠 '📝 메모'. 메모가 있는 줄만 제목 칸이 flex(hm-has-memo) — 제목이 줄어들며 줄임표, 띠는 칸의 40% 까지(짧은 메모는 다 보이고 긴 메모만 줄임표 —
   전체는 풍선 도움말). 제목 칸 안에서만 나누므로 날짜·크기 칸은 그대로, 좁은 휴대폰에서도 옆으로 밀리지 않는다 */
.hm-row-subject.hm-has-memo { display: flex; align-items: center; min-width: 0; }
.hm-row-subject.hm-has-memo > .hm-msg-folder { margin-left: 0; }      /* flex 안에서 auto 여백이 제목을 오른쪽 끝으로 밀지 않게 */
.hm-row-subject.hm-has-memo > .hm-subj { flex: 0 1 auto; min-width: 2.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 대화 보기 줄의 제목 칸은 메모가 있든 없든 글 길이로 폭을 셈하지 않는다 — 위 '.hm-trow .hm-row-subject' */
.hm-mmemo-badge {
    display: inline-block;
    flex: none;                /* 줄지 않고 칸의 40% 까지 — 짧은 메모는 늘 다 보이고, 긴 메모만 줄임표(제목이 먼저 줄어든다) */
    max-width: 40%;
    margin-left: 6px;
    padding: 0 6px;
    border: 1px solid #ecd27a;
    border-radius: 4px;
    background: #fff4c2;
    color: #4a3800;
    font-size: .74rem;
    font-weight: 500;          /* 안 읽은 줄(굵은 제목)에서도 띠는 보통 굵기 */
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: 1px;
}

/* 읽기 화면: 메모가 없으면 제목 줄 끝의 [📝 메모], 있으면 제목 아래 줄(hm-mmemo-line)의 메모 띠 — 누르면 그 자리에서 한 줄 입력.
   제목(h2)은 남은 폭을 채워 [📝 메모]가 늘 제목 줄 오른쪽 끝에 붙는다. 메모 줄은 제목 글자 아래에 맞춘다(별표 폭만큼 들여 씀) */
.hm-view-subject { flex-wrap: wrap; }
.hm-view-subject > h2 { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.hm-mmemo-add {
    flex: none;
    align-self: center;
    border: 1px dashed #d9c47a;
    border-radius: 12px;
    background: #fffdf3;
    color: #7a5d00;
    padding: 1px 9px;
    font-family: inherit;
    font-size: .78rem;
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
}
.hm-mmemo-add:hover:not(:disabled), .hm-mmemo-add:focus-visible { background: #fff4c2; border-style: solid; }
.hm-mmemo-add:disabled { opacity: .5; cursor: default; }
.hm-mmemo-line { flex: 0 0 100%; min-width: 0; padding-left: calc(1.1rem + 8px); box-sizing: border-box; }
.hm-mmemo-view {
    max-width: 100%;
    margin-left: 0;
    padding: 3px 9px;
    font-family: inherit;
    font-size: .86rem;
    line-height: 1.45;
    white-space: normal;
    word-break: keep-all;      /* 한글은 낱말(띄어쓰기) 단위로 줄을 바꾼다 — 긴 낱말만 아무 데서나 */
    overflow-wrap: anywhere;
    text-align: left;
    cursor: pointer;
}
.hm-mmemo-view:hover, .hm-mmemo-view:focus-visible { background: #ffeca0; border-color: #d9b94a; }
.hm-mmemo-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hm-mmemo-input { flex: 1 1 260px; width: auto; max-width: 560px; min-width: 0; }
.hm-mmemo-input:focus { outline: none; border-color: #c9a227; box-shadow: 0 0 0 2px rgba(201, 162, 39, .22); }
.hm-mmemo-bar { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hm-hint.hm-mmemo-count { font-size: .76rem; font-variant-numeric: tabular-nums; }   /* .hm-hint(아래쪽, 같은 무게)보다 앞서게 */
.hm-mmemo-err { flex: 0 0 100%; color: #b3261e; font-size: .82rem; }
.hm-search-cond.hm-mmemo-capnote, .hm-msearch-cond .hm-mmemo-capnote { color: #8a6d00; }   /* 검색 조건 글자(회색)보다 앞서게 — PC 머리·휴대폰 검색줄 아래 */
/* 빠른 필터 '메모'의 상한 안내 — 휴대폰 목록 위 한 줄(PC 는 제목줄의 '· 메모는 최근 N개만', hm-m-only) */
.hm-memo-capline { padding: 6px 12px; border-bottom: 1px solid #f1e3b0; background: #fffbea; color: #8a6d00; font-size: .8rem; line-height: 1.4; word-break: keep-all; }
/* 인쇄에는 메모를 넣지 않는다(나만 보는 메모 — 인쇄물은 남에게 건네기 쉽다) */
@media print {
    .hm-mmemo-add, .hm-mmemo-line { display: none !important; }
}

.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-searchopts-hint { color: #8a96a5; font-size: .78rem; }
.hm-search-dates { display: flex; align-items: center; gap: 4px; }
.hm-search-dates input { padding: 2px 4px; }

/* 목록 제목 줄의 검색 바: [대상▾][검색어][메일함▾][검색][▾] */
.hm-searchbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hm-search-sel {
    border: 1px solid #c9d3de;
    border-radius: 4px;
    padding: 3px 4px;
    font-size: .85rem;
    background: #fff;
    max-width: 110px;
}
.hm-search-scope { max-width: 150px; }
.hm-search-cond { margin-left: 4px; color: #5b6b7d; font-size: .82rem; }

.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-move-menu-cap {
    width: 220px;               /* 메뉴 폭은 단추 폭을 따라 좁아지므로 안내 줄 폭을 정해 둔다 — 낱말 단위로 줄바꿈, 긴 주소만 아무 데서나 */
    padding: 5px 14px 6px;
    margin-bottom: 2px;
    border-bottom: 1px solid #eef1f5;
    font-size: .76rem;
    line-height: 1.35;
    color: #7a8594;
    word-break: keep-all;
    overflow-wrap: anywhere;
    cursor: default;
    flex-shrink: 0;
}
/* flex-shrink: 메일함이 많아 메뉴(최대 280px)가 스크롤될 때 1px 선이 눌려 0 이 되어 사라지지 않게 */
.hm-move-menu-sep { height: 1px; flex-shrink: 0; margin: 3px 0; background: #eef1f5; }
/* 자동 분류 단추: 넓은 PC 는 '자동 분류 ▾'. 단추가 하나 늘어 좁은 PC 에서 도구줄 글자가 예전보다 더 접히지 않게 —
   1080px 이하는 '📂▾' 만(이름은 풍선 도움말·aria-label), 960px 이하는 도구줄 단추 좌우 여백을 10 → 7px.
   (휴대폰 배치에서는 도구줄이 숨는다. 821~1280px 에서 글자 줄 수가 예전보다 늘지 않음을 확인) */
.hm-af-btn .hm-af-ico { display: none; }
/* 다시 보내기(보낸편지함 메일 읽기 — 그곳에서는 [자동 분류]가 숨고 이 단추가 그 자리를 쓴다): 같은 규칙으로 1080px 이하는 '📨' 만 */
.hm-rs-btn .hm-rs-ico { display: none; }
@media (max-width: 1080px) {
    .hm-af-btn .hm-af-ico { display: inline; }
    .hm-af-btn .hm-af-text { display: none; }
    .hm-view-actions .hm-af-btn { padding-left: 6px; padding-right: 6px; }
    /* 단추가 오른쪽으로 밀려 있으니 메뉴는 단추 오른쪽 끝에 맞춰 왼쪽으로 펼친다(화면 밖으로 나가지 않게) */
    .hm-af-btn + .hm-move-menu { left: auto; right: 0; }
    .hm-rs-btn .hm-rs-ico { display: inline; }
    .hm-rs-btn .hm-rs-text { display: none; }
    .hm-view-actions .hm-rs-btn { padding-left: 6px; padding-right: 6px; }
}
@media (max-width: 960px) {
    .hm-view-actions .hm-btn { padding-left: 7px; padding-right: 7px; }
    .hm-view-actions .hm-af-btn, .hm-view-actions .hm-rs-btn { padding-left: 6px; padding-right: 6px; }
}
/* PC에 저장(2026-10-09, 메일 읽기 도구줄 오른쪽 끝 🖨 옆 — 원본 .eml 내려받기): 진짜 링크(<a download>)라 단추와 같은 모양으로
   (단추 글자색·밑줄 없음·글자 가운데 — 이웃 단추가 두 줄로 접혀 키가 커져도).
   단추가 하나 늘어도 도구줄 글자가 예전보다 더 접히지 않게(821~1400px 확인 — 휴지통의 [영구 삭제]는 글자가 길어 900~980px 등에서 한 줄 더):
   1150px 이하는 '💾' 만(이름은 풍선 도움말·aria-label), 1080px 이하는 도구줄 단추 사이 6 → 4px·💾/🖨 좌우 여백 4px,
   960px 이하는 ‹ › 좌우 여백 7 → 5px */
a.hm-btn.hm-eml-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: ButtonText;
    text-decoration: none;
    white-space: nowrap;
}
.hm-eml-btn .hm-eml-ico { display: none; }
@media (max-width: 1150px) {
    .hm-eml-btn .hm-eml-ico { display: inline; }
    .hm-eml-btn .hm-eml-text { display: none; }
    .hm-view-actions .hm-eml-btn { padding-left: 6px; padding-right: 6px; }
}
@media (max-width: 1080px) {
    .hm-view-head > .hm-view-actions { gap: 4px; }     /* 기본 규칙(.hm-view-actions, 아래쪽)보다 앞에 있어 한 단계 더 좁혀 쓴다 */
    .hm-view-actions .hm-eml-btn, .hm-view-actions .hm-print-btn { padding-left: 4px; padding-right: 4px; }
}
@media (max-width: 960px) {
    .hm-view-actions .hm-vstep-btn { padding-left: 5px; padding-right: 5px; }
}
/* 목록 도구줄의 다시 보내기(보낸편지함 목록 — 늘 보이는 단추가 하나 는다): 1250px 이하 PC 는 '📨' 만.
   글자 단추면 1141~1244px 에서 예전엔 한 줄이던 도구줄이 두 줄로 접혀(🔄 만 둘째 줄) 목록이 36px 내려갔다.
   '📨' 만으로도 1141~1180px 은 모자라 그 폭에서는 보낸편지함 도구줄(.hm-toolbar-rs)의 단추 좌우 여백을 10 → 7px
   (메일 읽기 도구줄의 960px 이하와 같은 값 — 예전엔 두 줄이던 1140px 이하도 조금 넉넉히 덮는다). 다른 메일함은 그대로 */
@media (max-width: 1250px) {
    .hm-toolbar .hm-rs-btn .hm-rs-ico { display: inline; }
    .hm-toolbar .hm-rs-btn .hm-rs-text { display: none; }
    .hm-toolbar .hm-rs-btn { padding-left: 6px; padding-right: 6px; }
}
@media (min-width: 1101px) and (max-width: 1200px) {
    .hm-toolbar-rs > .hm-btn:not(.hm-rs-btn) { padding-left: 7px; padding-right: 7px; }
}

/* 휴지통 영구 삭제 확인(2026-10-09, Mailbox) — 낱말 단위 줄바꿈('되살릴/수' 처럼 갈리지 않게) */
.hm-trash-modal { word-break: keep-all; }

/* 확인 모달 (스팸 등록 등) */
.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-autofilter-modal { word-break: keep-all; overflow-wrap: anywhere; }
.hm-autofilter-modal .hm-af-note {
    padding: 6px 10px;
    border-radius: 4px;
    background: #eef4fb;
    color: #2c4a72;
    font-size: .85rem;
}
.hm-autofilter-modal .hm-af-change { background: #fff6e0; color: #7a5300; }
/* 수신 거부·위 순위 규칙이 먼저 가져가 규칙이 듣지 않는다는 경고 */
.hm-autofilter-modal .hm-af-warn { background: #fdecec; color: #8f1d1d; }
.hm-autofilter-modal .hm-check { align-items: flex-start; }
.hm-autofilter-modal .hm-check input { flex-shrink: 0; margin-top: 3px; }
/* 창 안의 오류, PC 에서 읽기 화면이 남을 때의 등록 결과 */
.hm-autofilter-modal > .hm-error, .hm-autofilter-modal > .hm-notice { margin: 0; }
/* 열릴 때 초점을 창으로 옮긴다(키보드) — 창 전체에 초점 테두리는 그리지 않는다 */
.hm-autofilter-modal:focus { outline: none; }

/* 스팸 등록 확인(읽기 화면 한 통·목록 여러 통 — 2026-10-13 '내 수신 거부 목록에 추가 (나에게만 적용)'이 기본으로 켜짐, Mailbox):
   글이 길어져 두 줄로 접히는 체크 항목은 상자를 첫 줄에 맞추고, 낱말 단위 줄바꿈(긴 주소만 아무 데서나) */
.hm-spam-modal { word-break: keep-all; overflow-wrap: anywhere; }
.hm-spam-modal .hm-check { align-items: flex-start; }
.hm-spam-modal .hm-check input { flex-shrink: 0; margin-top: 3px; }
/* 스팸 등록 창의 키 안내(PC, 2026-10-28 — 단축키 '!') */
.hm-spam-keys { margin: 4px 0 0; font-size: .8rem; }
.hm-spam-keys kbd {
    display: inline-block; padding: 0 5px; border: 1px solid #c9d3de; border-bottom-width: 2px; border-radius: 4px;
    background: #f6f8fb; color: #2b3542; font: inherit; font-size: .76rem; line-height: 1.5; box-shadow: none;
}
.hm-spam-modal .hm-spam-me { white-space: nowrap; }     /* '(나에게만 적용)'이 두 줄로 갈리지 않게 */
/* 목록 여러 통: 넣을 주소(3개까지 + '외 N명') — 체크 상자 글 아래에 들여 붙인다 */
.hm-spambulk-modal .hm-spam-addrs { margin-top: -4px; padding-left: 19px; color: #555; }

/* 첨부 미리보기 */
.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; }

/* 메일 쓰기 — 보내는 사람 선택. 2026-10-09 "이름 <주소>" 로 보이면서 320 → 440px (긴 메일링 주소도 끝까지) */
.hm-from-select { max-width: 440px; }

/* 메일 쓰기 — 옵션 행 / 미리보기 모달 */
.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; }
/* 설정 → 스팸 관리: 형식이 맞지 않아 적용되지 않는 수신 허용·거부 항목(2026-10-09) — 위 안내 줄과 각 항목 아래 */
.hm-spam-warn { margin: 0; font-size: .85rem; }
.hm-spam-bad { margin-top: 2px; font-size: .78rem; font-weight: 400; }
/* 설정 → 부재중 자동응답: 기간 줄(시작일 ~ 종료일 [기간 지우기])과 상태 안내(2026-10-09) */
.hm-vac-period { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .9rem; }
.hm-vac-label { margin-right: 2px; }
.hm-vac-dates { display: flex; align-items: center; gap: 6px; }
.hm-vac-state { margin: 0; font-size: .85rem; }

/* 이전 로그인 정보 토스트 (로그인 직후 우측 하단 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;
}
/* 관리자 → 신청: 승인할 수 없는 신청(이미 쓰는 주소·아이디 형식 — 2026-10-09)의 까닭 — 희망 계정 아래 작은 붉은 글자.
   긴 주소가 칸을 한없이 넓히지 않게 폭을 정하고 주소 중간에서도 줄을 바꾼다(휴대폰은 표가 hm-table-scroll 안에서 옆으로) */
.hm-req-warn { margin-top: 2px; max-width: 260px; font-size: .78rem; line-height: 1.35; overflow-wrap: anywhere; }

/* 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; }

/* 시스템 관리 → 보안 관리 → 4. 도메인별 발송 금지 */
.hm-sl-rules { padding-left: 18px; line-height: 1.6; }
.hm-sl-mark { color: #888; font-size: .82rem; }
/* 도메인 체크 — 이름은 한 줄, 표시(별칭·사용 안 함·등록되지 않은 도메인)는 자리가 모자라면(휴대폰) 다음 줄로 넘기고 그 안에서도 줄을 바꾼다 */
.hm-copts .hm-sl-domain { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.hm-sl-name { white-space: nowrap; }
.hm-copts .hm-sl-mark { white-space: normal; min-width: 0; }
.hm-sl-warn { margin: 0; font-size: .82rem; color: #8a3b12; }
.hm-settings-sec .hm-sl-summary { margin: 0; line-height: 1.6; }
.hm-sl-summary.off { background: #f4f6f8; border-color: #d6dbe0; color: #555; }
.hm-sl-summary.on { background: #fff4e5; border-color: #f0c48a; color: #8a4b00; }
.hm-sl-summary ul { margin: 4px 0 0; padding-left: 18px; }
.hm-sl-dirty { margin-top: 6px; font-weight: 600; color: #b42318; }

/* 주소 그룹(보내는 사람·받는 사람·참조·숨은 참조) — 연한 파란 패널 + 왼쪽 강조선으로 다른 항목과 구분 */
.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; }

/* 제목 줄 강조(2026-10-13) — 제목을 빠뜨리거나 잘못 쓰지 않게 눈에 띄게: 칸 이름은 파란 바탕에 흰 글씨(입력 칸에 붙은 머리표),
   입력 칸은 연한 파란 바탕·테두리 상자에 굵은 글씨. 주소 패널(연한 바탕 + 왼쪽 선)과 다른 모양이라 구분된다.
   입력 중에는 흰 바탕 + 파란 테두리·둘레 빛. 다른 줄(옵션·파일 첨부)은 그대로 */
.hm-cfield.hm-cfield-subject {
    margin: 4px 0 8px;
    border: 1px solid #b9cde6;
    border-radius: 8px;
    background: #f4f8fd;
    overflow: hidden;
}
.hm-cfield.hm-cfield-subject:focus-within {
    border-color: #2c5aa0;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, .18);
}
.hm-cfield-subject > label {
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 8px 0 13px;
    background: #2c5aa0;
    color: #fff;
    font-weight: 700;
    cursor: text;
}
.hm-cfield.hm-cfield-subject > input {
    padding-left: 13px;
    color: #1d2430;
    font-size: .98rem;
    font-weight: 600;
}
.hm-cfield-subject > input::placeholder { color: #7f9cc0; font-weight: 400; }

/* 주소 입력칸 + [주소록] 버튼 */
.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; }

/* 메일 쓰기 — 본문 그림 다듬기·표 붙여넣기 (editor-media.js). 편집기 밖(body)에 position:fixed 로 띄운다 */
.hm-editor img { cursor: pointer; }
.hm-imgsel {
    position: fixed;
    z-index: 960;
    display: none;
    box-sizing: border-box;
    border: 2px solid #2c5aa0;
    pointer-events: none;
}
.hm-imgsel-handle {
    position: absolute;
    right: -8px;
    bottom: -8px;
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    background: #fff;
    border: 2px solid #2c5aa0;
    border-radius: 3px;
    pointer-events: auto;
    cursor: nwse-resize;
    touch-action: none;
}
.hm-imgbar, .hm-pastebar {
    position: fixed;
    z-index: 961;
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    box-sizing: border-box;
    max-width: min(760px, calc(100vw - 16px));
    padding: 4px 6px;
    background: #fff;
    border: 1px solid #c9d6e8;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
    font-size: .8rem;
}
.hm-imgbar button, .hm-pastebar button {
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    padding: 3px 7px;
    color: #223;
    font: inherit;
    white-space: nowrap;
    cursor: pointer;
}
.hm-imgbar button:hover, .hm-pastebar button:hover { background: #eef4fc; }
.hm-imgbar button.on, .hm-pastebar button.on { background: #2c5aa0; border-color: #2c5aa0; color: #fff; }
.hm-imgbar .lbl, .hm-pastebar .lbl { padding: 0 4px; color: #5b6b7d; }
.hm-imgbar .sep { width: 1px; height: 18px; margin: 0 4px; background: #dbe3ec; }
.hm-imgbar input { width: 60px; padding: 2px 4px; border: 1px solid #c9d6e8; border-radius: 4px; font: inherit; }
.hm-imgbar .hm-imgbar-del { color: #b3261e; }
.hm-imgbar .hint { padding: 0 4px; color: #8a96a5; font-size: .74rem; }
.hm-pastebar .msg { padding: 0 4px; color: #b3261e; }
.hm-pastebar .msg:empty { display: none; }
@media (max-width: 600px) {
    .hm-imgbar .hint, .hm-imgbar .lbl { display: none; }
}

/* 설정 > 자동 분류(예전 이름 메일 필터) — 순위·▲▼, '여기서 끝'(폴더로 이동·삭제는 아래 규칙을 보지 않는다) */
.hm-filter-table td.num, .hm-filter-table th.num { width: 44px; text-align: center; }
.hm-filter-table .hm-btn-sm + .hm-btn-sm { margin-left: 4px; }
/* 휴대폰: 표 대신 규칙 한 장씩 — 왼쪽 순위, 가운데 조건·동작, 오른쪽 ▲▼·삭제 (가로로 넘쳐 ▲▼ 가 안 보이지 않게) */
@media (max-width: 600px) {
    .hm-table.hm-filter-table { display: block; overflow: visible; }
    .hm-filter-table thead { display: none; }
    .hm-filter-table tbody { display: block; }
    .hm-filter-table tr {
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr) auto;
        grid-template-areas: "rank cond order" "rank act del";
        gap: 4px 8px;
        align-items: center;
        padding: 8px 2px;
        border-bottom: 1px solid #eef1f5;
    }
    .hm-table.hm-filter-table td { display: block; padding: 0; border: none; overflow-wrap: anywhere; }
    .hm-filter-table td.hm-f-rank { grid-area: rank; width: auto; align-self: start; padding-top: 2px; }
    .hm-filter-table td.hm-f-cond { grid-area: cond; }
    .hm-filter-table td.hm-f-act { grid-area: act; color: #555; font-size: .88rem; }
    .hm-filter-table td.hm-f-order { grid-area: order; justify-self: end; }
    .hm-filter-table td.hm-f-del { grid-area: del; justify-self: end; }
}
/* 없는 메일함을 가리키는 자동 분류 규칙 — 경고 글자와 그 자리의 메일함 다시 고르기 */
.hm-filter-missing { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.hm-filter-missing > span { color: #b4232c; font-size: .82rem; font-weight: 600; }
/* 줄어들 수 있게 — 메일함 목록 전체가 든 select 라 그대로 두면 가장 긴 메일함 이름이 '동작' 칸의 최소 폭이 되어 표가 넓어지고
   ▲▼·[삭제]가 화면 밖으로 밀리거나(PC) '조건' 칸이 찌그러졌다(601~820px). 표가 auto 배치라 max-width: 100% 만으로는 듣지 않는다 */
.hm-filter-missing .hm-move-select { width: 100%; max-width: 22em; min-width: 0; }
/* .hm-hint(아래쪽에 선언, 같은 우선순위)의 회색에 덮이지 않게 */
.hm-hint.hm-filter-missing-hint { color: #8a3b12; }
.hm-filter-stop {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border: 1px solid #d5dbe3;
    border-radius: 9px;
    color: #5b6b7d;
    font-size: .74rem;
    line-height: 1.5;
    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), (max-height: 500px) and (pointer: coarse) {
    .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; }

/* 관리자 도구 → 👥 접속 현황 (PresenceView, 2026-10-12) — 상태 칩은 위 .hm-state 그대로(활동 중 ok · 자리 비움 wait · 연결 끊김 warn) */
.hm-pr-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    margin: 0 0 12px;
    font-size: .92rem;
    color: #444;
}
.hm-pr-summary .hm-pr-sum-main { font-size: 1.02rem; font-weight: 600; color: #1d2430; }
.hm-pr-summary .hm-pr-sum-main b { font-size: 1.35rem; color: #2c5aa0; }
/* '로그인 유지(화면 닫힘)'은 늘 다음 줄에 — 같은 줄 끝에 세로 막대로 붙였더니 요약이 두 줄로 접히는 폭에서 막대가 둘째 줄 앞에 홀로 남았다 */
.hm-pr-summary .hm-pr-sum-closed { flex-basis: 100%; color: #666; }
.hm-pr-summary .hm-pr-sum-ended { flex-basis: 100%; color: #b3261e; }
/* 표가 내용 칸보다 넓어지면(창이 좁은 PC·가로 태블릿) 이 상자 안에서만 옆으로 — 모든 폭. 600px 이하 카드는 넘치지 않는다 */
.hm-pr-scroll { overflow-x: auto; }
/* 줄바꿈: 한글은 낱말 단위로만(단추 '로그아웃시키기'·'휴대폰'이 글자마다 깨지지 않게), 줄바꿈 금지는 짧은 시각 칸에만 —
   머리줄·기기·단추 칸까지 막았더니 표가 813px 아래로 줄지 않아 좁은 창에서 상태·[로그아웃시키기]가 밖으로 나갔다 */
.hm-pr-table { word-break: keep-all; }
.hm-pr-table td { vertical-align: middle; }
.hm-pr-table td.hm-pr-nw { white-space: nowrap; }
.hm-pr-table td.hm-pr-act { text-align: right; }
@media (min-width: 601px) {
    /* 표일 때(카드 아님): IP·기기 이름이 글자 단위로 깨지지 않게(820px 이하의 카드 표 공통 규칙 overflow-wrap:anywhere 를 되돌림) —
       주소만 아무 데서나 줄을 바꾼다(.hm-pr-name·.hm-pr-addr). 그래도 넓으면 표가 위 상자 안에서 옆으로 */
    .hm-table.hm-cards.hm-pr-table td { overflow-wrap: normal; }
}
@media (max-width: 1100px) {
    /* 좁은 창: 칸 좌우 여백을 줄여 1000px 창(내용 칸 726px)·가로 태블릿에서도 표가 옆으로 밀리지 않게 */
    .hm-table.hm-pr-table th, .hm-table.hm-pr-table td { padding-left: 6px; padding-right: 6px; }
}
.hm-pr-name { font-weight: 600; overflow-wrap: anywhere; }
.hm-pr-addr { font-size: .8rem; font-weight: 400; color: #6b7684; overflow-wrap: anywhere; }
/* 둘째 줄(기기의 브라우저, 접속 위치의 국가) — 휴대폰 카드에서는 같은 줄에 ' · ' 로 */
.hm-pr-sub { display: block; font-size: .8rem; color: #6b7684; }
.hm-pr-role {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border: 1px solid #cfdcef;
    border-radius: 8px;
    background: #eef3fa;
    color: #2c5aa0;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.5;
    vertical-align: 1px;
    white-space: nowrap;
}
.hm-pr-role.hm-pr-role-me { border-color: #b7e2c2; background: #e6f6ea; color: #1e7d38; }
.hm-pr-notes { display: flex; flex-direction: column; gap: 3px; margin: 10px 0 18px; }
.hm-pr-closed > details { align-self: stretch; }
.hm-pr-closed summary { cursor: pointer; font-size: .98rem; font-weight: 600; }
.hm-pr-closed summary .hm-count { font-weight: 400; margin-left: 4px; }
.hm-pr-closed details > :not(summary) { margin-top: 10px; }
@media (max-width: 600px) {
    /* 카드: [로그아웃시키기]·안내는 카드 맨 아래 오른쪽 */
    .hm-table.hm-cards > tbody > tr > td.hm-pr-act { display: flex; justify-content: flex-end; padding-top: 4px; }
    .hm-table.hm-cards.hm-pr-table > tbody > tr > td.hm-pr-nw { white-space: normal; }
    .hm-table.hm-cards.hm-pr-table .hm-pr-sub { display: inline; font-size: inherit; color: inherit; }
    .hm-table.hm-cards.hm-pr-table .hm-pr-sub::before { content: " · "; }
}
/* 자동 로그아웃까지 남은 시간(자리 비움·연결 끊김·화면 닫힘 줄의 '마지막 활동' 칸 아래 줄, 주황 — 휴대폰 카드에서도).
   넓은 창은 한 줄. 1180px 이하의 창에서는 칸 너비에 맞춰 접히고 칸을 넓히지 않는다(anywhere — 낱말 사이에서 먼저, 모자라면 낱말 안에서) —
   한 줄로 칸을 넓혔더니 1000~1100px 창에서 표가 옆으로 밀려 [로그아웃시키기]가 잘렸다 */
.hm-pr-idle { color: #9a5b00; }
@media (max-width: 1180px) {
    .hm-pr-table td.hm-pr-nw .hm-pr-idle { white-space: normal; overflow-wrap: anywhere; }
}
.hm-table.hm-cards.hm-pr-table .hm-pr-sub.hm-pr-idle { color: #9a5b00; }

/* 자동 로그아웃 예고 (2026-10-14 — js/presence.js 가 그린다, 로그아웃 2분 전). 뒤 화면을 막지 않는 작은 창 — 아무 곳이나 누르면
   그 누름이 그대로 쓰이면서 창도 닫힌다. PC 는 화면 가운데, 휴대폰은 아래쪽(엄지가 닿는 곳 — 홈 바·노치는 피한다) */
.hm-idlewarn {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4100;
    box-sizing: border-box;
    width: min(400px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid #f3d59a;
    border-top: 4px solid #e8a33d;
    border-radius: 10px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, .28);
    padding: 16px 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .9rem;
    color: #1d2430;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.hm-idlewarn[hidden] { display: none; }
.hm-iw-head { display: flex; align-items: center; gap: 8px; }
.hm-iw-ico { font-size: 1.15rem; line-height: 1; }
.hm-iw-title { margin: 0; font-size: 1.02rem; font-weight: 700; color: #1d2430; }
.hm-iw-msg { margin: 0; font-size: .95rem; line-height: 1.5; }
.hm-iw-msg b { color: #b3261e; font-variant-numeric: tabular-nums; }
.hm-iw-sub { margin: 0; font-size: .82rem; color: #6b7684; }
.hm-iw-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.hm-iw-actions .hm-btn { padding: 6px 18px; font-size: .9rem; }
.hm-iw-actions .hm-btn:focus-visible { outline: 2px solid #2c5aa0; outline-offset: 2px; }
@media (max-width: 600px) {
    .hm-idlewarn {
        top: auto;
        left: calc(16px + env(safe-area-inset-left));
        right: calc(16px + env(safe-area-inset-right));
        bottom: calc(16px + env(safe-area-inset-bottom));
        width: auto;
        transform: none;
    }
    .hm-iw-actions .hm-btn { flex: 1; min-height: 44px; font-size: .95rem; }
}

/* 관리자 계정 목록 — 사용량 미니 바 */
.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%; }
/* 서명 편집기 그림 도구·링크(2026-10-13): 그림을 누르면 메일 쓰기와 같은 그림 도구(editor-media.js — .hm-imgsel·.hm-imgbar),
   🔗 링크 주소 칸은 도구줄 아래 한 줄(연한 파랑 상자 — 무엇에 거는지 앞에 적는다), 틀린 주소는 그 아래 빨간 글씨 */
.hm-sig-editor img { cursor: pointer; }
.hm-sig-editor a { color: #1d5fb8; text-decoration: underline; }
.hm-sig-tiphint { margin-top: -2px; font-size: .78rem; }
.hm-sig-linkrow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: 6px 8px;
    border: 1px solid #c9d6e8;
    border-radius: 6px;
    background: #f4f8fd;
}
.hm-sig-linkfor { padding-right: 2px; color: #1d4f7a; font-size: .84rem; font-weight: 600; white-space: nowrap; }
.hm-sig-linkrow .hm-tb-linkinput { flex: 1 1 200px; width: auto; min-width: 0; max-width: 440px; padding: 4px 8px; font-size: .88rem; }
.hm-sig-linkerr { color: #b3261e; font-size: .84rem; }
.hm-sig-actions { display: flex; align-items: center; gap: 14px; }
/* 서명 [고치기](2026-10-09) — 고치는 중인 서명의 줄과 편집기 위 안내 줄을 연한 파랑으로(같은 편집기가 새 서명 추가와 고치기를 함께 쓴다) */
.hm-table tr.hm-sig-editing { background: #eef5fd; }   /* 줄째(단추 칸은 flex 라 칸 배경이 줄 높이를 다 채우지 못한다) */
.hm-sig-edithead {
    padding: 6px 10px;
    border-radius: 4px;
    background: #eef5fd;
    color: #1d4f7a;
    font-size: .88rem;
    overflow-wrap: anywhere;
}

/* 저장된 서명 미리보기 (표 안) */
.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; object-fit: contain; }   /* 크기를 정한 그림(2026-10-13)도 찌그러지지 않게 */

/* ─── 추가 이미지 / 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; }

/* 별칭·메일링 리스트 메모(2026-10-13, 관리자 → 🔀 별칭·📮 메일링 리스트 — AliasMemoField.razor). 메모 글은 줄바꿈 그대로, 긴 낱말은 칸 안에서 줄을 바꾼다.
   메모가 없으면 옅은 '＋ 메모'(테두리 없는 글자 단추), 고치는 중이면 글 상자 + [저장][취소] */
.hm-memo { display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
.hm-memo-text { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; color: #3a4552; font-size: .86rem; line-height: 1.45; }
.hm-memo-btn, .hm-memo-add { border: none; background: none; padding: 0 2px; margin: 0; cursor: pointer; font-family: inherit; }
.hm-memo-btn { flex: none; font-size: .78rem; line-height: 1.6; opacity: .65; }
.hm-memo-btn:hover, .hm-memo-btn:focus-visible { opacity: 1; }
.hm-memo-add { color: #8a96a3; font-size: .82rem; line-height: 1.45; white-space: nowrap; }
.hm-memo-add:hover, .hm-memo-add:focus-visible { color: #2c5aa0; text-decoration: underline; }
.hm-memo-editing { flex-direction: column; align-items: stretch; gap: 6px; width: 100%; }
.hm-memo-input { min-width: 220px; resize: vertical; font-family: inherit; line-height: 1.45; }
.hm-memo-input:focus { outline: none; border-color: #2c5aa0; box-shadow: 0 0 0 2px rgba(44, 90, 160, .18); }
.hm-memo-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }   /* [저장][취소] 다음에 글자 수 — 좁으면 글자 수만 아래 줄로 */
.hm-memo-bar .hm-hint { font-size: .76rem; }
/* 별칭 표의 메모 칸: 긴 메모가 표를 넓히지 않게 폭을 정해 둔다(줄을 바꿈). [삭제]는 좁은 창에서도 한 줄로(삭/제 로 깨지지 않게) */
.hm-alias-table .hm-memo-cell { width: 34%; }
.hm-alias-table td.hm-c-act { white-space: nowrap; }
/* 메일링 리스트 카드: 리스트 주소 바로 아래 — 고치는 동안에는 카드 폭(최대 640px)만큼 */
.hm-ml-memo { align-self: stretch; max-width: 640px; }

.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), (max-height: 500px) and (pointer: coarse) {
    /* 레일은 휴대폰에서 숨기고 상단바 ⋯ 앱 메뉴로 옮겼다 — 끝의 '휴대폰: 셸' 구역 */
    .hm-body-row { flex-direction: column; }

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

    /* 사이드바(메일함 목록)는 휴대폰에서 왼쪽 서랍 → 끝의 '휴대폰: 메일 목록·메일함 서랍' 구역 */

    /* 목록/본문: 한 화면씩 전환 (본문 열람 시 사이드바도 숨김) */
    .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-search { width: 110px; }
    .hm-searchbar { width: 100%; }
    .hm-searchbar .hm-search { flex: 1; min-width: 90px; }
    .hm-search-sel { max-width: 92px; }
    .hm-search-scope { max-width: 120px; }
    .hm-searchopts-hint { display: none; }
    .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) 규칙은 없앴다 —
       표마다 카드(.hm-cards)나 스크롤 상자(.hm-table-scroll)로 → 끝의 '휴대폰: 그 밖의 화면' 구역 */

    /* 환경설정: 좌측 메뉴를 상단 가로 바로 전환 */
    .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; }
/* 계정별 차단 발신 목록 (2026-10-28) — 직원 수신 거부를 주소·도메인별로 모아 골라서 전역 차단 */
.hm-sp-blk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.hm-sp-blk-table .hm-sp-blk-chk { width: 32px; text-align: center; }
.hm-sp-blk-table tr.hm-sp-blk-on td { background: #fff3f2; }
.hm-sp-blk-table tr.hm-sp-blk-done td { color: #8a96a5; }
.hm-sp-blk-n { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.hm-sp-blk-owners { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-sp-blk-modal { width: min(560px, 95vw); }
/* 2026-10-28 추가: 관리자 메모·'문제 없음' */
.hm-sp-blk-memo { width: 190px; min-width: 150px; max-width: 220px; }
.hm-sp-blk-memoview { display: flex; align-items: center; gap: 4px; min-width: 0; }
.hm-sp-blk-memotext { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4a3800; }
.hm-sp-blk-memobtn { flex: none; }
.hm-sp-blk-memoedit { display: flex; align-items: center; gap: 4px; }
.hm-sp-blk-memoedit .hm-search { flex: 1 1 140px; min-width: 0; width: auto; }
.hm-sp-blk-ok { color: #1e7a3c; font-weight: 600; margin-right: 6px; }
.hm-sp-blk-table tr.hm-sp-blk-done .hm-sp-blk-memotext { color: #6b5a2a; }
.hm-sp-blk-list { max-height: 40vh; overflow-y: auto; margin: 6px 0 10px; padding-left: 18px; font-size: .9rem; }
.hm-sp-blk-list li { margin: 2px 0; overflow-wrap: anywhere; }
@media (pointer: coarse) {
    .hm-sp-blk-chk input { width: 22px; height: 22px; }
}

.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, .hm-table th.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), (max-height: 500px) and (pointer: coarse) {
    .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; }   /* 좁은 화면: 날짜 글자가 겹치지 않게 한 칸 걸러 */
}

/* 시스템 관리 → 메일 감사 (MailAuditView) */
.hm-audit-warn {
    background: #fff8e6;
    border: 1px solid #f0d58a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .86rem;
    color: #5a4a1a;
    line-height: 1.55;
    margin-bottom: 12px;
}
.hm-audit-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 0 0 4px; padding: 0; border: 0; min-width: 0; font-size: .86rem; }
.hm-audit-note { margin-bottom: 12px; }
.hm-audit-form label { display: flex; flex-direction: column; gap: 4px; color: #555; }
.hm-audit-form label.hm-check { flex-direction: row; align-items: center; padding-bottom: 6px; }
.hm-audit-form .hm-search { width: 100%; box-sizing: border-box; }
.hm-audit-grow { flex: 1 1 220px; min-width: 180px; }
.hm-audit-form select { max-width: 260px; }
.hm-audit-summary { margin: 4px 0 8px; font-size: .9rem; }
.hm-error-text { color: #b3261e; }
.hm-audit-tablewrap { max-height: 60vh; overflow: auto; border: 1px solid #e3e8ef; border-radius: 6px; }
.hm-audit-table { width: 100%; table-layout: fixed; }
.hm-audit-table th:nth-child(1) { width: 96px; }
.hm-audit-table th:nth-child(2) { width: 130px; }
.hm-audit-table th:nth-child(3) { width: 90px; }
.hm-audit-table th:nth-child(4), .hm-audit-table th:nth-child(5) { width: 18%; }
.hm-audit-table th:nth-child(7) { width: 64px; }
.hm-audit-row { cursor: pointer; }
.hm-audit-row:hover { background: #f2f6fc; }
.hm-audit-row.on { background: #e5eefb; }
.hm-audit-ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-audit-h { margin: 20px 0 6px; font-size: .95rem; }
.hm-audit-hist { font-size: .82rem; }
.hm-audit-modal { width: min(920px, 96vw); max-height: 90vh; overflow-y: auto; }
.hm-audit-files { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-audit-files .hm-btn { text-decoration: none; }
.hm-audit-body { border-top: 1px solid #e3e8ef; margin-top: 6px; padding: 14px 4px; max-height: none; overflow: visible; }
@media (max-width: 720px) {
    .hm-audit-form label { flex: 1 1 100%; }
    .hm-audit-form select { max-width: none; }
}
/* 좁은 화면: 고정 폭 배치라 표 폭을 정해 둔다(목록 상자 .hm-audit-tablewrap 안에서 옆으로) — 받는 사람이 수십 명인 줄도 … 으로 줄어든다 */
@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
    .hm-audit-table { min-width: 720px; }
}


/* ═══════════════════════════════════════════════════════════════════════════════
   휴대폰 화면 (2026-10 개선) — 공통 바탕
   휴대폰 조건: (max-width: 820px), (max-height: 500px) and (pointer: coarse)  ← 가로로 돌린 휴대폰 포함
   · .hm-m-only = 휴대폰에서만 보이는 요소. 기본은 숨김이고, 휴대폰 블록에서 요소마다 자기 display 를 준다
   · .hm-d-only = PC 에서만 보이는 요소
   · 서랍·시트 같은 열린 창 상태는 <html data-hm-open="이름">, 검색줄 펼침은 <html data-hm-search="open"> (js/mobile.js)
   · PC 화면은 이 블록의 영향을 받지 않는다 ('PC 화면으로 보기'를 켜면 화면 폭을 1280 으로 잡아 휴대폰 규칙이 꺼진다)
   ═══════════════════════════════════════════════════════════════════════════════ */
.hm-m-only { display: none; }

/* 아래에서 올라오는 목록(시트) — 이동·더보기 등. data-hm-overlay="이름" 인 상자가 html[data-hm-open="이름"] 일 때 보인다 */
.hm-sheet, .hm-sheet-backdrop { display: none; }
.hm-sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .32); z-index: 950; }
.hm-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 951;
    max-height: 72dvh;
    overflow-y: auto;
    background: #fff;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .18);
    padding: 6px 0 calc(8px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
}
.hm-sheet-title { padding: 10px 18px 6px; font-size: .82rem; color: #5f6b7a; }
.hm-sheet button, .hm-sheet a.hm-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    background: none;
    font-size: 1rem;
    color: #1d2430;
    text-align: left;
    text-decoration: none;
}
.hm-sheet button:active, .hm-sheet a.hm-sheet-item:active { background: #eef3f9; }
.hm-sheet button:disabled { color: #a3acb7; }
.hm-sheet .hm-sheet-sep { height: 1px; background: #e3e8ef; margin: 4px 0; }

@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
    /* 버튼 이름이 한 글자씩 세로로 깨지지 않게 (한글은 글자마다 줄이 바뀔 수 있다) */
    .hm-btn, .hm-btn-sm { white-space: nowrap; }
    /* 누르는 순간 반응 표시 */
    .hm-btn:active:not(:disabled) { filter: brightness(.92); }
    html { -webkit-tap-highlight-color: rgba(44, 90, 160, .12); }
    /* 열린 창(서랍·시트)이 있으면 뒤를 어둡게 — 배경은 MainLayout 에 하나(data-hm-dismiss: 누르면 닫힘).
       각 시트는 자기 이름으로 보이게 한다: html[data-hm-open="이름"] .hm-sheet[data-hm-overlay="이름"] { display: block; } */
    html[data-hm-open] .hm-sheet-backdrop { display: block; }
}
/* 아이폰은 16px 보다 작은 입력 칸을 누르면 화면을 확대하고 되돌리지 않는다 — 터치 화면의 입력 칸은 모두 16px (체크박스·라디오 제외) */
@media (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
    select, textarea, [contenteditable="true"] { font-size: 16px !important; }
}

/* ═══ 휴대폰: 셸 (상단바·앱 메뉴·PC 화면 전환·안내 위치) ═══ */

/* 'PC 화면으로 보기'를 켠 휴대폰에서 휴대폰 화면으로 돌아오는 단추 — 그 경우(터치 기기)에만 보인다.
   화면을 PC 폭(1280)으로 그려 실제로는 1/3 크기쯤으로 보이므로, 이 단추와 상단바만 크게 그린다 */
.hm-tomobile-btn { display: none; }
@media (pointer: coarse) {
    html.hm-desktop-forced .hm-topbar { height: 92px; }
    html.hm-desktop-forced .hm-tomobile-btn {
        display: inline-flex;
        align-items: center;
        flex-shrink: 0;
        height: 72px;
        padding: 0 30px;
        border: 0;
        border-radius: 36px;
        background: #fff;
        color: #2c5aa0;
        font-size: 30px;
        font-weight: 700;
        white-space: nowrap;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
        cursor: pointer;
    }
}

/* 앱 메뉴의 'PC 화면으로 보기'는 화면 폭 지정(viewport)을 따르는 휴대폰·태블릿 브라우저에서만 효과가 있다
   (PC 브라우저 창을 좁힌 경우엔 눌러도 바뀌지 않으므로 숨긴다) */
.hm-appmenu .hm-appmenu-pc { display: none; }
@media (pointer: coarse) {
    .hm-appmenu .hm-appmenu-pc { display: flex; }
}

@media print {
    .hm-sheet, .hm-sheet-backdrop { display: none !important; }
}

/* ── 회사 메신저 앱의 메일 탭 (<html class="hm-app"> — 서버가 User-Agent 의 HumsMessenger/ 로 붙임, 2026-10-14 M-01) ──
   'PC 화면으로 보기'(⋯ 메뉴)와 되돌리는 '휴대폰 화면으로' 단추는 쓰지 않는다(앱 안에서는 PC 화면 전환을 하지 않음 — App.razor).
   인쇄(읽기 도구줄 🖨·⋯ 시트의 '인쇄')는 WebView 에 인쇄 연결이 없어 눌러도 반응이 없으므로 숨긴다. 홈 화면 추가 안내도 늘 숨김 */
html.hm-app .hm-appmenu .hm-appmenu-pc,
html.hm-app .hm-tomobile-btn,
html.hm-app .hm-print-btn,
html.hm-app .hm-print-item,
html.hm-app .hm-a2hs { display: none !important; }

@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
    /* PC 에서만 보이는 요소 (머리글의 .hm-d-only 약속) */
    .hm-d-only { display: none !important; }

    /* 상단바 48px: [브랜드] … [⋯]. 레일·사용자 주소·로그아웃·배포 표시는 ⋯ 앱 메뉴로 옮긴다.
       아이폰 노치·가로 화면의 둥근 모서리는 안전 여백(safe-area)으로 피한다 */
    .hm-topbar {
        height: calc(48px + env(safe-area-inset-top, 0px));
        padding: env(safe-area-inset-top, 0px) max(4px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
        gap: 4px;
        /* PC 와 같은 흰색→파랑 흐름. 좁은 폭에서도 브랜드 자리는 흰색, ⋯ 자리는 파랑이 되게 px 로 잡는다 */
        background: linear-gradient(90deg, #fff 0, #fff 170px, #2c5aa0 calc(100% - 24px));
    }
    .hm-rail, .hm-user, .hm-logout-form, .hm-topbar > .hm-ver { display: none; }
    .hm-brand {
        min-width: 0;
        max-width: calc(100% - 52px);
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-size: 1rem;
        line-height: 44px;
    }
    .hm-brand-logo { height: 28px; max-width: 170px; margin: 8px 0; }
    .hm-appmenu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        border-radius: 22px;
        background: none;
        color: #fff;
        font-size: 1.5rem;
        line-height: 1;
        cursor: pointer;
    }
    .hm-appmenu-btn:active, html[data-hm-open="appmenu"] .hm-appmenu-btn { background: rgba(255, 255, 255, .2); }

    /* 앱 메뉴(⋯) — 아래에서 올라오는 목록: 내 주소 / 메일·주소록·예약 메일·EML 보기·설정·(관리자) / PC 화면으로 보기·로그아웃 / 배포 버전 */
    html[data-hm-open="appmenu"] .hm-sheet[data-hm-overlay="appmenu"] { display: block; }
    .hm-appmenu-user {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 44px;
        padding: 4px 20px;
        color: #3a4552;
        font-size: .92rem;
    }
    .hm-appmenu-addr { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 700; }
    .hm-appmenu-ico { flex-shrink: 0; width: 24px; text-align: center; font-size: 1.1rem; }
    .hm-appmenu a.hm-sheet-item.active { color: #2c5aa0; font-weight: 700; background: #eef4fb; }
    .hm-appmenu-logout { margin: 0; }
    .hm-appmenu-ver { padding: 6px 20px 2px; color: #5f6b7a; font-size: .75rem; }

    /* 가로로 돌린 아이폰: 노치 쪽 화면 가장자리를 피한다 (세로·PC 에서는 0) */
    .hm-body-row { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
    .hm-sheet { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }

    /* 오류 안내·로그인 직후 안내: 화면 폭에 맞추고, 아래쪽 고정 바와 메일 쓰기 단추(오른쪽 아래) 위에 띄운다 */
    #blazor-error-ui {
        left: max(8px, env(safe-area-inset-left, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        max-width: none;
    }
    #blazor-error-ui .reload, #blazor-error-ui .hm-err-btn, #blazor-error-ui .dismiss { display: inline-block; padding: 8px 6px; }
    .hm-login-toast {
        left: 12px;
        right: 12px;
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }
}

/* ═══ 휴대폰: 메일 목록·메일함 서랍 (Mailbox·ReceiptsView) ═══
   목록 머리 [☰ 메일함 이름·개수 … 🔍 💬 🔄] / 메일함 서랍(PC 사이드바 마크업 그대로) / 고른 메일이 있을 때만 작업 바 /
   2줄 카드 행(본문 미리보기 없음 — 사람 많은 곳에서 남에게 보일 수 있어 넣지 않기로 함) / 목록 끝 페이저 / 메일 쓰기 둥근 단추.
   PC 에 닿는 규칙은 바로 아래 '바탕' 뿐이고, 그것도 휴대폰 전용 조각을 숨기거나 예전 모습을 그대로 두는 규칙이다 */

/* ── 바탕 (모든 화면) ── */
/* 목록 날짜의 휴대폰용 짧은 표기 (오늘 14:05 · 올해 10-03 · 그 전 25-12-30) */
.hm-d-rel { display: none; }
/* 서랍의 '↳ 수신 확인' 줄 — PC 는 보낸 메일함 옆 알약 단추. .hm-folders li 의 display:flex 보다 강해야 숨는다 */
.hm-folders li.hm-rc-item { display: none; }
/* 수신 확인 ⓘ 의 터치용 안내 단추 — 터치 화면에서만 (아래 hover:none) */
.hm-rc-infobtn { display: none; }
/* 수신 확인 제목줄의 상태·검색 묶음: PC 는 묶음이 없는 것처럼(제목줄 칸 사이 간격 그대로) */
.hm-searchbar.hm-rc-searchbar { display: contents; }
/* 행 체크 칸(label): 칸 어디를 눌러도 체크되고 메일은 열리지 않는다. PC 모습은 예전 그대로 —
   예전엔 체크박스가 칸(30px) 폭만큼 늘어난 칸 자체였으므로 label 안에서도 칸 폭을 채운다 */
.hm-row-chk { display: flex; align-items: center; margin: 0; }
.hm-row-chk > input { flex: 1 1 auto; min-width: 0; }
.hm-rc-help { margin: 0 12px 8px; white-space: pre-line; word-break: keep-all; color: #5f6b7a; }

@media print {
    .hm-mhead, .hm-fab { display: none !important; }
}
/* 서랍 여닫는 움직임을 줄이는 설정이면 바로 열고 닫는다 (PC 사이드바엔 움직임이 없어 영향 없음) */
@media (prefers-reduced-motion: reduce) {
    .hm-folders, html[data-hm-open="drawer"] .hm-folders[data-hm-overlay="drawer"] { transition: none; }
}

/* ── 터치 화면 (휴대폰·태블릿 — 마우스 PC 는 해당 없음) ── */
@media (hover: none) {
    /* 마우스를 올려야 보이던 내 메일함 ⋮ 를 늘 보이게 — inherit: 서랍이 닫혀 있으면 함께 숨는다 */
    .hm-kebab { visibility: inherit; }
    /* 터치 뒤 남는 :hover — 별표를 꺼도 노란색이 남아 안 꺼진 것처럼 보였다 */
    .hm-star:hover { color: #ccc; }
    .hm-star.on, .hm-star.on:hover { color: #f5b301; }
    .hm-row:not(.hm-msg-focused):hover, .hm-trow:hover, .hm-rc-row:not(.hm-msg-focused):hover,
    .hm-folders li:not(.active):hover { background-color: transparent; }
    /* 누르는 순간 반응 — 서버 응답을 기다리는 동안 두 번 누르지 않게 */
    .hm-row:active, .hm-trow:active, .hm-rc-row:active, .hm-folders li:active { background-color: #e3ecf8; }
    /* 안 읽은 메일만 보기(2026-10-20)의 켜진 '안 읽음' 줄 — 위 두 규칙(터치 뒤 남는 :hover 지우기·누르는 순간 연한 파랑)에 파랑이 지워지지 않게 */
    .hm-folders .hm-quick li.hm-uo-on:hover { background-color: #2c5aa0; }
    .hm-folders .hm-quick li.hm-uo-on.active:hover { box-shadow: inset 0 0 0 4px #2c5aa0, inset 0 0 0 6px #fff; }
    .hm-folders .hm-quick li.hm-uo-on:active { background-color: #244b86; }
    .hm-uo-toggle:hover, .hm-quick li.hm-uo-on .hm-uo-toggle:hover { background: none; }
    /* 아이폰은 아무 동작도 없는 상자를 누르면 문서까지 알리지 않을 수 있다 — 바깥을 눌러 닫는 배경(확인 창의 배경 포함)·목록 머리 이름 */
    .hm-menu-backdrop, .hm-sheet-backdrop, .hm-modal-backdrop, .hm-mhead-title { cursor: pointer; }
    /* 수신 확인 ⓘ: 풍선 도움말(title)이 뜨지 않으니 눌러서 펼치는 안내로 */
    .hm-rc-info { display: none; }
    .hm-rc-infobtn {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
        padding: 0 10px;
        border: 1px solid #c9d3de;
        border-radius: 16px;
        background: #fff;
        color: #46617f;
        font-size: .82rem;
        white-space: nowrap;
    }
}
@media (pointer: coarse) {
    /* 손가락 크기: 체크박스 20px(누르는 칸 40px), 폴더 ⋮·✔✕·＋·비우기·메뉴 항목 키우기 */
    .hm-row input[type="checkbox"], .hm-rc-row input[type="checkbox"], .hm-selall input {
        flex: none;
        width: 20px;
        height: 20px;
        accent-color: #2c5aa0;
    }
    .hm-selall { min-width: 40px; min-height: 40px; justify-content: center; padding: 0; }
    .hm-kebab { display: inline-block; min-width: 40px; padding: 8px 0; text-align: center; }
    .hm-folder-act { padding: 8px; opacity: .8; font-size: .95rem; }
    .hm-side-add { padding: 6px 12px; font-size: 1.1rem; }
    .hm-empty-btn { padding: 6px 12px; font-size: .82rem; }
    .hm-folder-menu button { padding: 12px 16px; font-size: .95rem; }
    .hm-rc-pill { line-height: 28px; padding: 0 10px; }
    .hm-pg { min-width: 40px; height: 40px; }
    /* 안 읽은 메일만 보기 체크 상자(2026-10-20): 누르는 칸 40px·체크 상자 20px — 음수 여백으로 줄 높이(서랍 44px)는 그대로 */
    .hm-uo-toggle { width: 40px; height: 40px; margin-top: -9px; margin-bottom: -9px; }
    .hm-uo-toggle > input { width: 20px; height: 20px; }
}

@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
    /* ── 목록 머리 44px: [☰][메일함 이름·개수] … [🔍][💬][🔄] — 메일을 읽는 동안은 읽기 화면의 줄이 대신한다 ── */
    .hm-mhead {
        display: flex;
        align-items: center;
        gap: 2px;
        flex-shrink: 0;
        height: 44px;
        box-sizing: border-box;
        padding: 0 4px;
        background: #fff;
        border-bottom: 1px solid #e3e8ef;
    }
    .hm-mail.hm-detail-open .hm-mhead, .hm-mail.hm-detail-open .hm-fab { display: none; }
    .hm-mhead-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        border-radius: 22px;
        background: none;
        color: #2c3e57;
        font-size: 1.15rem;
        line-height: 1;
        cursor: pointer;
    }
    .hm-mhead-btn:active:not(:disabled) { background: #eef3f9; }
    .hm-mhead-btn:disabled { opacity: .4; cursor: default; }
    .hm-mhead-btn.on, html[data-hm-search="open"] .hm-mhead-search { background: #dbe7f5; }
    .hm-mhead-title {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: baseline;
        gap: 6px;
        padding: 0 4px;
        white-space: nowrap;
        overflow: hidden;
        cursor: pointer;
    }
    .hm-mhead-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: 1.02rem; color: #1d2430; }
    /* 좁은 폰에선 개수가 먼저 줄어든다(메일함 이름이 더 중요) */
    .hm-mhead-count { flex-shrink: 4; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: .82rem; color: #5f6b7a; }
    .hm-mhead-count b { color: #2c5aa0; }
    /* 안 읽은 메일만 보기(2026-10-20): [💬] 자리의 [안 읽음만 ✕] — 보이는 높이 32px, 누르는 자리는 목록 머리 높이(44px)만큼 */
    .hm-mhead-uo {
        position: relative;
        flex-shrink: 0;
        gap: 4px;
        height: 32px;
        margin: 0 2px;
        padding: 0 5px 0 9px;
        border-radius: 16px;
        font-size: .8rem;
        vertical-align: middle;
    }
    .hm-mhead-uo::after { content: ""; position: absolute; inset: -6px -2px; }
    /* 그 자리만큼 좁아진 제목: 건수가 먼저 줄고 메일함 이름은 다 보인다(360px 폰의 '받은편지함') — 이름이 제목 칸보다 길 때만 이름도 … */
    .hm-mhead-uo-on .hm-mhead-name { flex-shrink: 0; max-width: 100%; }

    /* ── 목록 영역 하나가 스크롤을 맡는다: 페이저는 마지막 메일 뒤에(바닥 고정 아님), 작업 바는 위에 붙는다 ── */
    .hm-mail > .hm-list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .hm-list > .hm-msgs { flex: none; overflow: visible; }
    /* 끝에 메일 쓰기 단추 자리를 비워 둔다 (마지막 메일·페이저가 단추에 가리지 않게) */
    .hm-mail > .hm-list::after { content: ""; flex: none; height: calc(80px + env(safe-area-inset-bottom, 0px)); }
    .hm-list > .hm-pager { padding: 12px 0 4px; }

    /* ── 검색줄: 평소엔 접힘 — 🔍(html[data-hm-search="open"])이나 검색 결과를 보는 중(hm-search-on)에만 ──
       1줄 [검색어][검색][▾] / 2줄 [대상][메일함][해제] (::before 가 줄을 나눈다). PC 의 제목·개수는 목록 머리와 겹쳐 숨긴다 */
    .hm-list:not(.hm-receipts) > .hm-list-title { display: none; }
    html[data-hm-search="open"] .hm-list > .hm-list-title,
    .hm-list > .hm-list-title.hm-search-on { display: flex; }
    .hm-list > .hm-list-title {
        align-items: center;
        gap: 6px;
        min-height: 0;
        padding: 8px 10px;
        border-bottom: 1px solid #eef1f5;
    }
    .hm-list > .hm-list-title > h2,
    .hm-list > .hm-list-title > .hm-spacer,
    .hm-list:not(.hm-receipts) > .hm-list-title > .hm-count { display: none; }
    .hm-msearch-cond { display: block; flex-basis: 100%; font-size: .8rem; color: #5f6b7a; }
    .hm-list > .hm-memo-capline { display: block; }      /* 빠른 필터 '메모'의 상한 안내(2026-10-17) — 제목줄 대신 목록 위 한 줄 */
    .hm-list-title .hm-searchbar { width: 100%; column-gap: 6px; row-gap: 0; }
    .hm-list-title .hm-searchbar::before { content: ""; order: 0; flex-basis: 100%; height: 0; }
    .hm-searchbar .hm-search { order: -3; flex: 1 1 0; width: auto; min-width: 0; height: 40px; box-sizing: border-box; }
    .hm-searchbar .hm-search-go { order: -2; }
    .hm-searchbar .hm-search-optbtn { order: -1; min-width: 40px; }
    .hm-searchbar > .hm-btn { height: 40px; }
    .hm-searchbar > .hm-search-sel, .hm-searchbar > .hm-search-clear { order: 1; margin-top: 6px; }
    .hm-searchbar > .hm-search-sel { flex: 1 1 0; min-width: 0; max-width: none; height: 40px; }
    .hm-searchbar > .hm-search-scope { flex-grow: 2; }
    /* 상세 조건(기간·첨부)도 검색줄이 보일 때만, 한 줄에 하나씩 */
    .hm-list > .hm-searchopts { display: none; }
    html[data-hm-search="open"] .hm-list > .hm-searchopts,
    .hm-list-title.hm-search-on ~ .hm-searchopts { display: flex; }
    .hm-searchopts { gap: 8px 12px; padding: 8px 10px; }
    .hm-searchopts > label:not(.hm-check) { flex: 1 1 100%; }
    .hm-searchopts > label > select { flex: 1; min-width: 0; height: 40px; }
    .hm-search-dates { flex: 1 1 100%; }
    .hm-search-dates input { flex: 1; min-width: 0; height: 40px; box-sizing: border-box; }

    /* ── 수신 확인 제목줄: [N건][ⓘ 안내] — 이름·새로고침은 목록 머리, 상태·검색은 🔍 로 펼친다 ── */
    .hm-receipts > .hm-list-title { flex-wrap: wrap; }
    .hm-receipts .hm-count::after { content: "건"; }
    .hm-receipts .hm-rc-reload { display: none; }
    .hm-receipts .hm-rc-searchbar { display: none; }
    html[data-hm-search="open"] .hm-receipts .hm-rc-searchbar,
    .hm-receipts .hm-list-title.hm-search-on .hm-rc-searchbar { display: flex; flex-basis: 100%; }
    .hm-receipts .hm-rc-searchbar::before { display: none; }
    .hm-receipts .hm-rc-searchbar > select { flex: none; max-width: 40%; height: 40px; }

    /* ── 작업 바: 고른 메일이 있을 때만 한 줄 [☐][N개 선택] … [삭제][이동][읽음][⋯] — 스크롤해도 위에 붙어 있다 ── */
    .hm-list:not(.hm-receipts):not(.hm-has-sel) > .hm-toolbar { display: none; }
    .hm-list > .hm-toolbar {
        position: sticky;
        top: 0;
        z-index: 4;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 2px 8px 2px 0;
    }
    /* 메일 목록의 작업 바는 목록 머리(44px) 자리에 덮어 그린다(.hm-mail 기준 — .hm-list 에는 position 을 주지 않는다).
       목록 안에 끼우면 첫 메일을 고르는 순간 줄이 모두 46px 아래로 밀려, 이어서 누른 체크 칸이 다른 메일을 골랐다(아이폰은 보정 없음) */
    .hm-list:not(.hm-receipts) > .hm-toolbar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 44px;
        padding-top: 0;
        padding-bottom: 0;
        border-top: 0;
    }
    .hm-list:not(.hm-receipts) > .hm-toolbar > .hm-spacer { display: none; }
    .hm-selall { min-width: 40px; min-height: 40px; justify-content: center; padding: 0; }
    .hm-selcount {
        display: inline;
        margin-right: auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .9rem;
        font-weight: 700;
        color: #2c5aa0;
    }
    .hm-tb-m { display: inline-block; min-width: 40px; }
    .hm-toolbar > .hm-btn { min-height: 36px; }

    /* ── 메일 행 (601~820px: 한 줄 [체크 40][★ 40][보낸 사람][📎][제목][날짜] — 제목 칸 240px 이상) ── */
    .hm-row {
        grid-template-columns: 40px 40px 120px 20px minmax(0, 1fr) 72px;
        height: auto;
        min-height: 40px;
        padding: 0 10px 0 0;
    }
    .hm-row-env { display: none; }
    .hm-row > .hm-row-chk, .hm-rc-row > .hm-row-chk { align-self: stretch; justify-content: center; }
    .hm-row-chk > input { flex: none; }
    .hm-row > .hm-star { align-self: stretch; display: flex; align-items: center; justify-content: center; }
    /* 안 읽음: 흰색과 거의 같은 배경 대신 보낸 사람 앞 파란 점 (+ 굵은 글씨) */
    .hm-row.unread .hm-row-from::before, .hm-trow.unread .hm-row-from::before {
        content: "";
        display: inline-block;
        width: 8px;
        height: 8px;
        margin-right: 6px;
        vertical-align: 1px;
        border-radius: 50%;
        background: #2c5aa0;
    }
    .hm-row-date { color: #5f6b7a; }
    .hm-row-date .hm-d-short { display: none; }
    .hm-row-date .hm-d-rel { display: inline; }
    .hm-msg-folder { margin-right: 5px; }
    .hm-trow { height: auto; min-height: 40px; }
    .hm-rc-row {
        grid-template-columns: 40px 96px minmax(0, 1fr) 104px;
        height: auto;
        min-height: 40px;
        padding: 0 8px 0 0;
    }
    .hm-rc-status small { color: #5f6b7a; }

    /* ── 메일함 서랍: PC 사이드바를 왼쪽에서 밀어 낸다 (html[data-hm-open="drawer"], js/mobile.js) ──
       빠른 보기·전체/받은/보낸(↳ 수신 확인)/임시·내 메일함(＋, ⋮)·스팸/휴지통(비우기)·사용 용량까지 PC 와 같은 기능 */
    .hm-folders {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 952;
        width: min(300px, 86vw);
        box-sizing: border-box;
        padding: calc(8px + env(safe-area-inset-top, 0px)) 0 calc(10px + env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 0px);
        border-right: 0;
        box-shadow: 4px 0 24px rgba(0, 0, 0, .18);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        transform: translateX(-102%);
        visibility: hidden;
        transition: transform .2s ease, visibility 0s linear .2s;
    }
    html[data-hm-open="drawer"] .hm-folders[data-hm-overlay="drawer"] {
        transform: none;
        visibility: visible;
        transition: transform .2s ease;
    }
    /* 서랍 전체가 한 번에 스크롤 (가로로 돌린 폰처럼 낮은 화면에서도 아래 메일함까지 닿게) */
    .hm-folders-scroll { flex: none; overflow: visible; }
    .hm-folders li { min-height: 44px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; }
    .hm-folders .hm-folder-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* 하위 메일함: 상위 아래로 들여 쓰고 자기 이름만 (상위 경로 '상위.' 는 숨김) */
    .hm-folders li.hm-folder-nested { padding-left: calc(14px + var(--depth, 0) * 18px); }
    .hm-folder-nested .hm-folder-path { display: none; }
    .hm-folders li.hm-rc-item { display: flex; padding-left: 28px; font-size: .9rem; color: #46617f; }
    .hm-rc-arrow { margin-right: 4px; color: #8a96a5; }
    .hm-folders .hm-rc-pill { display: none; }
    .hm-drawer-lock { display: block; margin: -2px 12px 8px; font-size: .82rem; color: #b32121; }
    .hm-drawer-msg { display: block; margin: 0 12px 8px; font-size: .85rem; }
    /* 내 메일함 ⋮ 메뉴: 서랍 아래쪽에 붙여 서랍 안에서 다 보이게 (열린 서랍은 transform 이 없어 화면 기준으로 놓인다).
       메뉴 바깥 배경(.hm-menu-backdrop)은 서랍 안에 그려 서랍과 같은 층 — 바깥을 누르면 메뉴만 닫힌다 */
    .hm-folder-menu {
        position: fixed;
        top: auto;
        right: auto;
        left: calc(8px + env(safe-area-inset-left, 0px));
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        width: calc(min(300px, 86vw) - 16px - env(safe-area-inset-left, 0px));
        box-sizing: border-box;
    }

    /* ── 시트: 고른 메일 이동 / 더 보기 ── */
    html[data-hm-open="listmove"] .hm-sheet[data-hm-overlay="listmove"],
    html[data-hm-open="listmore"] .hm-sheet[data-hm-overlay="listmore"] { display: block; }
    .hm-sheet .hm-sheet-ico { flex-shrink: 0; width: 24px; text-align: center; font-size: 1.05rem; }
    .hm-sheet-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .hm-listmove button { padding-left: calc(20px + var(--depth, 0) * 18px); }
    .hm-sheet-note { padding: 2px 20px 8px 56px; font-size: .84rem; color: #b32121; word-break: keep-all; }
    .hm-sheet-note.hm-sheet-hint { color: #5f6b7a; }
    .hm-sheet-chips { display: flex; gap: 8px; padding: 2px 16px 8px; }
    .hm-sheet .hm-sheet-chips button {
        flex: 1;
        width: auto;
        min-height: 44px;
        padding: 0;
        justify-content: center;
        border: 1px solid #c9d3de;
        border-radius: 8px;
        font-size: .95rem;
    }
    .hm-sheet .hm-sheet-chips button.on { border-color: #2c5aa0; background: #eef4fb; color: #2c5aa0; font-weight: 700; }

    /* ── 메일 쓰기 둥근 단추 (오른쪽 아래, 아이폰 홈 바 위) ── */
    .hm-fab {
        position: fixed;
        z-index: 40;
        right: max(16px, env(safe-area-inset-right, 0px));
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #2c5aa0;
        color: #fff;
        font-size: 1.4rem;
        line-height: 1;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
        cursor: pointer;
    }
    .hm-fab:active:not(:disabled) { background: #244b86; }
    .hm-fab:disabled { background: #9aaecb; box-shadow: none; cursor: default; }
}

/* 휴지통의 작업 바 [영구 삭제](2026-10-09)는 [삭제]보다 32px 길다 — 아주 좁은 폰(340px 이하)에서는 그 바의 단추 사이 6 → 4px·
   단추 좌우 여백 10 → 6px ('N개 선택'이 예전 [삭제] 때보다 더 잘리지 않게. 다른 메일함의 작업 바는 그대로) */
@media (max-width: 340px) {
    .hm-list > .hm-toolbar.hm-toolbar-perm { gap: 4px; }
    .hm-list > .hm-toolbar.hm-toolbar-perm > .hm-btn { padding-left: 6px; padding-right: 6px; }
}

/* 좁은 폰(600px 이하): 메일 한 통 = 2줄 카드, 페이저는 [‹] 3 / 142 [›] */
@media (max-width: 600px) {
    /* [체크] 보낸 사람 …… 📎 날짜 / 제목 …… ★ — 체크 칸은 두 줄 높이 전체(40px 폭)가 누르는 자리 */
    .hm-row {
        grid-template-columns: 40px minmax(0, 1fr) auto auto;
        grid-template-areas: "chk from clip date" "chk subj subj star";
        column-gap: 4px;
        min-height: 60px;
        padding: 6px 6px 6px 0;
    }
    .hm-row > .hm-row-chk { grid-area: chk; }
    .hm-row > .hm-row-from { grid-area: from; padding-right: 2px; font-size: .95rem; color: #1d2430; }
    .hm-row > .hm-row-clip { grid-area: clip; }
    .hm-row > .hm-row-date { grid-area: date; padding-right: 6px; }
    .hm-row > .hm-row-subject { grid-area: subj; padding-right: 0; font-size: .9rem; color: #3a4552; }
    .hm-row.unread > .hm-row-subject { color: #1d2430; }
    /* 별표: 보이는 글자는 작아도 누르는 자리는 40px (위아래 음수 여백으로 줄 높이는 늘리지 않음) */
    .hm-row > .hm-star { grid-area: star; justify-self: end; width: 40px; height: 40px; margin: -8px 0; font-size: 1.1rem; }

    /* 대화 행도 같은 2줄: [▸] 보낸 사람 (개수) …… 날짜 / 제목 …… 📎 */
    .hm-trow {
        display: grid;
        grid-template-columns: 22px minmax(0, 1fr) auto auto;
        grid-template-areas: "mark from count date" "mark subj subj clip";
        column-gap: 6px;
        row-gap: 2px;
        min-height: 56px;
        padding: 7px 12px 7px 4px;
    }
    .hm-trow > .hm-trow-mark { grid-area: mark; width: auto; text-align: center; }
    .hm-trow > .hm-row-from { grid-area: from; flex: none; font-size: .95rem; }
    .hm-trow > .hm-thread-count { grid-area: count; }
    .hm-trow > .hm-row-date { grid-area: date; }
    .hm-trow > .hm-row-subject { grid-area: subj; padding-right: 0; font-size: .9rem; }
    .hm-trow > .hm-row-clip { grid-area: clip; }
    .hm-thread-child { padding-left: 16px !important; }

    /* 페이저: [‹] 3 / 142 [›] (단추 44px) */
    .hm-pager { gap: 14px; }
    .hm-pager .hm-pg-end, .hm-pager .hm-pg-num { display: none; }
    .hm-pager .hm-pg-info {
        display: inline-block;
        min-width: 64px;
        text-align: center;
        font-size: .92rem;
        color: #3a4552;
        font-variant-numeric: tabular-nums;
    }
    .hm-pager .hm-pg-nav { width: 44px; height: 44px; border: 1px solid #c9d3de; border-radius: 8px; background: #fff; font-size: 1.15rem; }

    /* 수신 확인 행: [체크] 받는 사람 …… 상태 / 제목 — 머리글 줄은 숨김 */
    .hm-rc-head { display: none; }
    .hm-rc-row {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        grid-template-areas: "chk to status" "chk subj subj";
        column-gap: 6px;
        row-gap: 2px;
        min-height: 56px;
        padding: 6px 12px 6px 0;
    }
    .hm-rc-row > .hm-row-chk { grid-area: chk; }
    .hm-rc-row > .hm-rc-to { grid-area: to; font-weight: 600; }
    .hm-rc-row > .hm-rc-status { grid-area: status; text-align: right; }
    .hm-rc-row > .hm-row-subject { grid-area: subj; padding-right: 0; font-size: .9rem; color: #3a4552; }
}

/* ═══ 휴대폰: 메일 읽기 (Mailbox 본문 보기) ═══
   위 줄 [← 목록 … ‹ › ⋯](위에 붙음) / 머리와 본문이 한 번에 스크롤 / 아래 고정 바 [답장·전체 답장·전달·삭제·이동] /
   ⋯·이동 시트 / 접힌 머리 요약(보낸 사람·짧은 날짜, '받는 사람 ○○ 외 N명 ▾') / 넓은 본문 화면 맞춤 / 알림은 아래 바 위에.
   읽기 화면은 목록 위에 덮는 층이고 목록은 감추기만 한다(visibility) — 목록으로 돌아오면 보던 위치 그대로.
   이 구역의 휴대폰 규칙은 화면(screen)에만 건다: PC 에서 인쇄하면 종이 폭(A4 약 720px)이 휴대폰 조건(820px 이하)에 걸려
   머리가 접히거나 본문 층이 한 화면 크기로 잘려 인쇄될 수 있다. 휴대폰에서 인쇄해도 예전 인쇄 모양이 나온다 */

/* PC: 본문을 감싼 상자(hm-body-inner)가 본문 칸 높이를 그대로 채운다 — 예전처럼 메일 안의 height="100%"
   (뉴스레터의 바깥 표 등)가 읽기 칸 높이를 기준으로 잡혀 배경색·가운데 정렬이 칸 전체에 깔린다.
   height:100% 로는 긴 메일에서 아래 여백(18px)이 빠져 flex 로 채운다 */
.hm-mail .hm-view > .hm-body { display: flex; flex-direction: column; }
.hm-mail .hm-view > .hm-body > .hm-body-inner { flex: 1 0 0%; }

@media print {
    /* 휴대폰에서 화면 폭에 맞춰 줄여 둔 본문도 원래 크기로 인쇄 */
    .hm-body-inner { zoom: 1 !important; }
    /* 인쇄는 예전처럼 보통 상자 — 여러 쪽으로 나뉘는 긴 본문 */
    .hm-mail .hm-view > .hm-body { display: block !important; }
}

@media screen and (max-width: 820px), screen and (max-height: 500px) and (pointer: coarse) {
    /* ── 층: 읽기 화면이 목록 위를 덮고 이 상자 하나가 스크롤된다. 목록·목록 머리는 자리를 지킨 채 감춘다
       (display:none 이면 브라우저가 목록의 스크롤 위치를 버리고, 목록 머리가 빠지면 목록 높이가 바뀌어 위치가 밀린다) ── */
    .hm-mail { position: relative; }
    .hm-mail.hm-detail-open > .hm-list { display: flex; visibility: hidden; }
    .hm-mail.hm-detail-open > .hm-mhead { display: flex; visibility: hidden; }
    .hm-mail.hm-detail-open > .hm-view {
        --hm-vbar-h: 56px;
        display: block;
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        overflow-x: hidden;              /* 넓은 것은 본문·표 상자 안에서만 민다 — 화면 전체가 옆으로 흔들리지 않게 */
        overflow-y: auto;
        overscroll-behavior-y: contain;   /* 맨 위에서 더 당겨도 '당겨서 새로고침'으로 번지지 않게 */
    }
    /* 발송 잠금 사유가 아래 바 위에 붙으면 바가 높아진다(두 줄까지) */
    .hm-mail.hm-detail-open > .hm-view.hm-vlocked { --hm-vbar-h: 100px; }
    /* 끝에 아래 바 자리 — 마지막 줄이 바에 가리지 않게 (스크롤 상자의 아래 padding 은 브라우저마다 달라 빈 상자로) */
    .hm-mail.hm-detail-open > .hm-view::after {
        content: "";
        display: block;
        height: calc(var(--hm-vbar-h) + 16px + env(safe-area-inset-bottom, 0px));
    }
    /* PC 의 버튼 줄(답장 … 🖨)은 위 줄·아래 바·⋯ 시트가 대신한다 */
    .hm-mail .hm-view-actions { display: none; }

    /* ── 위 줄 44px: [← 목록] … [‹][›][⋯] ── */
    .hm-vnav {
        position: sticky;
        top: 0;
        z-index: 6;
        display: flex;
        align-items: center;
        gap: 2px;
        height: 44px;
        box-sizing: border-box;
        padding: 0 4px;
        background: #fff;
        border-bottom: 1px solid #e3e8ef;
    }
    .hm-vnav-back {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        height: 44px;
        padding: 0 14px 0 8px;
        border: 0;
        border-radius: 22px;
        background: none;
        color: #2c5aa0;
        font-size: .98rem;
        font-weight: 700;
        white-space: nowrap;
        cursor: pointer;
    }
    .hm-vnav-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        border-radius: 22px;
        background: none;
        color: #2c3e57;
        font-size: 1.35rem;
        line-height: 1;
        cursor: pointer;
    }
    .hm-vnav-back:active:not(:disabled), .hm-vnav-btn:active:not(:disabled) { background: #eef3f9; }
    .hm-vnav button:disabled { opacity: .35; cursor: default; }
    html[data-hm-open="mailmore"] .hm-vnav-btn[data-hm-open-overlay="mailmore"] { background: #dbe7f5; }

    /* ── 머리: 고정하지 않는다 — 본문과 함께 밀려 올라간다 ── */
    .hm-mail .hm-view > .hm-view-head { padding: 8px 12px 10px; }
    .hm-mail .hm-view-subject { align-items: flex-start; padding: 2px 0 8px; margin-bottom: 6px; }
    .hm-mail .hm-view-head h2 { font-size: 1.05rem; line-height: 1.4; overflow-wrap: anywhere; }
    /* 제목 옆 별표: 보이는 글자는 그대로, 누르는 자리는 40px (음수 여백으로 줄 높이는 그대로) */
    .hm-mail .hm-view-star {
        flex: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin: -9px -8px -9px -10px;
    }

    /* 접힌 머리: [보낸 사람 이름 주소 …… 10-07 14:22] / [받는 사람 홍길동 외 4명 ▾] — 펼치면 PC 와 같은 줄들 */
    /* 한 칸짜리 격자를 화면 폭에 묶는다 — 그대로 두면 한 줄로 줄인 긴 이름 폭만큼 칸이 넓어져 화면 밖으로 나갔다 */
    .hm-mail .hm-view-meta { grid-template-columns: minmax(0, 1fr); font-size: .88rem; gap: 2px; }
    .hm-mail .hm-view-meta.hm-meta-folded > .hm-meta-row { display: none; }
    .hm-msum { display: block; }
    .hm-msum-from { display: flex; align-items: baseline; gap: 8px; padding-top: 2px; }
    .hm-msum-who { flex: 1; min-width: 0; color: #1d2430; overflow-wrap: anywhere; }
    /* 이름은 한 줄로 줄이고, 주소는 줄을 바꿔서라도 다 보인다(사칭 대비) */
    .hm-msum-name {
        display: inline-block;
        max-width: 100%;
        margin-right: 6px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        vertical-align: bottom;
    }
    .hm-msum-addr { font-size: .8rem; color: #5f6b7a; }
    .hm-msum-date { flex: none; font-size: .8rem; color: #5f6b7a; white-space: nowrap; }
    .hm-msum-to {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 40px;
        margin: 0;
        padding: 0;
        border: 0;
        background: none;
        color: #46617f;
        font-size: .84rem;
        text-align: left;
        overflow-wrap: anywhere;
        cursor: pointer;
    }
    .hm-msum-to:active { background: #eef3f9; }
    /* 펼친 상태: 요약의 보낸 사람 줄은 바로 아래 '보낸 사람' 줄과 겹치므로 뺀다 */
    .hm-view-meta:not(.hm-meta-folded) .hm-msum-from { display: none; }
    /* 펼친 줄: [이름표 64px][값] — 날짜·발송 국가는 값 아래 줄로 */
    .hm-mail .hm-view-meta > .hm-meta-row { align-items: flex-start; column-gap: 8px; row-gap: 0; }
    .hm-mail .hm-view-meta > .hm-meta-row > .hm-spacer { display: none; }
    .hm-mail .hm-meta-row > .hm-meta-value { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
    .hm-mail .hm-meta-row > .hm-meta-date { flex-basis: 100%; box-sizing: border-box; padding-left: 72px; }
    .hm-mail .hm-meta-sub { padding-left: 72px; }
    .hm-mail .hm-meta-sub > .hm-meta-label { display: none; }
    .hm-mail .hm-meta-sub > .hm-hint { flex-basis: 100%; }
    .hm-mail .hm-sender-acts { display: flex; flex-wrap: wrap; align-items: center; }
    .hm-mail .hm-sender-acts a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; }
    .hm-mail .hm-view-meta .hm-meta-more { display: inline-flex; align-items: center; min-height: 32px; }
    /* 주소록 빠른 등록 칸 */
    .hm-mail .hm-quickadd .hm-inline-input { flex: 1 1 140px; min-height: 40px; }
    .hm-mail .hm-quickadd .hm-btn { min-height: 40px; }

    /* 스팸 사유·DMARC 카드: 표가 넓으면 그 상자 안에서만 옆으로 */
    .hm-mail .hm-view .hm-spam-card, .hm-mail .hm-view .hm-dmarc { padding: 10px 12px; }
    .hm-mail .hm-vtable { overflow-x: auto; }
    .hm-mail .hm-spam-actions .hm-btn { min-height: 40px; white-space: normal; word-break: keep-all; text-align: left; }

    /* 첨부: 한 칸 높이 40px [📎 파일 이름 | 미리보기] — 이름은 줄을 바꿔서라도 다 보이고, 미리보기·⬇ 는 따로 누르는 단추 */
    .hm-mail .hm-view .hm-attachments { gap: 6px; }
    .hm-mail .hm-view .hm-attachment {
        display: inline-flex;
        align-items: stretch;
        max-width: 100%;
        min-height: 40px;
        box-sizing: border-box;
        padding: 0;
        border-radius: 8px;
    }
    .hm-mail .hm-view .hm-attachment > a {
        display: inline-flex;
        align-items: center;
        min-height: 38px;
    }
    .hm-mail .hm-view .hm-attachment > a:first-child { min-width: 0; padding: 4px 10px; overflow-wrap: anywhere; }
    .hm-mail .hm-view .hm-attachment > a + a {
        flex: none;
        margin-left: 0;
        padding: 0 12px;
        border-left: 1px solid #dfe5ec;
        font-size: .82rem;
    }
    /* PDF·오피스 문서의 미리보기는 창(iframe) 대신 새 탭 링크(hm-attach-tab)로 */
    .hm-mail .hm-view .hm-attachment > a.hm-att-modal { display: none; }
    /* 아이폰 홈 화면 앱(data-hm-ios-app — js/mobile.js)은 새 탭이 앱 밖 Safari 로 열려 로그인이 없다 — 앱 안의 미리보기 창으로 */
    html[data-hm-ios-app] .hm-mail .hm-view .hm-attachment > a.hm-att-modal { display: inline-flex; }
    html[data-hm-ios-app] .hm-mail .hm-view .hm-attachment > a.hm-attach-tab { display: none; }

    /* 외부 이미지 차단 안내: 글과 단추가 화면 폭에 맞게 줄을 바꾼다 */
    .hm-mail .hm-view .hm-imgblock { flex-wrap: wrap; row-gap: 6px; padding: 8px 10px; }
    .hm-mail .hm-view .hm-imgblock .hm-btn { min-height: 40px; }

    /* ── 본문: 안쪽 스크롤 없이 내용 높이 그대로 (넓은 내용만 이 상자 안에서 옆으로) ── */
    .hm-mail .hm-view > .hm-body { display: block; flex: none; overflow-x: auto; overflow-y: hidden; padding: 12px; }
    /* 메일 안의 z-index(position:relative; z-index:10 등 — 정화 후에도 남는다)는 본문 안에서만 겹치게 한다. 휴대폰은 본문이 위 줄
       (← 목록 ‹ › ⋯, z-index 6) 밑으로 밀려 올라가는데, 그대로 두면 그런 상자가 위 줄을 덮고 누름까지 가로챘다(31 이상이면 아래 바도).
       읽기 화면 상자(hm-view)에 z-index 를 주면 그 안의 확인·미리보기 창이 공용 배경 밑으로 깔리므로 본문 상자만 따로 묶는다 */
    .hm-mail .hm-view > .hm-body { isolation: isolate; }
    /* 가로·세로 크기 속성이 다 붙은 그림이 폭만 줄어 찌그러지지 않게(비율은 hmMobile.fit 이 속성값으로 지정 —
       그림 본래 비율을 쓰면 1×1 점 그림을 늘린 구분선 width=600 height=2 가 정사각형이 된다).
       세로 속성만 있는 그림(서명 로고 height=40)·% 크기는 메일에 적힌 그대로. 긴 주소(URL)는 화면 안에서 줄바꿈 */
    .hm-body img[width][height]:not([width$="%"]):not([height$="%"]) { height: auto; }
    .hm-body, .hm-plaintext { overflow-wrap: anywhere; }
    /* '원본 크기로 보기 ⇄ 화면에 맞추기' — 줄였을 때(data-hm-fitted)와 원본으로 돌렸을 때(data-hm-fit="off")만 */
    .hm-fit-toggle {
        display: none;
        align-items: center;
        width: max-content;
        min-height: 40px;
        margin: -4px 0 8px auto;
        padding: 0 14px;
        border: 1px solid #c9d3de;
        border-radius: 20px;
        background: #fff;
        color: #2c5aa0;
        font-size: .84rem;
        cursor: pointer;
    }
    .hm-body[data-hm-fitted] > .hm-fit-toggle, .hm-body[data-hm-fit="off"] > .hm-fit-toggle { display: flex; }
    .hm-fit-toggle .hm-fit-fit, .hm-body[data-hm-fit="off"] > .hm-fit-toggle .hm-fit-orig { display: none; }
    .hm-body[data-hm-fit="off"] > .hm-fit-toggle .hm-fit-fit { display: inline; }
    .hm-fit-toggle:active { background: #eef3f9; }

    /* ── 아래 고정 바 56px: 아이콘 위에 작은 글씨 (아이폰 홈 바 위로) ── */
    .hm-vbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        display: flex;
        flex-direction: column;
        padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
        background: #fff;
        border-top: 1px solid #dde3ea;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
    }
    /* 발송 잠금 사유 (두 줄까지) */
    .hm-vbar-lock {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        padding: 4px 12px;
        background: #fdf3f3;
        color: #b32121;
        font-size: .8rem;
        line-height: 1.35;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }
    .hm-vbar-btns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: 56px; }
    .hm-vbar-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        padding: 0 2px;
        border: 0;
        background: none;
        color: #2c3e57;
        font-size: .74rem;
        line-height: 1.2;
        white-space: nowrap;
        word-break: keep-all;
        cursor: pointer;
    }
    .hm-vbar-btn > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
    .hm-vbar-ico { font-size: 1.15rem; line-height: 1.25; }
    .hm-vbar-btn:active:not(:disabled) { background: #eef3f9; }
    .hm-vbar-btn:disabled { color: #a3acb7; cursor: default; }
    .hm-vbar-btn:disabled .hm-vbar-ico { opacity: .45; }
    html[data-hm-open="mailmove"] .hm-vbar-btn[data-hm-open-overlay="mailmove"] { background: #eef4fb; color: #2c5aa0; }

    /* ── 알림·오류: 아래 바 바로 위에 뜬다. 뒤의 본문을 가리지 않게 누름은 통과시킨다(닫기 단추만 받음) ── */
    .hm-vtoast {
        position: fixed;
        z-index: 31;
        left: max(12px, env(safe-area-inset-left, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: calc(var(--hm-vbar-h) + 8px + env(safe-area-inset-bottom, 0px));
        display: flex;
        flex-direction: column;
        gap: 6px;
        pointer-events: none;
    }
    .hm-vtoast .hm-notice, .hm-vtoast .hm-error { margin: 0; box-shadow: 0 4px 16px rgba(0, 0, 0, .16); }
    .hm-vtoast button { pointer-events: auto; min-height: 32px; }
    /* 오류의 [닫기] (Mailbox BannerBlocks) — 메일을 연 채로는 오류가 지워지지 않아 본문 끝 줄을 계속 가렸다. 목록·PC 에서는 숨김 */
    .hm-vtoast .hm-error-close { display: inline-block; margin-left: 6px; }

    /* ── 시트: 이 메일 이동 / 더 보기 / 자동 분류(⋯ → 앞으로 이 보낸 사람의 메일을 옮길 메일함) ── */
    html[data-hm-open="mailmove"] .hm-sheet[data-hm-overlay="mailmove"],
    html[data-hm-open="mailmore"] .hm-sheet[data-hm-overlay="mailmore"],
    html[data-hm-open="mailauto"] .hm-mailauto[data-hm-overlay="mailauto"] { display: block; }
    .hm-mailmove button, .hm-mailauto button { padding-left: calc(20px + var(--depth, 0) * 18px); }
    .hm-mailmore .hm-sheet-title, .hm-mailauto .hm-sheet-title { overflow-wrap: anywhere; }
    .hm-mailauto .hm-sheet-title { word-break: keep-all; }      /* '메일/을' 처럼 낱말이 갈리지 않게(긴 주소는 위 규칙대로 아무 데서나) */
    .hm-sheet button.hm-sheet-danger { color: #b32121; }
    .hm-sheet button.hm-sheet-danger:disabled { color: #a3acb7; }

    /* ── Blazor 가 그리는 창(스팸 등록 확인·첨부 미리보기): 자기 배경이 있으므로, 뒤로가기용으로 올린 동안 공용 배경은 겹치지 않는다 ── */
    html[data-hm-open="spamconfirm"] .hm-sheet-backdrop,
    html[data-hm-open="autofilter"] .hm-sheet-backdrop,
    html[data-hm-open="attpreview"] .hm-sheet-backdrop,
    html[data-hm-open="trashconfirm"] .hm-sheet-backdrop,
    html[data-hm-open="spambulk"] .hm-sheet-backdrop { display: none; }
    /* 영구 삭제 확인(2026-10-09)·목록 스팸 등록 확인(2026-10-13): 목록·읽기 화면 밖에 그려지는 창 — 단추는 손가락 크기(읽기 화면의 확인 창과 같게) */
    .hm-trash-modal .hm-modal-actions .hm-btn,
    .hm-spambulk-modal .hm-modal-actions .hm-btn { min-height: 44px; padding: 0 18px; }
    /* 스팸 등록 확인(두 창 모두)의 체크 항목은 상자를 첫 줄에 맞추므로(두 줄로 접힘) 한 줄일 때도 손가락 칸 가운데 오게 위아래 여백으로 */
    .hm-spam-modal .hm-check { min-height: 40px; padding: 9px 0; }
    /* 가로로 든 휴대폰(높이 300~390px)에서는 안내가 여러 줄인 창이 화면보다 높아질 수 있다 — 가운데 고정이라 [확인]·[취소]가 잘리지 않게
       화면 높이까지만 쓰고 넘치면 창 안에서 스크롤(자동 분류 확인 창과 같게) */
    .hm-modal.hm-spam-modal {
        max-height: calc(100vh - 16px);     /* dvh 를 모르는 브라우저 */
        max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .hm-modal.hm-spam-modal > * { flex-shrink: 0; }
    .hm-view .hm-modal .hm-check { min-height: 40px; }
    /* 자동 분류 확인 창의 체크 항목은 상자를 첫 줄에 맞추므로(두 줄로 접힘) 한 줄일 때도 글이 칸 가운데 오게 위아래 여백으로 */
    .hm-view .hm-autofilter-modal .hm-check { padding: 9px 0; }
    /* 자동 분류 확인 창은 항목이 많아(330~420px) 가로로 든 휴대폰(높이 300~360px)에서는 화면보다 높았다 — 가운데 고정이라
       위의 제목과 아래 [등록]·[취소]가 화면 밖으로 잘려 스크롤로도 닿지 않았다. 화면 높이까지만 쓰고 넘치면 창 안에서 스크롤 */
    .hm-view .hm-modal.hm-autofilter-modal {
        max-height: calc(100vh - 16px);     /* dvh 를 모르는 브라우저 */
        max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .hm-view .hm-modal.hm-autofilter-modal > * { flex-shrink: 0; }     /* 높이가 모자라면 줄어들지 말고 스크롤되게 */
    .hm-view .hm-modal-actions .hm-btn { min-height: 44px; padding: 0 18px; }
    /* 첨부 미리보기(그림·글)는 화면 전체 — PDF·오피스 문서는 새 탭으로 열린다(Mailbox) */
    .hm-mail .hm-modal.hm-attpreview-modal {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        transform: none;
        width: auto;
        height: auto;
        max-height: none;
        border-radius: 0;
        padding: calc(6px + env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px))
                 calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    }
    .hm-attpreview-head > b { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .hm-attpreview-head > .hm-spacer { display: none; }
    .hm-attpreview-head > .hm-btn { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
    .hm-attpreview-modal > .hm-hint { display: none; }
}
/* 가로로 든 휴대폰(높이 500px 이하): 자동 분류 확인 창의 도움말 줄은 숨겨 흔한 경우 [등록]·[취소]까지 스크롤 없이 보이게
   (넘치면 위 규칙대로 창 안에서 스크롤. 순서 변경·삭제 안내는 등록 뒤 알림에도 '설정 → 자동 분류'로 나온다) */
@media screen and (max-height: 500px) and (pointer: coarse) {
    .hm-view .hm-autofilter-modal > .hm-hint { display: none; }
}

/* ═══ 휴대폰: 메일 쓰기 (Compose·주소 칸·편집기) ═══
   [보내기] 줄: 단추 글자는 줄을 바꾸지 않고(모자라면 줄째 넘김), ⏰ 예약 칸은 ⏰ 를 눌렀을 때만, 자동 저장 시각은 [임시 저장] 아래 /
   편집기는 내용만큼 늘어나 메일 쓰기 화면 하나만 스크롤 / 서식 도구줄은 한 줄로 옆으로 밀어 쓰고 [보내기] 줄 바로 아래에 붙는다 /
   주소록 고르기·미리보기는 화면 전체(단추는 위 — 키보드에 가리지 않게) / 손가락 크기.
   PC 에 닿는 규칙은 '바탕'뿐이고, 예전 모습을 그대로 두거나 휴대폰에서만 그려지는 조각의 규칙이다 */

/* ── 바탕 (모든 화면) ── */
/* 첨부 빼기 ✕: 예전 <a> 와 똑같이 보이는 단추 — 예전에도 .hm-attachment a 규칙이 이겨 파란 굵은 ✕ 였다 */
.hm-attachment > button.hm-attach-remove {
    padding: 0;
    border: 0;
    background: none;
    color: #2c5aa0;
    font: inherit;
    font-weight: 700;
    line-height: inherit;
    vertical-align: baseline;
}
.hm-attachment > button.hm-attach-remove:hover { text-decoration: underline; }
/* [임시 저장] 아래 자동 저장 시각(휴대폰) — 아직 저장 전이면 아무것도 */
.hm-autosave-m:empty { display: none !important; }
/* 작성 중이던 메일 복구 안내 — 터치 기기에서만 나온다(editor.js hmCompose) */
.hm-restore {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    background: #eef5fd;
    border-color: #b9d4f0;
    color: #1d4f7a;
}
.hm-restore > span { flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; }
.hm-restore > .hm-btn:first-of-type { margin-left: auto; }
/* 다시 보내기 안내(보낸편지함 → 메일 쓰기) — 복구 안내와 같은 파란 안내, 칸들과 같은 왼쪽 선(PC 18px).
   둘째 줄 '원래 받는 사람'은 흐리게. 한글은 낱말 단위로 줄을 바꾸고 긴 주소만 아무 데서나 */
.hm-resend-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 10px 18px 0;
    background: #eef5fd;
    border-color: #b9d4f0;
    color: #1d4f7a;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
/* 도메인별 발송 금지 — 고르려던 보내는 사람(답장에서 받은 주소 등)이 막혀 다른 주소로 바꿨다는 한 줄 안내(메일 쓰기). 다시 보내기 안내와 같은 파란 안내 */
.hm-from-notice {
    margin: 10px 18px 0;
    background: #eef5fd;
    border-color: #b9d4f0;
    color: #1d4f7a;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.hm-resend-orig { color: #5f6b7a; font-size: .8rem; }
/* 본문의 대용량 첨부 링크 기한 경고 — 상태 표시의 '주의'와 같은 주황 글자 */
.hm-resend-warn { color: #9a5b00; font-weight: 600; }
/* [취소] 닫기 확인 '작성 중인 메일이 있습니다'(2026-10-09) — 낱말 단위 줄바꿈, 좁으면 단추를 다음 줄로, '저장하지 않고 닫기'는 붉은 글자(지우는 동작) */
.hm-cclose-modal { word-break: keep-all; }
.hm-cclose-modal .hm-modal-actions { flex-wrap: wrap; }
.hm-btn.hm-cclose-discard { color: #b32121; }

/* 끌어다 놓기는 터치 화면에서 할 수 없다 — 그 안내만 숨긴다 */
@media (hover: none), (pointer: coarse) {
    .hm-drag-txt { display: none; }
}

/* ── 손가락 크기 (터치 화면 — 마우스 PC 는 해당 없음) ── */
@media (pointer: coarse) {
    /* 주소 칩: ✎ 고치기 · ✕ 빼기 30px(예전 20px 에 1px 간격 — 고치려다 빼는 일이 잦았다), 칩 높이 32px */
    .hm-chips { gap: 6px; max-height: calc(8 * 38px + 12px); }
    .hm-chip { height: auto; min-height: 32px; padding-right: 1px; border-radius: 16px; }
    .hm-chip-btn { width: 30px; height: 30px; line-height: 30px; margin-left: 2px; font-size: .85rem; }
    .hm-chip-edit { height: 32px; border-radius: 16px; }
    /* 참조 접기 ^ 36px, 주소록 📒 40px, 접힌 참조 요약 */
    .hm-cc-toggle { width: 36px; height: 36px; }
    .hm-cc-summary-btn { min-height: 36px; }
    .hm-cinput > .hm-btn-sm { min-width: 40px; min-height: 40px; }
    .hm-cfield-multi .hm-cinput > .hm-btn-sm { margin-top: 2px; }
    /* 첨부 단추·첨부 빼기 ✕·개별 발송 체크 */
    .hm-file-label { display: inline-flex; align-items: center; min-height: 40px; }
    .hm-attachment > button.hm-attach-remove { min-width: 32px; min-height: 32px; margin-left: 2px; }
    .hm-cattach .hm-attachment { display: inline-flex; align-items: center; min-height: 34px; padding: 0 0 0 10px; }
    .hm-copts .hm-check { min-height: 40px; }
    .hm-copts input[type="checkbox"], .hm-pick-row input[type="checkbox"], .hm-pick-sec input[type="checkbox"] {
        width: 20px;
        height: 20px;
        accent-color: #2c5aa0;
    }
    /* 본문 그림 손잡이·도구 막대, 주소 자동완성 항목 */
    .hm-imgsel-handle { width: 24px; height: 24px; right: -12px; bottom: -12px; }
    .hm-imgbar button, .hm-pastebar button { min-height: 34px; }
    .hm-ac-item { padding: 10px 12px; }
}
@media (pointer: coarse) and (max-height: 800px) {
    .hm-chips { max-height: calc(4 * 38px + 12px); }
}

@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
    /* 메일 쓰기 화면 하나만 스크롤 — 옆으로는 밀리지 않게. 끝의 빈 칸 = 아이폰 키보드가 덮은 높이(--hm-kb, editor.js)
       (스크롤 상자의 아래 padding 은 브라우저에 따라 무시돼 빈 칸 조각으로 둔다) */
    .hm-compose { overflow-x: hidden; }
    .hm-compose::after { content: ""; flex: none; height: var(--hm-kb, 0px); }
    /* '메일 쓰기' 제목줄은 숨긴다 — 자동 저장 시각은 [임시 저장] 아래로 */
    .hm-compose-title { display: none; }
    .hm-sendlock, .hm-from-notice { margin: 8px 10px 0; }

    /* [✕][미리보기][임시 저장][⏰] … [보내기] — 40px 높이, 좁으면(320px 등) 줄째 넘긴다.
       2026-10-09 [취소]는 맨 왼쪽의 ✕(닫기 자리), [보내기]는 맨 오른쪽(엄지 자리) — 화면의 차례만 바꾼다(PC 는 예전 그대로).
       ⏰ 예약 칸(order 10)은 둘째 줄이라 [보내기]는 그 앞(order 5) */
    .hm-compose-head { flex-wrap: wrap; gap: 4px; padding: 6px 8px; }
    .hm-compose-head > .hm-btn { min-height: 40px; padding: 0 9px; }
    .hm-compose-head > .hm-btn-primary { padding: 0 14px; }
    .hm-compose-head > .hm-spacer { flex: 1 1 0; min-width: 0; }
    .hm-compose-head > .hm-csend { order: 5; margin-left: auto; }   /* 줄이 넘어가도 [보내기]는 오른쪽 */
    .hm-compose-head > .hm-ccancel {
        order: -1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        padding: 0;
        font-size: 1.05rem;
    }
    .hm-ccancel > .hm-ccancel-txt { display: none; }
    .hm-ccancel > .hm-m-only { display: inline; }
    .hm-compose-head > .hm-csave {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        line-height: 1.15;
    }
    .hm-autosave-m { display: block; margin-top: 1px; color: #5f6b7a; font-size: .62rem; font-weight: 400; }
    .hm-compose-head > .hm-sched-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        padding: 0;
        font-size: 1.05rem;
    }
    .hm-sched-toggle.on { border-color: #2c5aa0; background: #e3edf9; }
    .hm-schedule:not(.hm-sched-open) { display: none; }
    .hm-schedule.hm-sched-open { order: 10; flex: 1 1 100%; min-width: 0; font-size: .85rem; }
    .hm-schedule input { flex: 1; min-width: 0; min-height: 40px; }
    /* 발송 취소 막대: 좁으면 [실행 취소]를 다음 줄 오른쪽으로 */
    .hm-sendbar { flex-wrap: wrap; gap: 6px 10px; padding: 8px 10px; }
    .hm-sendbar .hm-btn { margin-left: auto; min-height: 40px; }
    .hm-compose-sticky > .hm-notice, .hm-compose-sticky > .hm-error { margin: 6px 8px; }
    .hm-restore { margin: 6px 8px; }
    .hm-restore .hm-btn { min-height: 40px; padding: 0 14px; }
    .hm-resend-info { margin: 6px 8px 0; padding: 8px 12px; }

    /* 입력 행: 칸 이름 폭을 줄여 입력 칸을 넓힌다('보내는 사람'은 두 줄로) */
    .hm-cfields { padding: 0 10px; }
    .hm-cfield { grid-template-columns: 64px minmax(0, 1fr); min-height: 40px; }
    .hm-cfield > label { word-break: keep-all; line-height: 1.25; }
    .hm-cgroup-addr { margin: 6px 0 4px; padding: 2px 8px; }
    /* 제목 줄 강조(2026-10-13): 휴대폰은 칸 이름 폭이 좁다(64px) — 안쪽 여백을 줄이고 글자는 손가락으로 고치기 좋은 크기로 */
    .hm-cfield.hm-cfield-subject { margin: 2px 0 6px; min-height: 44px; }
    .hm-cfield-subject > label { padding: 0 6px 0 10px; }
    .hm-cfield.hm-cfield-subject > input { padding-left: 10px; font-size: 1rem; }
    .hm-from-select { max-width: 100%; min-width: 0; }
    /* 첨부 칩: 긴 파일 이름은 줄을 바꿔 화면이 옆으로 밀리지 않게 */
    .hm-cattach .hm-attachment { display: inline-flex; align-items: center; max-width: 100%; min-width: 0; overflow-wrap: anywhere; }

    /* 서식 도구줄: 한 줄로 옆으로 밀어 쓰고, 본문을 내려도 [보내기] 줄 바로 아래에 붙어 있다(--hm-chead-h, editor.js) */
    .hm-etoolbar {
        position: sticky;
        top: var(--hm-chead-h, 0px);
        z-index: 4;
        flex-wrap: nowrap;
        gap: 6px;
        margin-top: 4px;
        padding: 5px 10px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        background: #fff;
    }
    .hm-etoolbar::-webkit-scrollbar { display: none; }
    .hm-etoolbar > * { flex: 0 0 auto; }
    .hm-etoolbar > .hm-spacer { display: none; }
    .hm-etoolbar button { min-width: 36px; min-height: 36px; padding: 0 10px; white-space: nowrap; }
    .hm-tb-img, .hm-tb-select { min-height: 36px; white-space: nowrap; }
    .hm-tb-color { width: 36px; height: 36px; }
    .hm-tb-linkinput { width: 180px; min-height: 36px; }

    /* 편집기: 안쪽 스크롤 없이 내용만큼 늘어난다(처음 높이는 화면의 45%). 넓은 표·인용 메일은 편집기 안에서만 옆으로 */
    .hm-editor {
        flex: none;
        min-height: 45vh;
        min-height: 45dvh;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 12px 10px 16px;
        overflow-wrap: anywhere;
    }
    .hm-editor img { max-width: 100%; height: auto; }

    /* 본문 그림 도구: 한 줄로 옆으로 밀어 쓴다(여러 줄로 감겨 본문을 덮지 않게) */
    .hm-imgbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: calc(100vw - 16px); }
    .hm-imgbar::-webkit-scrollbar { display: none; }
    .hm-imgbar > * { flex: 0 0 auto; }

    /* 주소록 고르기·미리보기·닫기 확인은 자기 배경이 있다 — 휴대폰 뒤로가기용으로 올린 동안 공용 배경은 겹치지 않는다 */
    html[data-hm-open="cpick"] .hm-sheet-backdrop,
    html[data-hm-open="cpreview"] .hm-sheet-backdrop,
    html[data-hm-open="cclose"] .hm-sheet-backdrop { display: none; }
    /* 닫기 확인: 손가락 크기(44px). 낮은 화면(가로로 든 휴대폰)에서도 단추까지 보이게 화면 높이까지만 — 넘치면 창 안에서 스크롤 */
    .hm-cclose-modal .hm-modal-actions .hm-btn { min-height: 44px; padding: 0 16px; }
    .hm-modal.hm-cclose-modal {
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

/* 가로로 돌린 휴대폰: 세로가 낮아 서식 도구줄까지 붙여 두면 글 쓸 자리가 거의 남지 않는다 — [보내기] 줄만 붙인다
   (PC 의 도구줄은 원래 붙지 않아 영향 없음) */
@media (max-height: 500px) and (orientation: landscape) {
    .hm-etoolbar { position: static; }
}

@media (max-width: 600px) {
    /* 닫기 확인: 세 단추가 한 줄에 들어가지 않는다 — 한 줄에 하나씩 */
    .hm-cclose-modal .hm-modal-actions { flex-direction: column; align-items: stretch; }

    /* 첨부 줄: 칸 이름('파일 첨부')은 단추와 같은 말이라 빼고 한 줄을 다 쓴다 */
    .hm-cfield.hm-cfield-attach { grid-template-columns: minmax(0, 1fr); }
    .hm-cfield-attach > label { display: none; }

    /* 주소록 고르기·미리보기: 화면 전체. 단추는 위로 — 찾기 칸을 누르면 키보드가 아래 절반을 덮는다 */
    .hm-modal.hm-pick-modal, .hm-modal.hm-preview-modal {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        transform: none;
        width: auto;
        max-width: none;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        padding: calc(8px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
                 calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    }
    .hm-pick-modal > .hm-modal-actions {
        order: -1;
        align-items: center;
        margin: 0;
        padding-bottom: 8px;
        border-bottom: 1px solid #e3e8ef;
    }
    .hm-pick-modal .hm-modal-actions .hm-btn, .hm-preview-modal .hm-modal-actions .hm-btn { min-height: 40px; padding: 0 16px; }
    .hm-pick-head { flex-wrap: wrap; gap: 6px 10px; }
    .hm-pick-head .hm-move-select { min-height: 40px; max-width: 100%; }
    .hm-pick-search { min-height: 44px; }
    .hm-pick-list { min-height: 0; }
    .hm-pick-sec { padding: 8px 12px; }
    .hm-pick-row { flex-wrap: wrap; gap: 2px 10px; padding: 10px 12px 10px 16px; }
    .hm-pick-mail { min-width: 0; overflow-wrap: anywhere; font-size: .82rem; }
    /* 미리보기: [닫기]는 제목 줄 오른쪽, 본문은 남는 높이를 모두(안쪽 55vh 제한 없음) */
    .hm-preview-modal > h3 { display: flex; align-items: center; min-height: 40px; padding-right: 90px; }
    .hm-preview-modal > .hm-modal-actions {
        position: absolute;
        top: calc(8px + env(safe-area-inset-top, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
        margin: 0;
    }
    .hm-preview-meta b { width: 64px; }
    .hm-preview-modal .hm-preview-body { flex: 1; min-height: 0; max-height: none; overflow-wrap: anywhere; }
    .hm-preview-body img { height: auto; }
}

/* ═══ 휴대폰: 그 밖의 화면 (주소록·설정·예약 메일·EML 보기·관리자·시스템 관리·스팸 관리·메일 감사·수신 현황 표) ═══
   표: 예전엔 좁은 화면의 모든 표를 통째로 옆으로 미는 상자로 만들었다(.hm-table{display:block}) — 그러면 [수정]·[삭제]·[취소]가
   화면 오른쪽 밖으로 나가고, 한글은 한두 글자씩 세로로 깨지고, 머리줄 고정·고정 폭 배치가 풀렸다. 그 규칙을 지우고 표마다
   · 직원이 쓰는 표(주소록·전체 직원·예약 메일·설정 목록·수신 현황): 600px 이하에서 카드(.hm-cards — 줄 하나 = 카드 한 장)
   · 넓은 관리 표: <div class="hm-table-scroll"> 상자 안에서만 옆으로(표는 표 그대로)
   · 메일 읽기의 스팸 사유·DMARC 표는 .hm-vtable(메일 읽기 구역), 메일 감사 목록은 .hm-audit-tablewrap 이 이미 스크롤 상자.
   위쪽 가로 탭 줄(설정·주소록·관리): 오른쪽 끝을 흐리게(더 있다는 표시), 누른 탭은 줄 안에 다 보이게(js/mobile.js) /
   주소록 하위 칩은 들여쓰기·• 없이 보고 있는 쪽 것만 / 전화번호는 눌러서 걸기 / 관리 화면의 넓은 입력 칸은 화면 폭 안에서 /
   EML 보기 본문은 화면 폭 맞춤·높이 제한 없음.
   PC 에 닿는 규칙은 '바탕'뿐이고 예전 모습을 그대로 두는 규칙이다 */

/* ── 바탕 (모든 화면) ── */
/* 넓은 관리 표를 감싼 상자: PC 에서는 표만 있던 때와 똑같이 — 왼쪽 정렬 세로 flex 상자(.hm-settings-sec) 안에서도 폭을 다 쓴다
   (표는 width:100% 라 예전에도 폭을 다 썼다. 감싼 상자가 내용 폭으로 줄면 표도 따라 준다) */
.hm-table-scroll { align-self: stretch; }
/* 관리 화면의 넓은 입력 칸: PC 는 예전 인라인 최소 폭(style="--hm-minw:280px")을 그대로 */
.hm-w-wide { min-width: var(--hm-minw, 0px); }

/* ── 터치 화면 (휴대폰·태블릿 — 마우스 PC 는 해당 없음) ── */
@media (hover: none) {
    /* 탭 칩: 누른 뒤 남는 :hover 색 */
    .hm-set-nav li:not(.active):hover { background: none; }
    /* 스팸 관리 날짜별 막대: 숫자 풍선이 마우스를 올려야 떠서 — 막대를 누르면(포커스) 그날 숫자 */
    .hm-sp-col:focus { background: rgba(44, 90, 160, .06); }
    .hm-sp-col:focus .hm-sp-tip { display: block; }
}
@media (pointer: coarse) {
    /* 손가락 크기: 설정·주소록·예약 메일·관리 화면의 단추·입력 칸 40px, 체크박스 20px */
    .hm-set-content .hm-btn, .hm-page .hm-btn,
    .hm-set-content .hm-btn-sm, .hm-rc-modal .hm-btn, .hm-rc-modal .hm-btn-sm { min-height: 40px; }
    .hm-sig-tools .hm-btn { min-width: 40px; }
    .hm-set-content a.hm-btn, .hm-page a.hm-btn { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
    .hm-set-content .hm-contact-add input, .hm-set-content .hm-inline-input, .hm-set-content .hm-move-select,
    .hm-set-content .hm-search, .hm-set-content .hm-input { min-height: 40px; box-sizing: border-box; }
    .hm-set-content .hm-check input[type="checkbox"], .hm-set-content .hm-check input[type="radio"] {
        flex: none;
        width: 20px;
        height: 20px;
        margin: 0;
        accent-color: #2c5aa0;
    }
    .hm-set-content label.hm-check { min-height: 36px; }
    /* 별칭·메일링 리스트 메모(2026-10-13)의 '＋ 메모'·✏️: 글자 크기 그대로 두고 누르는 자리만 넓힌다(줄 높이가 바뀌지 않게) */
    .hm-memo-btn, .hm-memo-add { position: relative; }
    .hm-memo-btn::after, .hm-memo-add::after { content: ""; position: absolute; inset: -10px -8px; }
}

@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
    /* ── 넓은 관리 표: 이 상자 안에서만 옆으로. 한글은 낱말 단위로만 줄을 바꾸고(한두 글자씩 세로로 깨지지 않게) 단추는 한 줄로 ── */
    .hm-table-scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
    .hm-table-scroll > .hm-table { word-break: keep-all; }
    .hm-table-scroll .hm-cell-actions { flex-wrap: nowrap; }
    /* 고정 폭 배치 표(스팸 처리 내역)는 폭을 정해 두어야 보낸 사람·받는 사람·제목 칸이 찌그러지지 않는다(넘치는 글은 …) */
    .hm-table.hm-sp-events { min-width: 640px; }
    /* 스팸 관리 처리 내역·직원 신고·개인 목록의 검색 칸 */
    .hm-sp-filters .hm-search { flex: 1 1 140px; min-width: 0; }

    /* 카드로 바뀌기 전 폭(601~820px — 가로로 돌린 휴대폰·작은 태블릿)에서는 표 그대로: 긴 주소가 표를 화면보다 넓히지 않게 */
    .hm-table.hm-cards td { overflow-wrap: anywhere; }
    /* 설정 > 자동 분류 표도 마찬가지(한 장씩 보기는 600px 이하) — 긴 주소 조건이 표를 넓혀 설정 화면 전체가 옆으로 밀리고 ▲▼·[삭제]가 화면 밖에 있었다 */
    .hm-filter-table td { overflow-wrap: anywhere; }

    /* 전화번호: 눌러서 걸기 (PC 는 같은 자리의 글자 — hm-d-only) */
    .hm-tel { display: inline; }

    /* ── 위쪽 가로 탭 줄 (설정·주소록·관리자·시스템 관리) ── */
    .hm-set-nav { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
    .hm-set-nav ul { width: max-content; min-width: 100%; }
    /* 오른쪽 끝 흐림: 줄 끝의 빈 조각이 화면 오른쪽 끝에 달라붙어(sticky) 뒤의 칩을 흐리게 덮는다 —
       끝까지 밀면 제자리(마지막 칩 뒤 빈칸)로 돌아가 사라지고, 칩이 다 들어가는 넓은 화면에서도 빈칸 위라 보이지 않는다 */
    .hm-set-nav ul::after {
        content: "";
        position: sticky;
        right: 0;
        flex: 0 0 28px;
        background: linear-gradient(to right, rgba(247, 249, 251, 0), #f7f9fb 85%);
        pointer-events: none;
    }
    .hm-set-nav li {
        display: flex;
        align-items: center;
        min-height: 40px;
        box-sizing: border-box;
        padding: 0 12px;
        border-radius: 20px;
        scroll-margin-inline: 40px;   /* 누른 탭을 줄 안으로 밀 때 옆 칩이 조금 보이게(js/mobile.js) */
    }
    /* 주소록 하위 칩(그룹·부서): PC 의 들여쓰기 34px 와 • 가 칩 안에 그대로 남던 문제(.hm-set-nav li.hm-set-sub 가 위 칩 규칙보다
       강했다). 얇은 테두리·작은 글씨로 앞의 '개인 주소록'·'전체 직원'에 딸린 칩임을 보인다 */
    .hm-set-nav li.hm-set-sub { padding-left: 12px; font-size: .86rem; box-shadow: inset 0 0 0 1px #d5dde7; }
    .hm-set-nav li.hm-set-sub::before { content: none; }
    .hm-set-nav li.hm-set-sub.active { box-shadow: none; }
    /* 보고 있는 쪽의 하위 칩만 — 개인 주소록이면 그룹, 전체 직원이면 부서 (긴 줄 하나에 모두 섞이지 않게) */
    .hm-nav-personal li.hm-sub-d, .hm-nav-dir li.hm-sub-g { display: none; }
    /* 관리자: 관리 대상 도메인 표시 (PC 는 제목 아래 — 휴대폰은 제목이 없어 칩 줄 위에 작게) */
    .hm-set-nav .hm-scope-domain { display: inline-block; margin: 0 0 6px; font-size: .8rem; }

    /* ── 설정·관리 화면 ── */
    .hm-settings-sec { padding: 14px 12px; }
    .hm-brand-preview { min-width: 0; max-width: 100%; box-sizing: border-box; padding: 10px; }
    .hm-brand-preview img { max-width: 100%; }
    /* 넓은 입력 칸(회사명·연결 URL·발송 잠금 예외 계정·안내문): 칸 이름 아래 줄에 화면 폭만큼(최대 520px) */
    .hm-check-wide { align-self: stretch; flex-wrap: wrap; }
    .hm-check-wide > span { flex: 1 1 100%; min-width: 0; }
    .hm-w-wide { min-width: 0; width: min(100%, 520px); }
    /* 부재중 기간: 날짜 두 칸은 손가락 높이로, 좁으면 줄여 한 줄에(그래도 넘치면 '기간' 아래 줄로) — [기간 지우기]는 들어가면 옆, 아니면 다음 줄 */
    .hm-vac-period { align-self: stretch; }
    .hm-vac-dates { flex: 0 1 auto; min-width: 0; }
    .hm-vac-dates input { flex: 1 1 0; min-width: 0; max-width: 200px; height: 40px; box-sizing: border-box; }
    /* 서명 편집기 링크 칸(2026-10-13): 무엇에 거는지 · 주소 칸(한 줄을 다 쓴다, 손가락 높이) · [확인][링크 빼기][✕] 세 줄로 */
    .hm-sig-linkfor { flex: 1 0 100%; }
    .hm-sig-linkrow .hm-tb-linkinput { flex: 1 1 100%; max-width: none; min-height: 40px; box-sizing: border-box; }
    /* 별칭·메일링 리스트 메모 글 상자(2026-10-13): 좁은 화면에서는 칸 폭에 맞춘다(PC 의 최소 폭 220px 없이) */
    .hm-memo-input { min-width: 0; }
    .hm-alias-table .hm-memo-cell { width: 30%; }   /* 표로 보이는 601~820px: 주소 칸이 덜 깨지게 (600px 이하는 카드) */

    /* ── EML 보기: 본문 높이 제한(60vh)과 안쪽 스크롤 없이 페이지 하나만 스크롤, 넓은 내용만 본문 상자 안에서 옆으로 ── */
    .hm-eml-view .hm-body { max-height: none; overflow-x: auto; overflow-y: hidden; }
    .hm-eml-view .hm-view-head h2 { font-size: 1.05rem; line-height: 1.4; overflow-wrap: anywhere; }
    .hm-eml-view .hm-view-meta { overflow-wrap: anywhere; }
    .hm-eml-filename, .hm-eml-view .hm-attachment { max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }
    .hm-eml-view .hm-imgblock { flex-wrap: wrap; row-gap: 6px; }
    .hm-eml-view .hm-imgblock .hm-btn { min-height: 40px; }

    /* ── 수신 현황 창: 받는 사람이 많으면 목록 상자가 다른 줄을 눌러 제목 줄이 몇 px 로 찌그러졌다 — 목록 상자만 줄어들게 ── */
    .hm-rc-modal > .hm-pick-head, .hm-rc-modal > .hm-rc-subject, .hm-rc-modal > .hm-rc-bar { flex-shrink: 0; }
}

/* ── 표 → 카드 (.hm-table.hm-cards, 600px 이하) ──
   [주 항목(hm-c-main) ……… 단추(hm-c-act)]   ← 첫 줄
   이름표  값                                    ← 나머지 칸마다 한 줄(data-label). 빈 칸은 숨긴다(hm-c-none 도)
   주소처럼 긴 값은 화면 안에서 줄을 바꾼다. .hm-cards-list = 값 하나 + 단추 하나인 목록(스팸 허용·거부 등) */
@media (max-width: 600px) {
    .hm-table.hm-cards, .hm-table.hm-cards > tbody { display: block; }
    .hm-table.hm-cards > thead { display: none; }
    .hm-table.hm-cards > tbody > tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 10px;
        padding: 10px 2px;
        border-bottom: 1px solid #eef1f5;
    }
    .hm-table.hm-cards > tbody > tr > td {
        display: block;
        flex: 1 1 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 0;
        border: none;
        line-height: 21px;
        overflow-wrap: anywhere;
    }
    .hm-table.hm-cards > tbody > tr > td:empty:not(.hm-c-main) { display: none; }
    .hm-table.hm-cards > tbody > tr > td[data-label] { position: relative; padding-left: 68px; }
    .hm-table.hm-cards > tbody > tr > td[data-label]::before {
        content: attr(data-label);
        position: absolute;
        top: 0;
        left: 0;
        width: 62px;
        color: #6b7684;
        font-size: .78rem;
        line-height: 21px;
        white-space: nowrap;
    }
    .hm-table.hm-cards > tbody > tr > td.hm-c-main { order: -2; flex: 1 1 0; font-weight: 600; color: #1d2430; }
    .hm-table.hm-cards > tbody > tr > td.hm-c-act {
        order: -1;
        flex: 0 0 auto;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
    }
    /* 단추가 없는 단추 칸(수신 현황의 '-')은 카드에서 뺀다 — 위 hm-c-act 의 display 보다 뒤에 둔다 */
    .hm-table.hm-cards > tbody > tr > td.hm-c-none { display: none; }
    /* 단추 칸이 첫 줄이 아니면(고치는 중인 줄) 맨 아래 오른쪽 */
    .hm-table.hm-cards > tbody > tr > td.hm-cell-actions:not(.hm-c-act) { display: flex; justify-content: flex-end; gap: 6px; padding-top: 4px; }
    /* 값 하나 + 단추 하나인 목록: 한 줄로, 값은 굵지 않게 */
    .hm-table.hm-cards.hm-cards-list > tbody > tr { flex-wrap: nowrap; padding: 6px 2px; }
    .hm-table.hm-cards.hm-cards-list > tbody > tr > td.hm-c-main { font-weight: 400; color: inherit; }
    /* 주소록에서 고치는 중인 연락처: 칸마다 [이름표][입력 칸] */
    .hm-table.hm-cards > tbody > tr.hm-c-editing { padding: 10px 8px; background: #f5f8fc; border-radius: 8px; }
    .hm-table.hm-cards > tbody > tr.hm-c-editing > td[data-label]::before { top: 50%; transform: translateY(-50%); }
    /* 설정 → 서명에서 [고치기] 중인 서명: 카드째 연한 파랑(칸 사이 틈까지) */
    .hm-table.hm-cards > tbody > tr.hm-sig-editing { padding: 10px 8px; background: #eef5fd; border-radius: 8px; }
    /* 관리자 → 별칭에서 메모를 고치는 중인 카드(2026-10-13): '메모' 이름표는 위에, 글 상자·[저장][취소]는 카드 폭을 다 쓴다 */
    .hm-table.hm-cards > tbody > tr.hm-c-editing > td.hm-memo-cell { padding-left: 0; padding-top: 22px; }
    .hm-table.hm-cards > tbody > tr.hm-c-editing > td.hm-memo-cell::before { top: 0; transform: none; }
    /* 수신 현황 창: 카드가 테두리 상자 안이라 좌우 여백을 준다 */
    .hm-rc-tablewrap .hm-table.hm-cards > tbody > tr { padding: 10px; }

    /* 주소록: 추가 입력 칸은 '＋ 연락처 추가'를 눌렀을 때만 */
    .hm-ca-toggle { display: inline-flex; align-items: center; }
    .hm-ca-form:not(.hm-open) { display: none; }
}

/* ═══ 휴대폰: 로그인·계정 신청·비밀번호 변경·홈 화면에 추가 ═══
   로그인·계정 신청: 화면 높이(100vh)에 가두지 않는다 — 키보드가 열리거나 가로로 돌려도 내려서 [로그인]까지 닿게. 카드 여백은 좁은 화면에 맞게.
   홈 화면에 추가 안내(#hm-a2hs, 로그인 카드 아래): js/login.js 가 기기·브라우저를 보고 <html data-hm-a2hs="…"> 를 정한다
   (prompt = [홈 화면에 추가] 단추, ios·samsung·android = 그 브라우저 메뉴에서 추가하는 방법, inapp = 앱 안의 화면, done = 추가함).
   값은 터치 기기에서만 붙으므로 그 규칙은 화면 폭 조건 없이 둔다(가로로 놓은 태블릿도 보이게). PC 는 값이 없어 예전 그대로다 */

/* ── 바탕: 안내는 기본 숨김 ('휴대폰 화면으로' 단추는 셸 구역의 .hm-tomobile-btn 이 숨김) ── */
.hm-a2hs, .hm-a2hs-install, .hm-a2hs-how { display: none; }

/* ── 홈 화면에 추가 안내 (터치 기기의 로그인 화면) ── */
html[data-hm-a2hs] .hm-login-wrap { flex-direction: column; gap: 14px; }
html[data-hm-a2hs] .hm-a2hs { display: block; }
html[data-hm-a2hs="prompt"] .hm-a2hs-install { display: flex; }
html[data-hm-a2hs="ios"] .hm-a2hs-ios,
html[data-hm-a2hs="samsung"] .hm-a2hs-samsung,
html[data-hm-a2hs="android"] .hm-a2hs-android,
html[data-hm-a2hs="inapp"] .hm-a2hs-inapp,
html[data-hm-a2hs="done"] .hm-a2hs-done { display: block; }
html[data-hm-a2hs="done"] .hm-a2hs-lead { display: none; }
/* 홈 화면 아이콘으로 열었으면 늘 숨김 (스크립트가 늦게 돌아도) */
@media (display-mode: standalone) {
    .hm-a2hs { display: none !important; }
}
.hm-a2hs {
    width: min(460px, 92vw);
    box-sizing: border-box;
    padding: 10px 12px 14px 16px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: .9rem;
    line-height: 1.55;
}
.hm-a2hs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hm-a2hs-title { margin: 0; font-size: 1rem; font-weight: 700; }
.hm-a2hs-close {
    flex: none;
    width: 40px;
    height: 40px;
    margin: -4px -4px -4px 0;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: none;
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
}
.hm-a2hs-close:active { background: rgba(255, 255, 255, .18); }
/* 한글은 낱말 중간에서 줄을 바꾸지 않게 */
.hm-a2hs p { margin: 4px 0 0; word-break: keep-all; overflow-wrap: anywhere; }
.hm-a2hs-lead { color: rgba(255, 255, 255, .88); }
.hm-a2hs b { font-weight: 700; }
.hm-a2hs small { display: block; margin-top: 2px; color: rgba(255, 255, 255, .85); font-size: .82rem; }
.hm-a2hs-note { color: rgba(255, 255, 255, .85); font-size: .82rem; }
.hm-a2hs-install {
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #2c5aa0;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}
.hm-a2hs-install:active { background: #e6edf7; }

/* ── 'PC 화면으로 보기'를 켠 휴대폰의 로그인 화면: 휴대폰 화면으로 돌아오는 단추 ──
   모양은 상단바의 같은 단추(.hm-tomobile-btn — 화면을 1280 폭으로 그려 크게 키운 단추). 로그인 카드를 가리지 않게 오른쪽 위에 */
@media (pointer: coarse) {
    html.hm-desktop-forced .hm-login-tomobile { position: fixed; top: 24px; right: 24px; z-index: 10; }
}

/* ── 터치 화면: 누르는 크기 ── */
@media (pointer: coarse) {
    .hm-login-box button[type="submit"] { min-height: 46px; }
    .hm-login-links { flex-wrap: wrap; gap: 0 12px; margin-top: 0; }
    .hm-login-links a, .hm-login-links button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 6px; }
    .hm-login-account { display: inline-flex; align-items: center; min-height: 40px; }
    .hm-apply-link { padding: 10px 0; margin-top: 0; }
    .hm-captcha-row .hm-btn { min-width: 44px; min-height: 44px; }
    .hm-pwchange-actions { flex-wrap: wrap; }
    .hm-pwchange-card .hm-btn { min-height: 44px; padding: 0 16px; }
    .hm-pwchange-card .hm-input { min-height: 44px; }
}

@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
    /* 100vh 높이에 가두면 키보드가 열렸을 때 [로그인]이 키보드 밑에 남는다 — 내용만큼 늘어나 내려 볼 수 있게.
       아이폰 노치·홈 바(홈 화면 앱으로 열면 화면 끝까지 쓴다)는 안전 여백으로 피한다 */
    .hm-login-wrap, .hm-apply-wrap {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        box-sizing: border-box;
        padding: max(16px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
                 max(16px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    }
    .hm-login-box { max-width: 100%; }
    /* 넓은 로그인 로고가 카드 밖으로 넘치지 않게 */
    .hm-login-logo img { max-width: 100%; }
    /* 아이디 줄: 긴 도메인은 … 로 줄여 아이디 칸 자리를 남긴다(누르면 직접 입력 칸으로 바뀐다) */
    .hm-idrow #hm-dom-text { min-width: 0; max-width: 62%; overflow: hidden; text-overflow: ellipsis; }
    .hm-login-account { max-width: 100%; overflow-wrap: anywhere; }
    /* 계정 신청의 아이디 줄: 입력 칸이 제 기본 폭(16px 글자라 넓다)을 고집하면 줄이 화면 밖으로 밀린다 — 칸이 줄고, 긴 도메인은 … */
    .hm-apply-idrow input { min-width: 0; }
    .hm-apply-domain { min-width: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
    /* 비밀번호 변경 안내: 위쪽 60px 여백을 줄여 입력 칸이 키보드 위에 오게 */
    .hm-pwchange-wrap { padding: 16px 12px; }
}
@media (max-width: 480px) {
    .hm-login-box { padding: 28px 20px; }
    .hm-apply-box { padding: 22px 16px; }
    .hm-pwchange-card { padding: 20px 16px; }
}
/* 가로로 돌린 휴대폰: 카드 위아래 여백을 줄여 한 화면에 더 들어오게 */
@media (max-height: 500px) and (pointer: coarse) {
    .hm-login-box { padding-top: 20px; padding-bottom: 20px; gap: 10px; }
}

/* ═══ 휴대폰: 태블릿·중간 폭 (821~1100px 터치 화면) ═══
   iPad 세로(834px)·12.9인치 세로(1024px)처럼 폭이 820px 를 넘는 터치 화면은 PC 배치를 그대로 써서
   레일 64 + 메일함 목록 230 + 행의 고정 칸이 자리를 다 차지해 제목 칸이 75px(한글 4~5자)뿐이었다.
   레일은 아이콘만(52px), 메일함 목록 190px, 크기 칸을 빼고 날짜는 짧게(휴대폰 목록과 같은 '오늘 14:05 · 올해 10-03 · 그 전 25-12-30')
   → 834px 에서 제목 칸 약 260px. 손가락으로 누르는 체크·별표 칸과 행 높이도 키운다.
   - 마우스 PC 는 창을 이 폭으로 줄여도 해당 없음(pointer: coarse) — PC 화면은 예전 그대로.
   - 가로로 돌린 휴대폰(높이 500px 이하)은 휴대폰 화면 규칙이 맡으므로 뺀다(min-height: 501px).
   - 인쇄는 해당 없음(screen) — 인쇄 규칙이 따로 있다 */
@media screen and (min-width: 821px) and (max-width: 1100px) and (min-height: 501px) and (pointer: coarse) {
    /* ── 왼쪽 레일: 아이콘만, 칸 가운데 ──
       이름표는 눈에만 숨긴다(display:none 이면 화면 읽기 프로그램이 링크 이름을 잃는다) */
    .hm-rail { width: 52px; }
    .hm-rail a { position: relative; justify-content: center; padding-top: 0; }
    .hm-rail-ico { font-size: 1.3rem; }
    .hm-rail-label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    /* ── 메일함 목록 190px ──
       목록·본문 칸은 minmax(0, 1fr): 줄지 않는 내용(대화 행의 긴 제목, 폭이 고정된 뉴스레터)이 칸을 넓혀
       화면이 옆으로 밀리지 않고 칸 안에서 줄거나(…) 본문 상자 안에서 옆으로 스크롤되게 */
    .hm-mail { grid-template-columns: 190px minmax(0, 1fr); }
    /* 메일 쓰기·내게 쓰기: 좁아진 칸에서 '내게 쓰기'가 두 줄로 깨지지 않게 글자 폭을 기준으로 나눈다(메일 쓰기가 조금 더 넓게) */
    .hm-side-btns { padding-left: 10px; padding-right: 10px; }
    .hm-compose-btn, .hm-tome-btn { flex-basis: auto; padding-left: 2px; padding-right: 2px; white-space: nowrap; }
    .hm-folders li { padding-left: 12px; padding-right: 10px; }
    .hm-quick li { padding-left: 14px; padding-right: 10px; }
    /* 긴 메일함 이름은 … 로 줄여 개수·⋮·비우기 자리를 남긴다 */
    .hm-folders .hm-folder-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* 하위 메일함: 서랍과 같이 상위 아래로 들여 쓰고 자기 이름만 ('상위.' 경로는 숨김) */
    .hm-folders li.hm-folder-nested { padding-left: calc(12px + var(--depth, 0) * 16px); }
    .hm-folder-nested .hm-folder-path { display: none; }
    /* 내 메일함 ⋮ 메뉴: 목록 상자 밖은 잘려 보이지 않으므로 메뉴 폭을 목록 폭에 맞춘다(긴 항목은 낱말 단위로 줄바꿈) */
    .hm-folder-menu { left: 4px; right: 4px; min-width: 0; }
    .hm-folder-menu button { padding-left: 10px; padding-right: 10px; font-size: .9rem; white-space: normal; word-break: keep-all; }

    /* ── 메일 행: [체크 40][★ 36][봉투][보낸 사람 130][📎][제목][날짜 72] — 크기 칸 없음 ──
       체크·별표는 칸 전체(행 높이 44px)를 누르는 자리로 */
    .hm-row {
        grid-template-columns: 40px 36px 22px 130px 20px minmax(0, 1fr) 72px;
        height: 44px;
        padding: 0 10px 0 0;
    }
    .hm-row > .hm-row-size { display: none; }
    .hm-row > .hm-row-chk { align-self: stretch; justify-content: center; }
    .hm-row > .hm-star { align-self: stretch; display: flex; align-items: center; justify-content: center; }
    /* 대화 행: 길이가 다른 짧은 날짜(14:05 / 25-12-30)도 칸 폭을 맞춰 제목 끝이 들쭉날쭉하지 않게 */
    .hm-trow { height: 44px; }
    .hm-trow .hm-row-from { flex-basis: 130px; }
    .hm-trow > .hm-row-date { flex: 0 0 62px; }
    /* 짧은 날짜 — 수신 확인 목록의 날짜 칸(.hm-rc-date, 짧은 표기가 따로 없다)은 건드리지 않게 메일·대화 행에만 */
    .hm-row > .hm-row-date .hm-d-full, .hm-trow > .hm-row-date .hm-d-full { display: none; }
    .hm-row > .hm-row-date .hm-d-rel, .hm-trow > .hm-row-date .hm-d-rel { display: inline; }

    /* ── 수신 확인 목록: 메일 행과 같이 체크 칸 40px·행 높이 44px (칸 구성은 PC 와 같다) ── */
    .hm-rc-row { grid-template-columns: 40px 170px 22px minmax(0, 1fr) 108px 130px 84px; padding: 0 10px 0 0; }
    .hm-rc-row:not(.hm-rc-head) { height: 44px; }
    .hm-rc-row > .hm-row-chk { align-self: stretch; justify-content: center; }
}
/* 같은 터치 구간의 1000px 이하: 보낸 시각 칸이 빠진 배치(위 '중간 폭' 규칙)에 체크 칸 40px 만 바꿔 적용 */
@media screen and (min-width: 821px) and (max-width: 1000px) and (min-height: 501px) and (pointer: coarse) {
    .hm-rc-row { grid-template-columns: 40px 140px 22px minmax(0, 1fr) 120px 80px; }
}

/* ═══ 휴대폰: 메일 메모 (2026-10-16) — 읽기 화면의 [📝 메모]·메모 띠·입력 칸을 손가락 크기로 ═══
   제목 줄은 위로 붙여 놓는다(휴대폰 규칙 align-items:flex-start) — [📝 메모]도 제목 첫 줄 높이에. 메모 줄은 별표 자리(40px 에서 음수 여백을 뺀 22px + 사이 8px)만큼 들여 쓴다.
   입력 칸은 한 줄 전체, 단추는 그 아래 줄(40px). 글자 크기는 터치 화면 공통 규칙(16px — 아이폰 확대 방지) */
@media screen and (max-width: 820px), screen and (max-height: 500px) and (pointer: coarse) {
    .hm-mail .hm-mmemo-add { position: relative; align-self: flex-start; margin-top: 1px; min-height: 26px; }
    .hm-mail .hm-mmemo-add::after { content: ""; position: absolute; inset: -8px -6px; }   /* 누르는 자리를 넓힌다(보이는 크기는 그대로) */
    .hm-mail .hm-mmemo-line { padding-left: 30px; }
    .hm-mail .hm-mmemo-view { min-height: 36px; padding: 6px 10px; }
    .hm-mail .hm-mmemo-input { flex-basis: 100%; max-width: none; min-height: 40px; }
    .hm-mail .hm-mmemo-bar .hm-btn { min-height: 40px; }
}

/* ── 메일 본문 그림 크게 보기 (2026-11-12, js/imgview.js) ──
   본문(.hm-body)의 그림을 누르면 화면 가득. 크게 볼 수 있는 그림에만 돋보기 모양(마우스를 올릴 때 imgview.js 가 hm-zoomable 을 단다) */
.hm-body img.hm-zoomable { cursor: zoom-in; }
.hm-imgview {
    position: fixed; inset: 0; z-index: 5000;
    display: none; flex-direction: column;
    background: rgba(15, 18, 24, .96); color: #fff;
}
.hm-imgview.open { display: flex; }
.hm-imgview:focus { outline: none; }
.hm-imgview-bar {
    flex: none; display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
}
.hm-imgview-count { flex: none; font-size: .9rem; font-variant-numeric: tabular-nums; opacity: .85; }
.hm-imgview-cap { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; opacity: .75; }
.hm-imgview button {
    min-height: 36px; padding: 4px 12px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 6px;
    background: rgba(255, 255, 255, .12); color: #fff; font: inherit; font-size: .88rem; cursor: pointer;
}
.hm-imgview button:hover, .hm-imgview button:focus-visible { background: rgba(255, 255, 255, .26); outline: none; border-color: #fff; }
.hm-imgview button[hidden] { display: none; }
.hm-imgview-close { min-width: 40px; font-size: 1.05rem !important; }
.hm-imgview-stage {
    flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
    display: flex; align-items: center; justify-content: center;
    padding: 4px 60px 24px; padding-bottom: max(24px, env(safe-area-inset-bottom));
}
/* 흰 바탕 — 글자가 검은 투명 PNG(로고 등)도 어두운 바탕에서 보이게 */
.hm-imgview-img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; box-shadow: 0 6px 28px rgba(0, 0, 0, .55); cursor: zoom-in; user-select: none; }
.hm-imgview.nozoom .hm-imgview-img { cursor: default; }
.hm-imgview.actual .hm-imgview-stage { display: block; }
.hm-imgview.actual .hm-imgview-img { display: block; max-width: none; max-height: none; margin: 0 auto; cursor: zoom-out; }
.hm-imgview-prev, .hm-imgview-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 46px; height: 68px; padding: 0 !important; font-size: 2rem !important; line-height: 1;
}
.hm-imgview-prev { left: 8px; }
.hm-imgview-next { right: 8px; }
html.hm-imgview-open, html.hm-imgview-open body { overflow: hidden; }
@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
    .hm-imgview-stage { padding: 2px 2px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
    .hm-imgview button { min-height: 40px; }
    .hm-imgview-prev, .hm-imgview-next { width: 40px; height: 56px; background: rgba(0, 0, 0, .4); }
    .hm-imgview-prev { left: 4px; }
    .hm-imgview-next { right: 4px; }
}
@media print { .hm-imgview { display: none !important; } }
