:root{--bg:#f3f5f8;--card:#fff;--line:#e4e8ef;--line2:#eef1f5;--ink:#1b2430;--mute:#6b7685;--navy:#1f3d6b;--navy-bg:#e8eef8;--green:#1f7a4d;--green-bg:#e6f4ec;--amber:#8a5a00;--amber-bg:#fbf1d9;--red:#b3261e;--red-bg:#fbe7e5;--blue:#245aa6;--blue-bg:#e6eefb;--r:12px;
--font:'Pretendard Variable',Pretendard,'Noto Sans KR','Apple SD Gothic Neo',-apple-system,sans-serif;--mono:ui-monospace,'SF Mono',Menlo,monospace}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:15px;line-height:1.5}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit}
.shell{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:100vh}
/* sidebar */
.side{background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:26px 18px 18px;position:sticky;top:0;height:100vh}
.brand{padding:0 8px 26px}.brand img{height:40px;width:auto;display:block;margin-bottom:6px}.brand span{font-size:13px;color:var(--mute)}
.nav{display:flex;flex-direction:column;gap:4px;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;-ms-overflow-style:none;overscroll-behavior:contain}
.nav::-webkit-scrollbar{width:0;height:0;display:none}
.side .brand{flex:none}.side .side-foot{flex:none}
.nav a{flex:none}
.nav a{display:flex;align-items:center;gap:12px;height:48px;padding:0 14px;border-radius:10px;border:1.5px solid transparent;font-size:16px;font-weight:500;color:#2a3442}
.nav a svg{width:20px;height:20px;flex:none;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.nav a:hover{background:#f5f7fa}.nav a.on{background:#fff;border-color:var(--navy);color:var(--navy);font-weight:700}
.nav a.nav-sep{margin-top:16px;position:relative}.nav a.nav-sep::before{content:'';position:absolute;left:10px;right:10px;top:-9px;height:1px;background:var(--line2)}
.nav .n{margin-left:auto;background:#eef1f5;color:#3b4654;font-size:12.5px;font-weight:600;padding:2px 9px;border-radius:999px}.nav a.on .n{background:var(--navy);color:#fff}
.side-foot{margin-top:auto;padding:14px 8px 0;border-top:1px solid var(--line2);display:flex;justify-content:space-between;align-items:center;font-size:14px;color:var(--mute)}.side-foot a{text-decoration:underline}
/* main */
.main{padding:28px 36px 60px;min-width:0}
.top{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px;flex-wrap:wrap}
.top h1{margin:0;font-size:26px;font-weight:800;letter-spacing:-.02em}.top .sub{color:var(--mute);font-size:14px;margin-left:12px;font-weight:400}
.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 18px;border-radius:10px;border:1.5px solid var(--line);background:#fff;font-size:15px;font-weight:600;cursor:pointer;white-space:nowrap}
.btn:hover{border-color:#b9c2cf}.btn.pri{background:var(--navy);border-color:var(--navy);color:#fff}.btn.pri:hover{background:#17304f}.btn.soft{background:var(--navy-bg);border-color:#c9d6ea;color:var(--navy)}
.btn.danger{color:var(--red);border-color:#f0c9c6}.btn.danger:hover{background:var(--red-bg)}.btn.sm{height:34px;padding:0 12px;font-size:13.5px;border-radius:8px}
/* card */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.card+.card{margin-top:18px}
.card .hd{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 20px;border-bottom:1px solid var(--line2);flex-wrap:wrap}
.card .bd{padding:20px}
/* chips */
.chips{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.chip{display:inline-flex;align-items:center;gap:8px;height:38px;padding:0 14px;border-radius:999px;border:1.5px solid var(--line);background:#fff;font-size:14px;font-weight:500;color:#2a3442}
.chip .n{background:#eef1f5;color:#4a5566;font-size:12px;font-weight:600;padding:1px 8px;border-radius:999px}
.chip.on{background:var(--navy);border-color:var(--navy);color:#fff}.chip.on .n{background:rgba(255,255,255,.18);color:#fff}
.chip.dim{color:#9aa4b2;border-style:dashed}
.chips .sep{width:1px;height:26px;background:var(--line);margin:0 6px}
.search{display:flex;align-items:center;gap:8px;height:42px;padding:0 14px;border:1.5px solid var(--line);border-radius:10px;background:#fff;min-width:240px}
.search input{border:0;outline:0;background:transparent;width:100%;font-size:14.5px}.search svg{width:18px;height:18px;stroke:var(--mute);fill:none;stroke-width:1.8;stroke-linecap:round}
select.sel{height:42px;padding:0 12px;border:1.5px solid var(--line);border-radius:10px;background:#fff;font-size:14.5px}
/* table */
table.tbl{width:100%;border-collapse:collapse;font-size:15px}
.tbl th{text-align:left;font-weight:600;font-size:13.5px;color:var(--mute);padding:12px 16px;border-bottom:1px solid var(--line2);background:#fafbfc;white-space:nowrap}
.tbl td{padding:14px 16px;border-bottom:1px solid var(--line2);vertical-align:middle}
.tbl tr:last-child td{border-bottom:0}.tbl tr:hover td{background:#fafbfd}
.tbl .t a{font-weight:600;font-size:15.5px}.tbl .t a:hover{text-decoration:underline}
.tbl .id{font-family:var(--mono);font-size:12.5px;color:var(--mute)}
.tbl .num{font-family:var(--mono);font-size:14px;color:#3b4654;white-space:nowrap}
.tbl .r{text-align:right}
.tbl input[type=text],.tbl input[type=number]{height:36px;padding:0 10px;border:1.5px solid var(--line);border-radius:8px;width:100%}
.tbl select{height:36px;padding:0 8px;border:1.5px solid var(--line);border-radius:8px;background:#fff}
/* pills */
.pill{display:inline-flex;align-items:center;gap:7px;height:30px;padding:0 12px;border-radius:999px;font-size:13.5px;font-weight:600;white-space:nowrap;background:#f1f3f6;color:#3b4654}
.pill::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor;opacity:.85}
.pill.pub{background:var(--green-bg);color:var(--green)}.pill.hid{background:#f1f3f6;color:#6b7685}.pill.ed{background:var(--blue-bg);color:var(--blue)}.pill.warn{background:var(--amber-bg);color:var(--amber)}.pill.bad{background:var(--red-bg);color:var(--red)}
.pill.nodot::before{display:none}
.tag{display:inline-flex;align-items:center;height:28px;padding:0 11px;border-radius:999px;border:1.5px solid #d3dbe7;background:var(--navy-bg);color:var(--navy);font-size:13px;font-weight:600;white-space:nowrap}
.tag.grey{background:#fff;border-color:var(--line);color:#4a5566}
/* avatar */
.av{width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:16px;flex:none;overflow:hidden}
.av img{width:100%;height:100%;object-fit:cover}.av.empty{background:#fff;border:1.5px dashed #b9c2cf;color:#b9c2cf}
.who{display:flex;align-items:center;gap:12px}.who .nm{font-weight:600}.who .sm{font-size:13px;color:var(--mute)}
/* 방문 통계 차트 (photobox.css 와 같은 모양) */
.hrow{display:grid;grid-template-columns:minmax(90px,200px) 1fr 76px;gap:10px;align-items:center;padding:4px 0;font-size:13.5px}
.hrow .lbl{color:var(--mute);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}
.hrow .lbl a{color:inherit}.hrow .lbl a:hover{color:var(--navy);text-decoration:underline}
.hrow .track{display:flex;align-items:center;height:14px}
.hrow .fill{height:14px;border-radius:0 4px 4px 0;background:var(--navy);min-width:2px}
.hrow .val{font-variant-numeric:tabular-nums;font-weight:600;font-size:13px;text-align:right}
.mchart{display:flex;gap:6px;align-items:flex-end;height:160px;padding-top:8px}
.mcol{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}
.mcol .mbar{width:100%;max-width:34px;background:var(--navy);border-radius:4px 4px 0 0;min-height:2px}
.mcol .mlbl,.mcol .mval{font-size:10.5px;color:var(--mute);white-space:nowrap}
/* stats */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px;margin-bottom:18px}
.stat{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:18px 20px}.stat b{display:block;font-size:32px;font-weight:800;letter-spacing:-.02em;line-height:1.1}.stat span{color:var(--mute);font-size:14px}
/* forms */
.form{display:grid;gap:16px}.row{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px}
.f{display:flex;flex-direction:column;gap:6px}.f label{font-size:13px;font-weight:600;color:var(--mute)}
.f input[type=text],.f input[type=number],.f input[type=password],.f select,.f textarea{height:44px;padding:0 12px;border:1.5px solid var(--line);border-radius:10px;background:#fff;font-size:15px;outline:0}
.f textarea{height:auto;min-height:120px;padding:10px 12px;line-height:1.55}
.f input:focus,.f select:focus,.f textarea:focus{border-color:var(--navy)}
.f .hint{font-size:12.5px;color:var(--mute)}
.two{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:20px;align-items:start}
.inline{display:flex;gap:8px;align-items:center}.inline input[type=file]{font-size:13px}
.msg{padding:12px 16px;border-radius:10px;margin-bottom:16px;font-weight:500}.msg.ok{background:var(--green-bg);color:var(--green)}.msg.warn{background:var(--amber-bg);color:var(--amber)}
.sticky-actions{position:sticky;bottom:0;background:linear-gradient(180deg,rgba(243,245,248,0),var(--bg) 30%);padding:18px 0 4px;display:flex;gap:10px;align-items:center}
.pages img{width:100%;border:1px solid var(--line);border-radius:10px;margin-bottom:12px;display:block}
.small{font-size:13px;color:var(--mute)}
.pager{display:flex;gap:14px;align-items:center;justify-content:flex-end;padding:14px 20px;border-top:1px solid var(--line2);font-size:14px}
/* editor */
.editor{background:#fff;border:1.5px solid var(--line);border-radius:10px;overflow:hidden}
/* TipTap(editor/ 빌드) — 본문은 세리프, 제목 크기는 공개 페이지와 맞춤 */
.editor .kpa-editor .tiptap.ProseMirror{font-family:'Noto Serif KR',serif;font-size:16px;min-height:520px;padding:20px 24px 48px}.editor.sm .kpa-editor .tiptap.ProseMirror{min-height:200px}
.editor .kpa-editor .tiptap.ProseMirror h2{font-size:26px;font-weight:700}.editor .kpa-editor .tiptap.ProseMirror h3{font-size:20px;font-weight:700}
.editor .kpa-editor .tiptap.ProseMirror .note{color:var(--mute);font-family:var(--font);font-size:13.5px}
.editor .kpa-editor .tiptap-toolbar{background:#fafbfc;border-bottom:1px solid var(--line2)}
/* login */
.login{min-height:100vh;display:grid;place-items:center;background:var(--bg);padding:24px 16px}
.login .card{width:100%;max-width:380px;padding:32px}
@media (max-width:480px){.login .card{padding:24px 18px}.login .row{flex-direction:column}}
.login h1{margin:0 0 4px;font-size:24px;font-weight:800}.login p{margin:0 0 22px;color:var(--mute);font-size:14px}
/* works grid */
.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.grid4 figure{margin:0}.grid4 img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:8px;border:1px solid var(--line)}.grid4 figcaption{font-size:12.5px;color:var(--mute);margin-top:6px}
@media (max-width:1100px){.two{grid-template-columns:1fr}}
@media (max-width:820px){.shell{grid-template-columns:1fr}.side{position:static;height:auto;flex-direction:row;flex-wrap:wrap;gap:8px;padding:14px}.brand{padding:0 8px;width:100%}.nav{flex-direction:row;flex-wrap:wrap}.nav a{height:38px;font-size:14px}.side-foot{display:none}.main{padding:18px}.grid4{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* 이미지 원형 보존 */
.grid4 img{object-fit:contain;background:#f3f5f8}.av img{object-fit:contain;background:#fff}.pages img{height:auto}
/* cv editor */
.cvtbl tr.unrev td{background:#fffdf5}.cvtbl tr.conf-low td{background:#fff3f1}.cvtbl tr.newrow td{background:#f7f9fc}
.cvtbl th,.cvtbl td{padding-left:8px;padding-right:8px}.cvtbl td:first-child,.cvtbl th:first-child{padding-left:14px}
.cvtbl input[type=number]{width:100%;min-width:78px;padding:0 6px;font-variant-numeric:tabular-nums}.cvtbl input[type=number]::-webkit-inner-spin-button{opacity:.5}
.cvtbl select{max-width:100%}.cvtbl td.src{white-space:nowrap;color:var(--mute)}

/* 홈 슬라이드 편집 */
.slides{display:flex;flex-direction:column;gap:10px}.slide-row{display:grid;grid-template-columns:160px 1fr auto;gap:12px;align-items:center;padding:10px;border:1.5px solid var(--line);border-radius:10px;background:#fff}
.slide-row img{width:160px;height:90px;object-fit:contain;background:#f3f2ee;border-radius:6px}.slide-row .sf{display:flex;flex-direction:column;gap:6px}.slide-row .sf input{height:38px;padding:0 10px;border:1.5px solid var(--line);border-radius:8px;font-size:14px;outline:0}
.slide-row .sb{display:flex;gap:6px}
.slide-row .slide-auto{width:160px;height:90px;display:flex;align-items:center;justify-content:center;background:#eef2f7;color:#1f3d6b;border-radius:6px;font-weight:700}

.slide-wrap{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:start}.sub-hd{font-size:13px;font-weight:700;color:var(--ink);margin-bottom:8px}.sub-hd .small{font-weight:400;margin-left:6px}
.picker{border:1.5px solid var(--line);border-radius:10px;padding:12px;background:#fafafa}.picker input[type=search],.picker select{height:38px;padding:0 10px;border:1.5px solid var(--line);border-radius:8px;font-size:14px;background:#fff;outline:0}
.pk-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;max-height:520px;overflow:auto;padding:2px}
.pk-item{display:flex;flex-direction:column;gap:4px;padding:6px;border:1.5px solid var(--line);border-radius:8px;background:#fff;cursor:pointer;text-align:left;font:inherit;font-size:12.5px;line-height:1.3}.pk-item:hover{border-color:var(--navy)}.pk-item img{width:100%;height:72px;object-fit:contain;background:#f3f2ee;border-radius:4px}.pk-item small{color:var(--mute)}
.pk-item.used{opacity:.45;cursor:default}
@media (max-width:1100px){.slide-wrap{grid-template-columns:1fr}}

/* 드래그앤드롭 업로드 영역 */
.dz{position:relative;border-radius:10px;transition:background .15s,box-shadow .15s}
.dz .dz-hint{font-size:12px;color:#9aa4b2;margin-top:4px}
.dz.dz-over{background:#eef3fb;box-shadow:0 0 0 2px var(--navy) inset}.dz.dz-over .dz-hint{color:var(--navy);font-weight:600}

/* 보조 메뉴 공통 스타일(모든 폭) */
.subside h3{margin:0;padding:0 10px;font-size:13px;font-weight:600;color:var(--mute);letter-spacing:.02em}
.subside .subtitle{padding:0 10px;font-size:12.5px;color:var(--mute);font-family:var(--mono);word-break:break-all;margin-top:-8px}
.subside .btn{width:100%;justify-content:center}
.subnav{display:flex;flex-direction:column;gap:2px}
.subnav a{display:flex;align-items:center;gap:10px;height:40px;padding:0 12px;border-radius:9px;font-size:14.5px;font-weight:500;color:#2a3442}
.subnav a svg{width:17px;height:17px;flex:none;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.subnav a:hover{background:#f0f3f7}.subnav a.on{background:var(--navy-bg);color:var(--navy);font-weight:700}
.subnav .n{margin-left:auto;background:#e6eaf0;color:#3b4654;font-size:12px;font-weight:600;padding:1px 8px;border-radius:999px}.subnav a.on .n{background:var(--navy);color:#fff}
.subnav .sep{height:1px;background:var(--line2);margin:8px 6px}
.subside form.q{display:flex;gap:6px}.subside form.q input{flex:1;min-width:0;height:36px;padding:0 10px;border:1.5px solid var(--line);border-radius:9px;font-size:13.5px}.subside form.q button{height:36px;padding:0 10px;border-radius:9px;border:1.5px solid var(--line);background:#fff;cursor:pointer;font-size:13.5px}
.subside .foot{margin-top:auto;padding:0 10px;font-size:12.5px;color:var(--mute)}
@media (min-width:821px){
/* 보조 사이드바(메일 폴더·포토박스 메뉴): .shell.has-sub 일 때 사이드바와 본문 사이 */
.shell.has-sub{grid-template-columns:260px 224px minmax(0,1fr)}
.subside{background:#fafbfd;border-right:1px solid var(--line);padding:26px 14px 18px;position:sticky;top:0;height:100vh;overflow:auto;display:flex;flex-direction:column;gap:14px}

/* 보조 메뉴가 있을 때 1단 사이드바는 아이콘 레일(76px)로 접고, 올리면 본문 위로 펼침.
   요소를 숨겼다 보였다 하지 않고 너비·투명도만 바꿔 움직임이 자연스럽게. 레일 마크는 로고의 '한' 글자. */
.brand .mk{display:none}
.shell.has-sub{grid-template-columns:76px 224px minmax(0,1fr)}
.shell.rail{grid-template-columns:76px minmax(0,1fr)}
:is(.shell.has-sub,.shell.rail) .side{width:76px;padding:22px 12px 16px;z-index:20;overflow:hidden;transition:width .22s cubic-bezier(.2,.7,.2,1),padding .22s cubic-bezier(.2,.7,.2,1),box-shadow .22s;will-change:width}
:is(.shell.has-sub,.shell.rail) .side .brand{position:relative;height:84px;width:100%;padding:0;margin-bottom:6px;overflow:hidden}
:is(.shell.has-sub,.shell.rail) .side .brand a{display:block;height:100%}
:is(.shell.has-sub,.shell.rail) .side .brand .mk{display:block;position:absolute;left:0;right:0;top:14px;margin:0 auto;width:46px;height:46px;object-fit:contain;transition:opacity .18s}
:is(.shell.has-sub,.shell.rail) .side .brand .lg{position:absolute;left:8px;top:6px;height:40px;width:auto;margin:0;opacity:0;transition:opacity .18s;white-space:nowrap}
:is(.shell.has-sub,.shell.rail) .side .brand span{position:absolute;left:8px;top:56px;white-space:nowrap;opacity:0;transition:opacity .18s}
:is(.shell.has-sub,.shell.rail) .nav a{padding:0 16px;gap:12px;justify-content:flex-start;position:relative;overflow:hidden;white-space:nowrap}
:is(.shell.has-sub,.shell.rail) .nav a .lb{display:inline;opacity:0;transition:opacity .15s}
:is(.shell.has-sub,.shell.rail) .nav a .n{position:absolute;top:50%;right:14px;transform:translateY(-50%);margin:0;transition:top .22s,right .22s,transform .22s,font-size .22s,padding .22s}
:is(.shell.has-sub,.shell.rail) .side:not(:hover) .nav a .n{top:4px;right:4px;transform:none;font-size:10.5px;padding:0 5px;line-height:16px}
:is(.shell.has-sub,.shell.rail) .side-foot{position:relative;height:44px;padding:14px 0 0;justify-content:flex-start;overflow:hidden;white-space:nowrap}
:is(.shell.has-sub,.shell.rail) .side-foot span{opacity:0;transition:opacity .15s;padding-left:8px}
:is(.shell.has-sub,.shell.rail) .side-foot a{position:absolute;right:8px;top:14px;opacity:0;transition:opacity .15s}
:is(.shell.has-sub,.shell.rail) .side-foot::before{content:'';position:absolute;left:16px;top:20px;width:20px;height:20px;background:var(--mute);opacity:1;transition:opacity .15s;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E") center/contain no-repeat}
/* 펼침(호버): 0.12초 머물러야 열리고, 벗어나면 바로 닫힘 */
:is(.shell.has-sub,.shell.rail) .side:hover{width:260px;padding:22px 18px 16px;box-shadow:12px 0 32px rgba(20,30,50,.14);transition-delay:.12s}
:is(.shell.has-sub,.shell.rail) .side:hover .brand .mk{opacity:0;transition-delay:.12s}
:is(.shell.has-sub,.shell.rail) .side:hover .brand .lg,:is(.shell.has-sub,.shell.rail) .side:hover .brand span{opacity:1;transition-delay:.2s}
:is(.shell.has-sub,.shell.rail) .side:hover .nav a .lb{opacity:1;transition-delay:.18s}
:is(.shell.has-sub,.shell.rail) .side:hover .side-foot span,:is(.shell.has-sub,.shell.rail) .side:hover .side-foot a{opacity:1;transition-delay:.2s}
:is(.shell.has-sub,.shell.rail) .side:hover .side-foot::before{opacity:0;transition-delay:.12s}
:is(.shell.has-sub,.shell.rail) .nav a.nav-sep::before{left:14px;right:14px}

/* 사이드바 접기 단추: 레일일 때는 아이콘만, 펼치면 오른쪽 위 */
.side-toggle{position:absolute;z-index:6;right:10px;top:30px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;border:0;background:0;border-radius:8px;color:var(--mute);cursor:pointer;padding:0;opacity:0;transition:opacity .15s}
.side-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.side:hover .side-toggle,.side:focus-within .side-toggle{opacity:1}
.side-toggle:hover{background:#eef1f5;color:var(--ink)}
:is(.shell.has-sub,.shell.rail) .side:not(:hover) .side-toggle{opacity:0;pointer-events:none}
:is(.shell.has-sub,.shell.rail) .side:hover .side-toggle{opacity:1;pointer-events:auto}
.shell.rail .side-toggle svg{transform:scaleX(-1)}
}

/* 모바일: 사이드바는 상단 가로 바(마크+아이콘 메뉴, 가로 스크롤), 보조 메뉴는 그 아래 칩 줄, 본문은 한 열 */
@media (max-width:820px){
  .shell,.shell.has-sub{grid-template-columns:1fr;align-content:start}   /* 세로 여분 공간을 행마다 나눠 갖지 않게 */
  .side{position:sticky;top:0;z-index:30;height:auto;width:auto;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:6px;padding:8px 12px;overflow-x:auto;overflow-y:hidden;border-right:0;border-bottom:1px solid var(--line);-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .side::-webkit-scrollbar{display:none}
  .side .brand{padding:0;margin:0 4px 0 0;width:auto;height:auto;flex:none;position:static}
  .side .brand a{display:block}.side .brand .lg,.side .brand span{display:none}.side .brand .mk{display:block;position:static;width:36px;height:36px;opacity:1}
  .nav{flex-direction:row;flex-wrap:nowrap;gap:4px}
  .nav a{height:38px;padding:0 10px;font-size:13.5px;gap:6px;white-space:nowrap;flex:none;justify-content:flex-start;overflow:visible}
  .nav a svg{width:18px;height:18px}.nav a .lb{display:inline;opacity:1}
  .nav a .n{position:static;transform:none;margin-left:4px;font-size:11.5px;padding:1px 7px;line-height:normal}
  .nav a.nav-sep{margin:0 0 0 6px}.nav a.nav-sep::before{display:none}
  .side-foot{display:none}
  .subside{display:flex;position:static;height:auto;width:auto;flex-direction:row;flex-wrap:wrap;align-items:center;gap:6px 8px;padding:10px 12px;border-right:0;border-bottom:1px solid var(--line);overflow:visible;background:#fafbfd}
  .subside h3,.subside .subtitle,.subside .foot{display:none}
  .subnav{flex-direction:row;flex-wrap:wrap;gap:4px}.subnav a{height:34px;padding:0 10px;font-size:13.5px}.subnav a svg{width:15px;height:15px}.subnav .sep{display:none}
  .subside .btn{width:auto;height:36px;padding:0 12px;font-size:13.5px}.subside form.q{width:100%;order:9}
  .main{padding:16px 14px 40px}
  .top{margin-bottom:14px;gap:10px}.top h1{font-size:21px}.top .sub{display:block;margin:4px 0 0;font-size:13px}
  .actions .btn{height:38px;padding:0 12px;font-size:14px}
  .card{overflow-x:auto}.card .hd{padding:12px 14px}.card .bd{padding:14px}
  .tbl th,.tbl td{padding:10px 10px;font-size:14px}
  .tbl:not(.mail-list){min-width:640px}.tbl:not(.mail-list) .t{min-width:260px}   /* 열이 많은 표는 카드 안에서 가로 스크롤(제목이 세로로 쪼개지지 않게) */
  .card:has(> .tbl){overflow-x:auto;-webkit-overflow-scrolling:touch}
  .row{flex-direction:column}.two{grid-template-columns:1fr}
  .grid4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sticky-actions{position:sticky;bottom:0;background:var(--bg);padding:10px 0}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}.stat b,.stat strong{font-size:28px}
  .mail-list .mwho{width:92px;max-width:92px}.mail-list .num{width:58px}.mail-list .att{width:22px}.mail-list td{padding:10px 8px}
  .mail-body{padding:14px}.mail-head .meta .k{display:block;width:auto}
}

/* 모바일 하단 내비게이션(알약형, 떠 있음). 데스크톱에서는 숨김 */
.bottomnav{display:none}
@media (max-width:820px){
  .bottomnav{display:flex;position:fixed;left:14px;right:14px;bottom:calc(12px + env(safe-area-inset-bottom,0px));height:66px;z-index:40;background:rgba(255,255,255,.98);border:1px solid rgba(20,30,50,.08);border-radius:999px;box-shadow:0 10px 30px rgba(20,30,50,.18);padding:6px;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);will-change:transform}
  .bottomnav a,.bottomnav button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:999px;font-size:11px;font-weight:600;color:#4a5566;position:relative;min-width:0;background:none;border:0;padding:0;height:100%;font-family:inherit;cursor:pointer;-webkit-appearance:none;appearance:none}
  .bottomnav a svg,.bottomnav button svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
  .bottomnav a.on,.bottomnav button.on{background:var(--navy-bg);color:var(--navy)}
  .bottomnav a span,.bottomnav button span{display:block;line-height:1.1;white-space:nowrap}
  .bottomnav .bn-badge{position:absolute;top:6px;left:calc(50% + 6px);background:#e0392a;color:#fff;font-style:normal;font-size:10px;font-weight:700;line-height:16px;min-width:16px;padding:0 4px;border-radius:999px;text-align:center}
  .main{padding-bottom:calc(100px + env(safe-area-inset-bottom,0px))}
  .sticky-actions{bottom:calc(84px + env(safe-area-inset-bottom,0px))}
  /* 하단 바가 있으니 상단 바는 로고와 제목만 */
  .side .nav{display:none}
  .side .brand{display:flex;align-items:center;gap:10px}.side .brand a{display:flex;align-items:center;gap:10px}
  .side .brand .mk{width:32px;height:32px}.side .brand span{display:inline;position:static;opacity:1;font-size:13.5px;color:var(--mute);white-space:nowrap}
}

/* 폰 전용: 보조 메뉴는 한 줄 가로 스크롤, 목록 표는 카드/앱식 목록, 도움말 숨김 */
@media (max-width:820px){
  .subside{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;gap:6px;padding:8px 12px;scrollbar-width:none;-webkit-overflow-scrolling:touch}.subside::-webkit-scrollbar{display:none}
  .subnav{flex-wrap:nowrap;gap:4px}.subnav a{flex:none;white-space:nowrap;height:34px}
  .subside .btn{flex:none;height:34px}.subside form.q{width:auto;order:0;flex:none}.subside form.q input{width:130px;height:34px}.subside form.q button{height:34px}
  .help{display:none}
  .top{align-items:flex-start;gap:8px}.top h1{font-size:20px;line-height:1.25;min-width:0}.top .sub{font-size:12.5px;margin-top:2px}
  .card .hd:empty,.card .hd:has(> .help:only-child){display:none}
  /* 메일 목록: 보낸사람·시각 / 제목 / 미리보기 */
  .mail-list,.mail-list tbody{display:block;min-width:0;table-layout:auto}
  .mail-list tr{display:grid;grid-template-columns:24px minmax(0,1fr) auto auto;grid-template-areas:"star who att num" "star t t t";column-gap:8px;row-gap:1px;padding:9px 12px 9px 6px;border-bottom:1px solid var(--line2);align-items:center}
  .mail-list td{display:block;border:0;padding:0;width:auto;max-width:none;font-size:14px}
  .mail-list .star{grid-area:star;text-align:center}.mail-list .mwho{grid-area:who;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14.5px}
  .mail-list .att{grid-area:att;font-size:12px}.mail-list .num{grid-area:num;font-size:12px;text-align:right;color:var(--mute)}
  .mail-list .t{grid-area:t;overflow:hidden}.mail-list .t a{display:block;white-space:normal}
  .mail-list .subj{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mail-list .snip{display:block;color:var(--mute);font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mail-list tr.unread .subj{font-weight:700}.mail-list .snip .dash{display:none}
  .mail-list .star form,.mail-list .starbtn{line-height:1;display:block}.mail-list .starbtn{padding:0;font-size:17px}
  /* 카드형 목록(.tbl.stack): 제목 크게, 출처·상태 작게, 동작 한 줄 */
  .tbl.stack{display:block;min-width:0}.tbl.stack tbody{display:block}.tbl.stack tr:has(th){display:none}
  .tbl.stack tr{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:12px 14px;border-bottom:1px solid var(--line2)}
  .tbl.stack td{display:block;border:0;padding:0;font-size:13px}
  .tbl.stack td.t{order:0;width:100%;min-width:0}.tbl.stack td.t a{font-size:16px;line-height:1.35;white-space:normal;font-weight:600}.tbl.stack td.t .id{margin-top:2px}
  .tbl.stack td.num{order:1;color:var(--mute);font-size:12.5px;white-space:normal}
  .tbl.stack td:not(.t):not(.num):not(.r){order:2}
  .tbl.stack td.r{order:3;width:100%;text-align:left;margin-top:4px}.tbl.stack td.r .inline{justify-content:flex-start !important;flex-wrap:wrap;gap:6px}
  .tbl.stack td[colspan]{width:100%}
}

/* 모바일 상단 바 오른쪽 빠른 링크(데스크톱은 사이드바 메뉴에 있으므로 숨김) */
.topbar-links{display:none}
@media (max-width:820px){
  .topbar-links{display:flex;gap:4px;margin-left:auto;flex:none}
  .topbar-links a{display:flex;align-items:center;gap:5px;height:34px;padding:0 10px;border-radius:999px;border:1px solid var(--line);font-size:12.5px;font-weight:600;color:#2a3442;white-space:nowrap}
  .topbar-links a svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
}
/* 페이지 공개 선택 */
.pp-opt{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border:1.5px solid var(--line);border-radius:10px;cursor:pointer;margin-bottom:8px;background:#fff}
.pp-opt:last-of-type{margin-bottom:0}
.pp-opt:has(input:checked){border-color:var(--navy);background:#f4f7fc}
.pp-opt input{margin-top:3px;width:17px;height:17px;accent-color:var(--navy);flex:none}
.pp-opt b{display:block;font-size:14.5px;margin-bottom:3px}
.pp-opt i{font-style:normal;font-size:13px;color:var(--mute);line-height:1.5}
/* 모바일 '더보기' 시트: 좌측 메뉴가 숨겨진 폭에서 나머지 항목으로 가는 길 */
.adm-sheet{position:fixed;inset:0;z-index:70;display:flex;align-items:flex-end}
.adm-sheet[hidden]{display:none}
.adm-sheet-bg{position:absolute;inset:0;background:rgba(15,25,20,.45)}
.adm-sheet-in{position:relative;width:100%;background:#fff;border-radius:18px 18px 0 0;padding:14px 14px calc(96px + env(safe-area-inset-bottom,0px));box-shadow:0 -12px 40px rgba(15,25,20,.22);max-height:76vh;overflow:auto}
.adm-sheet-hd{display:flex;align-items:center;justify-content:space-between;padding:4px 6px 12px}
.adm-sheet-hd b{font-size:15px}
.adm-sheet-x{border:0;background:0;font-size:17px;color:var(--mute);cursor:pointer;padding:4px 8px;line-height:1}
.adm-sheet-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.adm-sheet-grid a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:14px 4px;border-radius:12px;color:var(--ink);font-size:12px;font-weight:600;text-align:center;line-height:1.25}
.adm-sheet-grid a:hover,.adm-sheet-grid a:active{background:#eef1f5;text-decoration:none}
.adm-sheet-grid a{position:relative}
.sheet-badge{position:absolute;top:8px;right:calc(50% - 22px);background:#e0392a;color:#fff;font-style:normal;font-size:10px;font-weight:700;line-height:16px;min-width:16px;padding:0 4px;border-radius:999px;text-align:center}
.adm-sheet-grid svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
@media (min-width:821px){.adm-sheet{display:none!important}}
@media (max-width:360px){.adm-sheet-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
