/* 좌측 사이드바 — genchart(로담) ClassicSideNav 모양. sidebar-nav.js 와 짝. 마지막에 불러와 기존 규칙을 덮는다. */
:root { --sn-w: 208px; --sn-rail: 52px; --sn-bg: #2d2d2d; --sn-hover: #404040; --sn-line: rgba(255,255,255,.12); --sn-accent: #4fae79; --sn-logo: var(--brand, #2f6b4e); }

/* ---------------------------------------------------------------- 데스크톱 */
html .shell { grid-template-columns: var(--sn-w) minmax(0, 1fr); }
html.sn-rail .shell { grid-template-columns: var(--sn-rail) minmax(0, 1fr); }
html .shell > aside.sn {
  background: var(--sn-bg); color: #fff; padding: 0; display: flex; flex-direction: column;
  position: sticky; top: 0; align-self: start; height: 100vh; overflow: hidden; z-index: 20;
}
aside.sn > .brand, aside.sn > small, aside.sn > #side-note { display: none !important; }

.sn-top { flex-shrink: 0; }
.sn-logo {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%;
  min-height: 56px; padding: 9px 8px; border: 0; border-bottom: 1px solid rgba(255,255,255,.2);
  background: var(--sn-logo); color: #fff; cursor: pointer; position: relative;
}
.sn-mark { font-size: 17px; font-weight: 800; letter-spacing: .18em; line-height: 1; }
.sn-sub { font-size: 10.5px; color: rgba(255,255,255,.65); letter-spacing: .08em; }
.sn-mark-short { display: none; font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.sn-env {
  position: absolute; top: 6px; right: 6px; font-size: 9px; font-weight: 800; letter-spacing: .06em;
  background: #f5b400; color: #1d1d1d; border-radius: 3px; padding: 1px 4px;
}
.sn-bar { display: flex; align-items: center; padding: 4px 8px 4px 12px; border-bottom: 1px solid var(--sn-line); }
.sn-bar > span { font-size: 11px; color: rgba(255,255,255,.5); }
.sn-fold, .sn-unfold {
  border: 0; background: transparent; color: rgba(255,255,255,.6); font-size: 16px; line-height: 1; padding: 2px 6px; cursor: pointer;
}
.sn-fold { margin-left: auto; }
.sn-fold:hover, .sn-unfold:hover { color: #fff; }
.sn-unfold { display: none; width: 100%; height: 32px; border-bottom: 1px solid var(--sn-line); }
.sn-burger { display: none; }

html aside.sn #nav { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; gap: 0; }
.sn-list { overflow-y: auto; padding: 4px 0; flex: 1; min-height: 0; overscroll-behavior: contain; }
.sn-list.sn-bottom { flex: 0 1 auto; max-height: 45%; border-top: 1px solid rgba(255,255,255,.15); }
html aside.sn #nav .nav-group { margin: 0; flex: none; width: 100%; min-width: 0; order: 0; }

html aside.sn #nav .sn-head {
  display: flex; align-items: center; gap: 9px; width: 100%; border: 0; border-radius: 0; background: transparent;
  color: #fff; padding: 8px 12px; font-size: 13px; text-align: left; cursor: pointer; font-weight: 500;
}
html aside.sn #nav .sn-head:hover { background: var(--sn-hover); }
.sn-head .sn-ico { flex-shrink: 0; color: rgba(255,255,255,.72); }
.sn-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-chev { margin-left: auto; flex-shrink: 0; width: 13px; height: 13px; color: rgba(255,255,255,.4); transition: transform .12s; }
.sn-group.sn-open .sn-chev { transform: rotate(90deg); }
.sn-head.sn-here .sn-label { font-weight: 700; }

.sn-items { display: none; padding-bottom: 4px; }
.sn-group.sn-open .sn-items { display: block; }
.sn-fly-title { display: none; }

html aside.sn #nav .sn-item {
  display: block; width: 100%; border: 0; border-radius: 0; background: transparent; color: rgba(255,255,255,.8);
  padding: 6px 12px 6px 37px; font-size: 12.5px; text-align: left; font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html aside.sn #nav .sn-item.sn-loose { padding-left: 12px; }
html aside.sn #nav .sn-item:hover { background: var(--sn-hover); color: #fff; }
html aside.sn #nav .sn-item.active,
html aside.sn #nav .sn-solo.active { background: var(--sn-hover); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--sn-accent); }
html aside.sn #nav .sn-solo.active .sn-ico { color: #fff; }

/* ---------------------------------------------------------------- 접힘(아이콘 레일) */
html.sn-rail .sn-sub, html.sn-rail .sn-mark, html.sn-rail .sn-bar, html.sn-rail .sn-env { display: none; }
html.sn-rail .sn-mark-short { display: block; }
html.sn-rail .sn-logo { min-height: 46px; padding: 6px 2px; }
html.sn-rail .sn-unfold { display: block; }
html.sn-rail aside.sn #nav .sn-head { justify-content: center; padding: 0; height: 38px; }
html.sn-rail .sn-head .sn-label, html.sn-rail .sn-chev { display: none; }
html.sn-rail .sn-head.sn-here { background: var(--sn-hover); box-shadow: inset 3px 0 0 var(--sn-accent); }
html.sn-rail .sn-group.sn-open .sn-items { display: none; }
html.sn-rail .sn-list { overflow-x: hidden; }

/* 접힌 상태의 하위 목록: 아이콘 옆에 고정 위치로 — 레일의 스크롤 칸에 잘리지 않게 */
html.sn-rail .sn-group.sn-fly .sn-items {
  display: block; position: fixed; left: var(--sn-rail); width: 196px; z-index: 1000; overflow-y: auto;
  background: var(--sn-bg); border: 1px solid rgba(255,255,255,.1); border-radius: 0 6px 6px 0; padding: 4px 0;
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}
html.sn-rail .sn-group.sn-fly .sn-head { background: var(--sn-hover); }
html.sn-rail .sn-fly-title { display: block; padding: 3px 12px 5px; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.5); }
html.sn-rail aside.sn #nav .sn-item { padding-left: 12px; }

/* ---------------------------------------------------------------- 휴대폰(≤800px): 상단 바 + 드로어 */
@media (max-width: 800px) {
  html .shell, html.sn-rail .shell { grid-template-columns: minmax(0, 1fr); }
  html .shell > aside.sn { position: sticky; top: 0; height: auto; max-height: 100vh; overflow: visible; }
  .sn-top { display: flex; align-items: stretch; }
  .sn-logo { flex-direction: row; gap: 8px; min-height: 48px; width: auto; flex: 1; justify-content: flex-start; padding: 8px 14px; border-bottom: 0; }
  .sn-env { position: static; }
  .sn-bar { border-bottom: 0; padding: 0 6px; background: var(--sn-logo); }
  .sn-bar > span, .sn-fold, .sn-unfold { display: none !important; }
  .sn-burger { display: flex; align-items: center; justify-content: center; width: 44px; border: 0; background: transparent; color: #fff; cursor: pointer; }
  html.sn-rail .sn-mark, html.sn-rail .sn-sub, html.sn-rail .sn-bar, html.sn-rail .sn-env { display: revert; }
  html.sn-rail .sn-mark-short { display: none; }
  html aside.sn #nav { display: none; }
  html.sn-drawer aside.sn #nav { display: flex; max-height: calc(100vh - 48px); overflow-y: auto; }
  html.sn-drawer .sn-list { overflow: visible; max-height: none; }
  html aside.sn #nav > .sn-list { width: 100%; flex: none; }
  /* 레일 모양은 휴대폰에서 쓰지 않는다 */
  html.sn-rail aside.sn #nav .sn-head { justify-content: flex-start; padding: 10px 14px; height: auto; }
  html.sn-rail .sn-head .sn-label, html.sn-rail .sn-chev { display: revert; }
  html.sn-rail .sn-group.sn-open .sn-items { display: block; }
  html.sn-rail aside.sn #nav .sn-item { padding-left: 39px; }
  html aside.sn #nav { flex-direction: column; flex-wrap: nowrap; gap: 0; }
  html aside.sn #nav .sn-head { padding: 10px 14px; font-size: 14px; }
  html aside.sn #nav .sn-item { display: block; width: 100%; padding: 9px 14px 9px 39px; font-size: 13.5px; }
  html aside.sn #nav .sn-solo .sn-ico { margin-right: 0; }
}

@media print { html .shell > aside.sn { display: none; } html .shell { grid-template-columns: 1fr; } }

/* 본문은 화면 전체 폭을 쓴다(대표 지시 2026-11-16: 양옆 여백 과다) — 종전 max-width 1450px·좌우 42px */
html .shell > main { max-width: none; width: 100%; margin: 0; padding: 24px 28px 48px; box-sizing: border-box; min-width: 0; }
@media (max-width: 800px) { html .shell > main { padding: 18px 14px 40px; } }
