@font-face { font-family: 'DoHyeon'; src: url('fonts/DoHyeon-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'LeeSeoyun'; src: url('fonts/LeeSeoyun.ttf') format('truetype'); font-display: swap; }

/* 어두운 네이비 계열 (디스코드 느낌의 차분한 다크) */
:root {
  --bg0: #05080f; --bg1: #090d19; --bg2: #0d1222; --bg3: #131a30; --bg4: #1d2644;
  --line: #1c2540; --tx: #dfe3f0; --hd: #f4f6fc; --sub: #98a0bb;
  --ac: #7487ff; --ac2: #5f72f0; --acbg: rgba(116, 135, 255, .16);
  --ok: #4cc38a; --okbg: rgba(76, 195, 138, .15); --bad: #ff7a7a; --badbg: rgba(255, 122, 122, .15); --warn: #f2c14e; --warnbg: rgba(242, 193, 78, .14);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0; background: var(--bg2); color: var(--tx);
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  font-size: 15.5px; line-height: 1.7;
  word-break: keep-all; overflow-wrap: break-word;   /* 단어 단위로 줄바꿈 */
}
h1, h2, h3 { color: var(--hd); font-weight: bold; margin: 0; line-height: 1.35; }
h1 { font-size: 24px; margin-bottom: 4px; }
h2 { font-size: 17px; margin-bottom: 12px; }
h3 { font-size: 15.5px; margin-bottom: 6px; }
p { margin: 0 0 10px; }
a { color: var(--ac); }
b, strong { color: var(--hd); }
.sub { color: var(--sub); font-size: 13.5px; }
::selection { background: rgba(116, 135, 255, .4); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }

/* ---- 레이아웃 : 왼쪽 채널 목록 + 위쪽 채널 이름 줄 + 본문 ---- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--bg1); display: flex; flex-direction: column; border-right: 1px solid var(--bg0); }
.shead { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-bottom: 1px solid var(--bg0); box-shadow: 0 1px 0 rgba(255, 255, 255, .03); color: var(--hd); font-weight: bold; text-decoration: none; flex: none; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: var(--ac2); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: bold; }
.menu { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.menu nav { flex: 1; overflow-y: auto; padding: 8px 8px 12px; }
.cat { font-size: 11.5px; font-weight: bold; color: var(--sub); letter-spacing: .04em; padding: 16px 8px 4px; }
.menu nav a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 1px 0; border-radius: 6px; color: var(--sub); text-decoration: none; font-size: 15px; }
.menu nav a:hover { background: rgba(255, 255, 255, .06); color: var(--tx); }
.menu nav a.on { background: rgba(255, 255, 255, .11); color: var(--hd); }
.hash { color: #6b7391; font-size: 18px; width: 14px; text-align: center; flex: none; }
.menu nav a.on .hash { color: var(--sub); }
.userbox { display: flex; align-items: center; gap: 10px; background: var(--bg0); padding: 9px 10px; flex: none; }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--ac2); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: bold; flex: none; }
.un { flex: 1; min-width: 0; line-height: 1.3; }
.un .n { color: var(--hd); font-size: 14px; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.un .r { font-size: 12px; color: var(--sub); }
.out { font: inherit; font-size: 13px; border: 0; background: transparent; color: var(--sub); border-radius: 6px; padding: 6px 8px; cursor: pointer; flex: none; }
.out:hover { background: rgba(255, 255, 255, .08); color: var(--tx); }
.content { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 20px; background: var(--bg2); border-bottom: 1px solid var(--bg0); box-shadow: 0 1px 0 rgba(255, 255, 255, .03); flex: none; }
.burger { display: none; font: inherit; font-size: 20px; background: transparent; color: var(--tx); border: 0; border-radius: 6px; width: 38px; height: 38px; cursor: pointer; margin-left: -8px; }
.topbar .t { color: var(--hd); font-weight: bold; font-size: 16px; white-space: nowrap; }
.topbar .t i { font-style: normal; color: #6b7391; font-weight: normal; margin-right: 6px; font-size: 20px; }
.topbar .d { color: var(--sub); font-size: 13.5px; padding-left: 12px; border-left: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.demo { background: var(--warnbg); color: var(--warn); text-align: center; font-size: 13.5px; padding: 5px 12px; }
.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 24px 28px 90px; flex: 1; }
.head { display: flex; align-items: center; justify-content: flex-end; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head:empty { display: none; }
.lead { color: var(--sub); margin: 0 0 18px; font-size: 14.5px; }

@media (max-width: 860px) {
  .app { display: block; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: min(280px, 84vw); transform: translateX(-100%); transition: transform .16s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); }
  .burger { display: inline-flex; align-items: center; justify-content: center; }
  .topbar { padding: 0 12px; }
  .topbar .d { display: none; }
  .wrap { padding: 18px 14px 90px; }
}

.card { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 14px; }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- 버튼·입력 ---- */
.btn { font: inherit; font-size: 14.5px; min-height: 38px; padding: 6px 16px; border-radius: 6px; border: 1px solid var(--ac2); background: var(--ac2); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: #4d60de; border-color: #4d60de; }
.btn.ghost { background: transparent; color: var(--tx); border-color: var(--bg4); }
.btn.ghost:hover { background: rgba(255, 255, 255, .06); }
.btn.danger { background: transparent; color: var(--bad); border-color: rgba(255, 122, 122, .4); }
.btn.danger:hover { background: var(--badbg); }
.btn.sm { min-height: 30px; padding: 2px 11px; font-size: 13.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
label.f { display: block; font-size: 12.5px; font-weight: bold; color: var(--sub); margin: 0 0 6px; letter-spacing: .02em; }
.field { margin-bottom: 14px; }
input, select, textarea { font: inherit; font-size: 15.5px; width: 100%; padding: 9px 12px; border: 1px solid var(--bg0); border-radius: 6px; background: var(--bg0); color: var(--tx); }
select { appearance: auto; }
input:focus, select:focus, textarea:focus, .editor:focus { outline: none; border-color: var(--ac); box-shadow: 0 0 0 2px rgba(116, 135, 255, .25); }
input::placeholder, textarea::placeholder { color: #6b7391; }
input[type=checkbox] { width: auto; margin-right: 8px; accent-color: var(--ac2); }
input[type=file] { padding: 7px; }
input[type=file]::file-selector-button { font: inherit; background: var(--bg4); color: var(--tx); border: 0; border-radius: 4px; padding: 4px 10px; margin-right: 10px; cursor: pointer; }
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }

.chip { display: inline-block; font-size: 12px; line-height: 1.6; padding: 0 7px; border-radius: 4px; background: var(--bg4); color: var(--tx); white-space: nowrap; vertical-align: 1px; font-weight: bold; }
.chip.EASY { background: var(--okbg); color: var(--ok); } .chip.NORMAL { background: var(--acbg); color: var(--ac); }
.chip.HARD { background: var(--warnbg); color: var(--warn); } .chip.EXTREME { background: var(--badbg); color: var(--bad); }
.chip.ok { background: var(--okbg); color: var(--ok); } .chip.bad { background: var(--badbg); color: var(--bad); } .chip.pin { background: var(--acbg); color: var(--ac); }
.note { background: var(--bg1); border-left: 3px solid var(--ac); border-radius: 4px; padding: 10px 14px; font-size: 14px; margin: 12px 0; color: var(--tx); }
.note.warn { border-left-color: var(--warn); background: var(--warnbg); }
.empty { text-align: center; color: var(--sub); padding: 36px 10px; }
.err { color: var(--bad); font-size: 14px; min-height: 22px; margin: 4px 0 10px; }

/* ---- 로그인 ---- */
.loginpage { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg0); }
.login { width: 100%; max-width: 420px; background: var(--bg2); border-radius: 8px; padding: 30px 28px 24px; box-shadow: 0 8px 28px rgba(0, 0, 0, .45); }
.login h1 { text-align: center; font-size: 26px; margin-bottom: 6px; }
.login .tag { text-align: center; color: var(--sub); margin-bottom: 22px; font-size: 14.5px; }
.login .logo { display: flex; width: 48px; height: 48px; border-radius: 12px; font-size: 24px; margin: 0 auto 14px; }
.login .card { background: transparent; border: 0; padding: 0; margin: 0; }
.pwbox { position: relative; }
.pwbox button { position: absolute; right: 5px; top: 4px; height: 30px; }

/* ---- 목록 ---- */
.list { list-style: none; margin: 0 -10px; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a.item, .list .item { display: block; padding: 10px; border-radius: 6px; text-decoration: none; color: inherit; }
.list a.item:hover { background: rgba(255, 255, 255, .05); }
.item .t { font-weight: bold; color: var(--hd); display: block; }
.item .m { font-size: 13px; color: var(--sub); display: block; }

/* ---- 채팅형 공지 ---- */
.feed { padding-bottom: 8px; }
.dday { display: flex; align-items: center; gap: 12px; color: var(--sub); font-size: 12px; font-weight: bold; margin: 22px 0 10px; }
.dday::before, .dday::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.msg { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 14px; padding: 8px 12px; margin: 0 -12px; border-radius: 6px; }
.msg:hover { background: rgba(255, 255, 255, .03); }
.msg .av { width: 42px; height: 42px; font-size: 17px; margin-top: 2px; }
.msg .mh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 2px; }
.msg .nm { color: var(--ac); font-weight: bold; }
.msg .tm { color: var(--sub); font-size: 12px; }
.msg .tools2 { position: absolute; right: 10px; top: -12px; display: none; gap: 4px; background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
.msg:hover .tools2, .msg:focus-within .tools2 { display: flex; }
.rich { font-size: 15.5px; line-height: 1.8; }
.rich ul, .rich ol { margin: 4px 0 8px; padding-left: 22px; }
.rich p, .rich div { margin: 0 0 6px; }
.rich a { color: var(--ac); }
.imgs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.imgs img { max-width: min(360px, 100%); max-height: 300px; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; display: block; background: var(--bg0); }
.composer { position: sticky; bottom: 12px; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 0; margin-top: 16px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); z-index: 5; }
.composer .editor { border: 0; border-radius: 0; background: var(--bg3); min-height: 90px; max-height: 38vh; overflow-y: auto; }
.composer .tools { border: 0; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.cfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-top: 1px solid var(--line); }

/* ---- 서식 편집기 ---- */
.editor { min-height: 200px; padding: 12px 14px; border: 1px solid var(--bg0); border-radius: 0 0 6px 6px; background: var(--bg0); color: var(--tx); }
.tools { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 7px 10px; background: var(--bg3); border: 1px solid var(--bg0); border-bottom: 0; border-radius: 6px 6px 0 0; }
.tg { display: flex; align-items: center; gap: 4px; }
.tg .lab { font-size: 11.5px; color: var(--sub); margin-right: 2px; }
.tb { font: inherit; font-size: 13.5px; min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid var(--bg4); background: var(--bg2); color: var(--tx); border-radius: 5px; cursor: pointer; }
.tb:hover { border-color: var(--ac); }
.tools select { width: auto; padding: 4px 8px; font-size: 13.5px; background: var(--bg2); border-color: var(--bg4); }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); cursor: pointer; padding: 0; }
.sw.x { background: transparent; position: relative; } .sw.x::after { content: '×'; position: absolute; inset: 0; text-align: center; line-height: 20px; color: var(--sub); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 10px 0; }
.thumb { position: relative; width: 74px; height: 74px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.thumb button { position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; cursor: pointer; font-size: 13px; line-height: 22px; padding: 0; }
.attach { font: inherit; font-size: 13.5px; color: var(--tx); background: transparent; border: 1px dashed var(--bg4); border-radius: 6px; padding: 4px 12px; cursor: pointer; }
.attach:hover { border-color: var(--ac); color: var(--ac); }

/* ---- 자료실 (표지 갤러리) ---- */
.shelf-h { font-size: 13px; font-weight: bold; color: var(--sub); margin: 22px 0 12px; letter-spacing: .02em; }
.shelf-h:first-child { margin-top: 0; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 18px; }
.book { min-width: 0; display: flex; flex-direction: column; }
.cover { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4.15; border-radius: 6px; overflow: hidden; background: var(--bg4); border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(0, 0, 0, .35); cursor: pointer; padding: 0; transition: transform .12s; font: inherit; color: inherit; }
.cover:hover { transform: translateY(-3px); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; background: #fff; }
.ph { width: 100%; height: 100%; padding: 18px 14px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; background: linear-gradient(160deg, #3a4377, #232846); }
.ph b { font-size: 17px; line-height: 1.4; }
.ph span { font-size: 12px; color: #aab3de; }
.cover .dl { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 6px; border-radius: 5px; background: rgba(20, 23, 34, .88); color: #fff; font-size: 13px; text-align: center; opacity: 0; transition: opacity .12s; }
.cover:hover .dl, .cover:focus-visible .dl { opacity: 1; }
.book .bt { margin-top: 10px; font-weight: bold; color: var(--hd); font-size: 14.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book .bm { color: var(--sub); font-size: 12.5px; margin-top: 2px; }
.book .bx { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
@media (max-width: 520px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; } .cover .dl { opacity: 1; } }

/* ---- 채점 ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pill { font: inherit; font-size: 14px; padding: 5px 13px; border: 1px solid var(--bg4); background: transparent; border-radius: 6px; cursor: pointer; color: var(--sub); text-align: left; line-height: 1.4; }
.pill:hover { color: var(--tx); border-color: var(--ac); }
.pill.on { background: var(--ac2); border-color: var(--ac2); color: #fff; }
.pill small { opacity: .75; margin-left: 4px; }
.prob { display: grid; grid-template-columns: 84px 1fr; gap: 6px 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.prob:last-child { border-bottom: 0; }
.prob .num { font-size: 20px; font-weight: bold; color: var(--hd); letter-spacing: .02em; }
.prob .ch { display: flex; gap: 8px; flex-wrap: wrap; }
.prob .st { grid-column: 2; font-size: 13.5px; color: var(--sub); min-height: 20px; }
.bub { font: inherit; width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--bg4); background: transparent; color: var(--tx); font-size: 16px; cursor: pointer; padding: 0; }
.bub:hover { border-color: var(--ac); }
.bub.sel { background: var(--ac2); border-color: var(--ac2); color: #fff; }
.st .ok { color: var(--ok); } .st .bad { color: var(--bad); }
.stick { position: sticky; bottom: 12px; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); padding: 10px 14px; margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bar { height: 8px; border-radius: 4px; background: var(--bg0); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ac); border-radius: 4px; }
.bar.low > i { background: var(--bad); }
@media (max-width: 520px) { .prob { grid-template-columns: 1fr; } .prob .st { grid-column: 1; } }

/* ---- 리포트 ---- */
.kpi { background: var(--bg3); }
.kpi .v { font-size: 30px; font-weight: bold; color: var(--hd); line-height: 1.25; letter-spacing: -.01em; }
.kpi .l { font-size: 12.5px; font-weight: bold; color: var(--sub); }
.kpi .d { font-size: 13px; margin-top: 2px; color: var(--sub); }
.rl { display: grid; grid-template-columns: minmax(130px, 230px) 1fr 82px; gap: 6px 12px; align-items: center; padding: 7px 0; font-size: 14.5px; }
.rl .nm { line-height: 1.4; }
.rl .vv { text-align: right; font-size: 13.5px; color: var(--sub); white-space: nowrap; }
@media (max-width: 560px) { .rl { grid-template-columns: 1fr 82px; } .rl .nm { grid-column: 1 / -1; } }
.wk { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; }
.wk .col { white-space: nowrap; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: 12px; color: var(--sub); }
.wk .col i { display: block; width: 66%; background: var(--ac); border-radius: 4px 4px 0 0; min-height: 2px; }
.wk .col b { font-weight: normal; color: var(--tx); font-size: 12px; }
@media (max-width: 520px) { .wk { gap: 3px; } .wk .col, .wk .col b { font-size: 11px; } }
.pred { padding: 11px 0; border-bottom: 1px solid var(--line); }
.pred:last-child { border-bottom: 0; }
.pred .pt { font-weight: bold; color: var(--hd); }
.pred .px { margin: 2px 0; }
.up { color: var(--ok); } .down { color: var(--bad); }

/* ---- 표 ---- */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--sub); font-weight: bold; font-size: 12.5px; border-bottom: 1px solid var(--bg4); white-space: nowrap; }

/* ---- 질문 ---- */
.qbody { white-space: pre-wrap; }
.cmt { border-top: 1px solid var(--line); padding: 12px 0; }
.cmt .by { font-size: 13px; color: var(--sub); margin-bottom: 4px; }
.cmt .by b { color: var(--hd); }

/* ---- 영상 ---- */
.vcard { display: block; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg3); }
.vcard:hover { border-color: var(--ac); }
.vthumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #2e3563, #1c2040); position: relative; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 30px; }
.vthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vcard .vi { padding: 10px 12px; }
.player { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 8px; background: #000; }

/* ---- 토스트·창 ---- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--bg4); color: var(--hd); padding: 10px 18px; border-radius: 8px; font-size: 14.5px; z-index: 80; max-width: 92vw; text-align: center; border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 22px; width: min(440px, 92vw); background: var(--bg2); color: var(--tx); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); font-family: inherit; }
dialog::backdrop { background: rgba(0, 0, 0, .65); }
dialog h2 { margin-bottom: 12px; }
dialog.lb { width: auto; max-width: 94vw; padding: 8px; background: var(--bg0); }
dialog.lb img { display: block; max-width: 90vw; max-height: 86vh; border-radius: 6px; }

/* ---- 인쇄 (학부모 리포트) : 종이에는 밝게 ---- */
.print-only { display: none; }
@media print {
  :root { --bg0: #fff; --bg1: #fff; --bg2: #fff; --bg3: #f3f4f8; --bg4: #d7dbe8; --line: #cfd4e3; --tx: #1f2433; --hd: #11152a; --sub: #5d6482; --ac: #3b4fb8; --ac2: #3b4fb8; --acbg: #e8ebfb; --ok: #1f7a4d; --okbg: #e6f4ec; --bad: #b3322f; --badbg: #fbeaea; --warnbg: #fff6dd; --warn: #8a5a00; color-scheme: light; }
  @page { size: A4; margin: 14mm; }
  body { font-size: 12pt; }
  .app { display: block; }
  .side, .topbar, .noprint, .toast, .demo { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .card { break-inside: avoid; }
  .rp { break-after: page; }
  .rp:last-child { break-after: auto; }
  .kpi, .bar, .bar > i, .wk .col i, .chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-only { display: block; }
}

/* ---- 추가: 표시 · 멤버 패널 · 티어 · 순위 ---- */
.hide { display: none !important; }
.body { display: flex; flex: 1; min-height: 0; align-items: stretch; }
.body > .wrap { min-width: 0; }
.members { width: 232px; flex: none; background: var(--bg1); border-left: 1px solid var(--bg0); padding: 14px 8px; overflow-y: auto; position: sticky; top: 48px; align-self: flex-start; max-height: calc(100vh - 48px); }
.mhead { font-size: 12px; font-weight: bold; color: var(--sub); padding: 0 8px 6px; }
.mcat { font-size: 12px; font-weight: bold; color: var(--sub); padding: 12px 8px 4px; }
.mem { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 6px; }
.mem:hover { background: rgba(255, 255, 255, .05); }
.mem.off { opacity: .5; }
.mav { position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--ac2); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; flex: none; }
.dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--bg1); box-sizing: content-box; width: 8px; height: 8px; }
.dot.on { background: #3ba55d; } .dot.idle { background: #f0b232; } .dot.out { background: #747f8d; }
.mi { min-width: 0; flex: 1; line-height: 1.3; }
.mn { color: var(--hd); font-size: 14px; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.ms { color: var(--sub); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt img.te { height: 14px; width: auto; vertical-align: -2px; }
.mtoggle { display: none; margin-left: auto; }
.tier { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: bold; color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent); border-radius: 999px; padding: 1px 9px 1px 6px; white-space: nowrap; vertical-align: middle; }
.tier .te { height: 16px; width: auto; }
.tier.big { font-size: 17px; padding: 3px 14px 3px 10px; } .tier.big .te { height: 26px; }
#ubr { display: flex; align-items: center; gap: 4px; } #ubr .te { height: 14px; width: auto; }
.tcard { display: flex; align-items: center; gap: 22px; border-color: color-mix(in srgb, var(--tc) 40%, var(--line)); background: linear-gradient(120deg, color-mix(in srgb, var(--tc) 12%, var(--bg3)), var(--bg3) 60%); }
.tbig { width: 120px; flex: none; display: flex; justify-content: center; filter: drop-shadow(0 4px 14px color-mix(in srgb, var(--tc) 45%, transparent)); }
.tbig img { width: 110px; height: auto; }
.tinfo { flex: 1; min-width: 0; } .tname { font-size: 24px; font-weight: bold; color: var(--tc); line-height: 1.3; }
.tlegend { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tl { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--tc) 8%, var(--bg2)); border: 1px solid color-mix(in srgb, var(--tc) 30%, transparent); text-align: center; }
.tl .te { height: 52px; width: auto; max-width: 100%; filter: drop-shadow(0 3px 8px color-mix(in srgb, var(--tc) 40%, transparent)); }
.tl b { color: var(--tc); }
.rk { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; }
.rk + .rk { border-top: 1px solid var(--line); }
.rk.me { background: var(--acbg); }
.rk .rn { width: 28px; text-align: center; font-weight: bold; color: var(--sub); font-size: 17px; flex: none; }
.rk.top1 .rn { color: #f4c445; font-size: 20px; } .rk.top2 .rn { color: #c5cde0; font-size: 19px; } .rk.top3 .rn { color: #d39358; font-size: 18px; }
.ri { flex: 1; min-width: 0; } .rp2 { text-align: right; white-space: nowrap; } .rp2 b { color: var(--hd); font-size: 17px; }
@media (max-width: 1180px) { .members { display: none; position: fixed; right: 0; top: 48px; bottom: 0; z-index: 30; max-height: none; box-shadow: -8px 0 24px rgba(0, 0, 0, .5); } .members.show { display: block; } .mtoggle { display: inline-flex; } }
@media (max-width: 640px) { .tlegend { grid-template-columns: repeat(3, 1fr); } .tcard { flex-direction: column; text-align: center; gap: 10px; } .tbig { width: 90px; } .tbig img { width: 84px; } }
@media print { .members { display: none !important; } }

.wrap.wide { max-width: none; }
.shelf { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.ico { width: 20px; text-align: center; font-size: 14px; flex: none; filter: saturate(.9); }
.av { overflow: hidden; } .av img, .mav img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.mavw { position: relative; flex: none; }
.av.me { cursor: pointer; position: relative; } .av.me:hover::after { content: '변경'; position: absolute; inset: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.mav .dot { z-index: 1; }

.logo { overflow: hidden; } .logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo.edit { cursor: pointer; } .logo.edit:hover { outline: 2px solid var(--ac); }
.login .logo { width: 56px; height: 56px; border-radius: 14px; font-size: 26px; margin: 0 auto 10px; display: flex; }
