/* 미소 스터디 공통 — 화면 구성 안내 (study_app/*)
   틀 클래스는 모두 ms- 로 시작 → 각 페이지의 화면 모형 클래스와 겹치지 않음 */
:root { --g: #107c41; --gd: #0b5e31; --gl: #e7f3ec; --side: #0f1f17; --acc: #5fd49a; --tx: #1f2328; --sub: #667085; --ln: #e4e7ec; --bg: #f5f7f6; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Pretendard", "Segoe UI", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif; color: var(--tx); background: var(--bg); }
a { color: inherit; }

/* ── 화면 틀 ── */
.ms-app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.ms-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--side); color: #e9edf2; }
.ms-brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 18px; text-decoration: none; }
.ms-brand i { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--g); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 6px 16px -6px var(--g); overflow: hidden; }
.ms-brand i svg { width: 22px; height: 22px; }
.ms-brand b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.ms-brand.long b { font-size: 14px; letter-spacing: -0.04em; }
.ms-brand b em { font-style: normal; color: var(--acc); }
.ms-brand small { display: block; margin-top: 2px; font-size: 11px; word-break: keep-all; color: rgba(233, 237, 242, 0.55); font-weight: 600; }
.ms-menu { padding: 6px 10px; flex: 1; overflow: auto; }
.ms-menu h4 { margin: 10px 10px 8px; font-size: 11px; letter-spacing: 0.12em; color: rgba(233, 237, 242, 0.4); font-weight: 700; }
.ms-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-size: 14.5px; font-weight: 600; color: rgba(233, 237, 242, 0.78); }
.ms-menu a svg { width: 18px; height: 18px; flex: none; }
.ms-menu a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.ms-menu a.on { background: rgba(255, 255, 255, 0.1); color: #fff; box-shadow: inset 3px 0 0 var(--acc); }
.ms-others { margin-top: 18px; }
.ms-menu .ms-others a { padding: 6px 12px; font-size: 13px; font-weight: 500; gap: 9px; color: rgba(233, 237, 242, 0.6); }
.ms-others a i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.ms-menu .ms-others a.cur { color: #fff; font-weight: 700; }
.ms-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 12.5px; }
.ms-foot a { display: block; padding: 5px 0; color: rgba(233, 237, 242, 0.6); text-decoration: none; }
.ms-foot a:hover { color: #fff; }
.ms-main { min-width: 0; padding: 26px 30px 40px; }
.ms-page { display: none; }
.ms-page.on { display: block; }

.ms-ph { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ms-ph h1 { margin: 0; font-size: 26px; letter-spacing: -0.03em; }
.ms-ph h1 span { color: var(--g); }
.ms-ph p { margin: 6px 0 0; color: var(--sub); font-size: 14px; }
.ms-ver { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; background: var(--gl); color: var(--gd); font-size: 12px; font-weight: 700; }
.ms-sp { flex: 1; }
.ms-tbtn { border: 1px solid var(--ln); background: #fff; border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--tx); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.ms-tbtn:hover { border-color: var(--g); color: var(--gd); }
.ms-tbtn.on { background: var(--g); border-color: var(--g); color: #fff; }

.ms-lay { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.ms-stage { min-width: 0; }
.ms-fit { position: relative; overflow-x: auto; overflow-y: hidden; border-radius: 12px; box-shadow: 0 18px 40px -22px rgba(16, 28, 40, 0.45), 0 0 0 1px rgba(16, 28, 40, 0.08); background: #fff; }
.ms-fitin { position: relative; }

/* 설명 칸 */
.ms-info { position: sticky; top: 20px; background: #fff; border: 1px solid var(--ln); border-radius: 14px; padding: 18px 18px 16px; min-height: 220px; }
.ms-info .no { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: #f97316; color: #fff; font-size: 13px; font-weight: 800; margin-bottom: 10px; }
.ms-info h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.ms-info .en { margin-top: 3px; color: var(--sub); font-size: 13px; font-weight: 600; }
.ms-info .d { margin: 12px 0 0; font-size: 14.5px; line-height: 1.75; }
.ms-info .k { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--sub); }
.ms-info kbd { display: inline-block; padding: 2px 7px; border: 1px solid #d0d5dd; border-bottom-width: 2px; border-radius: 6px; background: #fff; font: 600 12px/1.5 "Segoe UI", "Malgun Gothic", sans-serif; color: var(--tx); }
.ms-info .hint { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--ln); font-size: 12.5px; color: var(--sub); line-height: 1.6; }
.ms-info .pin { float: right; font-size: 11.5px; color: #f97316; font-weight: 700; }
.ms-info.intro h2 { font-size: 18px; }
.ms-info.intro ul { margin: 10px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.8; color: #344054; }

/* 부분 목록 */
.ms-legend { margin-top: 22px; background: #fff; border: 1px solid var(--ln); border-radius: 14px; padding: 16px 16px 10px; }
.ms-legend h3 { margin: 0 0 4px; font-size: 16px; }
.ms-legend > p { margin: 0 0 12px; color: var(--sub); font-size: 13px; }
.ms-lg-grp { margin-bottom: 12px; }
.ms-lg-grp h5 { margin: 0 0 6px; font-size: 12px; color: var(--sub); font-weight: 700; letter-spacing: 0.04em; }
.ms-lg-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-lg-list button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ln); background: #fff; border-radius: 999px; padding: 5px 12px 5px 6px; font: inherit; font-size: 13px; color: var(--tx); cursor: pointer; }
.ms-lg-list button b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: #fff1e7; color: #c2410c; font-size: 11px; }
.ms-lg-list button:hover, .ms-lg-list button.on { border-color: #f97316; background: #fff7ed; }

/* ── 프로그램 화면 모형 (설계 크기 고정, 화면 폭에 맞춰 축소) ── */
.xl { position: relative; transform-origin: 0 0; font-family: "Segoe UI", "Malgun Gothic", "맑은 고딕", sans-serif; font-size: 12px; color: #242424; background: #fff; user-select: none; -webkit-user-select: none; overflow: hidden; outline: none; }
.xl svg { display: block; }
.xl [data-r] { cursor: default; }
.xl .i { display: inline-grid; place-items: center; }
.xl .i svg { width: 16px; height: 16px; }

.xl > .ms-hl { position: absolute; z-index: 50; pointer-events: none; border: 2px solid #f97316; background: rgba(249, 115, 22, 0.12); border-radius: 4px; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18); display: none; transition: left 0.08s, top 0.08s, width 0.08s, height 0.08s; }
.xl > .ms-hl.on { display: block; }
.xl > .ms-nos { position: absolute; inset: 0; z-index: 51; pointer-events: none; display: none; }
.xl.ms-show-no > .ms-nos { display: block; }
.xl > .ms-nos > b { position: absolute; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #f97316; color: #fff; font: 800 11px/19px "Segoe UI", sans-serif; text-align: center; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, 0.3); }

@media (max-width: 1460px) { .ms-lay { grid-template-columns: 1fr; } .ms-info { position: static; min-height: 0; } }
@media (max-width: 820px) {
    .ms-app { grid-template-columns: 1fr; }
    .ms-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .ms-brand { padding: 12px 14px; }
    .ms-menu { flex: 1 1 100%; display: flex; gap: 6px; padding: 0 10px 10px; overflow-x: auto; }
    .ms-menu h4, .ms-others { display: none; }
    .ms-menu a { white-space: nowrap; padding: 8px 12px; }
    .ms-foot { display: none; }
    .ms-main { padding: 18px 14px 30px; }
    .ms-ph h1 { font-size: 21px; }
}
@media print { .ms-side, .ms-legend, .ms-tbtn { display: none; } .ms-app { display: block; } }
