/* eBizMail — 새 웹메일 기본 스타일. 외부 글꼴·스크립트 없이 (CSP 'self') */
:root {
    --fg: #393939;
    --dim: #6a6767;
    --line: #e3e3e3;
    --accent: #ba0000;
    --btn: #393939;
    --error: #d10000;
    --card: #fff;
    --bg: #f5f5f5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font: 16px/1.5 "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, "Segoe UI", system-ui, sans-serif;
    color: var(--fg);
    background: var(--bg);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.dim { color: var(--dim); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- 로그인 */

body.login-bg {
    background: #2a2a2a url(../img/ebizmail_bg.png) center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.login { width: 100%; max-width: 500px; }

.login-top { color: #ccc; font-weight: 700; font-size: 14px; margin-bottom: 10px; }

.login-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 48px 24px;
    background: var(--card);
}

.logo { font-size: 44px; font-weight: 700; line-height: 1.1; }

.login-box { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 300px; }

.login-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    font: inherit;
    color: inherit;
}
.login-box input:focus { outline: 2px solid #9ab; outline-offset: 0; border-color: transparent; }

.login-box .error { color: var(--error); font-size: 13px; text-align: center; }

.login-btn {
    padding: 11px;
    border: 0;
    background: var(--btn);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.login-btn:hover, .login-btn:focus-visible { opacity: .85; }

.lang-box { width: 100%; max-width: 300px; padding: 18px; border: 1px solid #ccc; border-radius: 5px; }
.lang-title { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-weight: 700; }
.lang-box ul { display: flex; flex-direction: column; gap: 2px; }
.lang-box a {
    display: block;
    padding: 6px 12px;
    border-radius: 5px;
    background: #efefef;
    font-size: 13px;
}
.lang-box a:hover, .lang-box a:focus-visible { background: #ddd; color: #0044cc; }
.lang-box a.on { background: #393939; color: #fff; }

.login-notice {
    margin: 24px auto 0;
    width: fit-content;
    max-width: 100%;
    font-size: 12px;
    color: #eee;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.login-notice li::before { content: "* "; }
.login-notice .dim { color: #ccc; }

.copy { display: block; margin-top: 24px; font-size: 12px; color: #bbb; text-align: center; }
.copy:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- 메일 화면 */

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; font-size: 18px; margin-right: auto; }
.topbar .who { color: var(--dim); font-size: 14px; overflow-wrap: anywhere; }

form.inline { display: inline; }
.link-btn { border: 0; background: none; font: inherit; font-size: 14px; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

.content { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.content h1 { font-size: 20px; margin-bottom: 12px; }

/* ---------------------------------------------------------------- 안내 페이지 */

.notice-page { max-width: 560px; margin: 80px auto; padding: 0 16px; }
.notice-page h1 { font-size: 22px; margin-bottom: 12px; }
.notice-page p { margin-bottom: 8px; }
.notice-page a { color: var(--accent); }

@media (max-width: 480px) {
    .login-card { padding: 36px 16px; }
    .logo { font-size: 36px; }
}

/* ---------------------------------------------------------------- 메일함 */

.mail-layout { display: flex; min-height: calc(100vh - 49px); }

.folders { flex: 0 0 200px; background: #fff; border-right: 1px solid var(--line); padding: 12px 8px; }
.folders a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 14px;
}
.folders a:hover, .folders a:focus-visible { background: #f0f0f0; }
.folders a.on { background: #393939; color: #fff; font-weight: 700; }
.folders .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folders li.custom:first-of-type, .folders li:not(.custom) + li.custom { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.badge { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.folders a.on .badge { background: #fff; color: var(--accent); }

.mail-main { flex: 1; min-width: 0; padding: 16px; }
.list-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.list-head h1 { font-size: 18px; }
.list-head .summary { color: var(--dim); font-size: 13px; }
.empty { padding: 40px 0; text-align: center; }

.mail-list { width: 100%; border-collapse: collapse; background: #fff; table-layout: fixed; font-size: 14px; }
.mail-list th, .mail-list td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-list th { font-size: 13px; color: var(--dim); font-weight: 600; background: #fafafa; }
.mail-list th a:hover { text-decoration: underline; }
.mail-list tr.unread td { font-weight: 700; }
.mail-list tbody tr:hover { background: #f7f9fc; }
.c-flag { width: 64px; }
.c-party { width: 24%; }
.c-size { width: 70px; text-align: right !important; }
.c-date { width: 110px; }
.mail-list .deleted { text-decoration: line-through; }
.mail-list .approved { text-decoration: underline; }

.st { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.st.new { background: #1a73e8; }
.st.old { background: transparent; border: 1px solid #ccc; }
.st.re { background: #0a7a35; }
.st.fwd { background: #b06000; }
.pri { font-weight: 700; margin-right: 2px; }
.pri.hi { color: var(--error); }
.pri.lo { color: #888; }
.att { font-size: 12px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 0; font-size: 14px; }
.pager a { color: var(--accent); }
.pager a:hover { text-decoration: underline; }
.pager .pos { color: var(--dim); }

@media (max-width: 760px) {
    .mail-layout { flex-direction: column; }
    .folders { flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
    .folders ul { display: flex; flex-wrap: wrap; gap: 4px; }
    .folders li.custom:first-of-type, .folders li:not(.custom) + li.custom { margin-top: 0; border-top: 0; padding-top: 0; }
    .c-size, .c-flag { display: none; }
    .c-party { width: 35%; }
    .c-date { width: 90px; }
}
/* ---------------------------------------------------------------- 메일 읽기 */

.mail-list a.subj { display: block; overflow: hidden; text-overflow: ellipsis; }
.mail-list a.subj:hover { text-decoration: underline; }

.read { max-width: 1100px; margin: 0 auto; padding: 16px; }
.read-nav { margin-bottom: 10px; font-size: 14px; }
.read-nav a { color: var(--accent); }
.read-subject { font-size: 20px; margin-bottom: 10px; overflow-wrap: anywhere; }
.read-head { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 14px;
             padding: 10px 12px; background: #fff; border: 1px solid var(--line); }
.read-head dt { color: var(--dim); font-weight: 600; }
.read-head dd { overflow-wrap: anywhere; }
.read-note { margin-top: 10px; padding: 8px 12px; background: #fff8e1; border: 1px solid #f0d58a; font-size: 13px; }
.read-atts { margin-top: 10px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.read-atts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 3px 0; }
.read-atts .att-name { overflow-wrap: anywhere; }
.read-atts a { color: var(--accent); }
.read-images { margin-top: 10px; padding: 8px 12px; background: #eef4ff; border: 1px solid #c9dafc; font-size: 13px; }
.read-images a { color: #0044cc; font-weight: 600; }
.read-body { display: block; width: 100%; height: calc(100vh - 120px); min-height: 400px; margin-top: 10px;
             border: 1px solid var(--line); background: #fff; }
/* ---------------------------------------------------------------- 메일 관리 · 검색 */

.search { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; }
.search input[type="search"] { flex: 1 1 200px; min-width: 0; padding: 6px 8px; border: 1px solid #ccc; font: inherit; }
.search select, .search button, .toolbar select, .toolbar button { padding: 5px 8px; border: 1px solid #ccc; background: #fff; font: inherit; font-size: 13px; }
.search button, .toolbar button { cursor: pointer; }
.search button:hover, .toolbar button:hover { background: #f0f0f0; }
.search a { color: var(--accent); }
.search label { display: inline-flex; align-items: center; gap: 4px; }
.mail-main > .error { color: var(--error); font-size: 13px; margin-bottom: 8px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.toolbar .move { display: inline-flex; gap: 4px; }
.read-tools { margin-bottom: 10px; }
.c-check { width: 32px; text-align: center !important; }