/* AI 선도학교 운영모델 (assets/js/model.js) */
.md .md-lead { margin: 0 0 14px; font-size: 16px; line-height: 1.75; color: var(--ink-2); }
.md-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--s); color: var(--c); font-size: 13px; font-weight: 800; white-space: nowrap; }
.md-badge.sm { padding: 1px 7px; font-size: 12px; }
.md-group { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }

/* 원본 PDF 내려받기 배너 */
.md-pdf { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px 18px; padding: 18px 22px; border-radius: 16px;
  background: linear-gradient(110deg, #0f2a5f 0%, #1d4fa8 58%, #2f7cf0 100%); color: #fff; box-shadow: 0 10px 26px rgba(15, 42, 95, .18); overflow: hidden; }
.md-pdf::after { content: ""; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none; }
.md-pdf-ic { position: relative; display: grid; place-items: center; width: 54px; height: 62px; border-radius: 10px; background: #fff; color: #d6453d; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.md-pdf-ic svg { width: 32px; height: 32px; }
.md-pdf-ic i { position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%); padding: 0 5px; border-radius: 4px; background: #d6453d; color: #fff; font: 800 10.5px/1.5 inherit; font-style: normal; letter-spacing: .03em; }
.md-pdf-txt { position: relative; z-index: 1; display: grid; gap: 4px; min-width: 0; }
.md-pdf-txt b { font-size: 18px; line-height: 1.4; letter-spacing: -.01em; }
.md-pdf-txt span { font-size: 14px; line-height: 1.55; color: #dbe7ff; }
.md-pdf-txt small { font-size: 12.5px; line-height: 1.55; color: #b9cdf5; }
.md-pdf-act { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.md-pdf-act .btn { min-height: 42px; padding: 0 16px; font-size: 14.5px; white-space: nowrap; }
.md-pdf-act .btn-primary { background: #fff; color: var(--navy); border-color: #fff; }
.md-pdf-act .btn-primary:hover { background: #eef4ff; }
.md-pdf-act .btn-line { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .55); }
.md-pdf-act .btn-line:hover { background: rgba(255, 255, 255, .22); }
.md-pdf-act .btn-view .icon, .md-pdf-act .btn-view svg { color: inherit; }
.md-pdf-bar { grid-column: 1 / -1; position: relative; z-index: 1; }
.md-pdf.nofile { background: #f5f7fb; color: var(--ink); box-shadow: inset 0 0 0 2px #c9d5f5; border: 0; }
.md-pdf.nofile::after { display: none; }
.md-pdf.nofile .md-pdf-ic { background: #fff; color: #9aa6bd; box-shadow: none; }
.md-pdf.nofile .md-pdf-ic i { background: #9aa6bd; }
.md-pdf.nofile .md-pdf-txt span { color: var(--ink-2); }
.md-pdf.nofile .md-pdf-act .btn-line { background: #fff; color: var(--navy); border-color: #c9d5f5; }
@media (max-width: 760px) {
  .md-pdf { grid-template-columns: auto 1fr; padding: 16px; }
  .md-pdf-act { grid-column: 1 / -1; justify-content: stretch; }
  .md-pdf-act .btn { flex: 1 1 auto; justify-content: center; }
  .md-pdf-txt b { font-size: 16px; }
}

/* 만든 과정 */
.md-flow { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: f; }
.md-flow li { position: relative; display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); text-align: center; }
.md-flow li b { font-size: 20px; color: var(--navy); }
.md-flow li span { font-size: 13px; color: var(--ink-2); }
.md-flow li + li::before { content: "→"; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 700; }
.md-insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.md-insights > div { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.md-insights b { color: var(--navy); font-size: 15.5px; }
.md-insights span { font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.md-roles { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 10px; }
.md-roles > div { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); font-size: 13.5px; color: var(--ink-2); }
.md-roles > div b { font-size: 14.5px; color: var(--ink); }
.md-roles > .me { background: #fff4e5; box-shadow: inset 0 0 0 2px #f2b766; }
.md-roles > .me b { color: #b45309; }

/* 모델 카드 */
.md-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.md-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: 14px; background: #fff; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.md-card:hover, .md-card:focus-visible { box-shadow: 0 8px 22px rgba(15, 42, 95, .1); transform: translateY(-2px); outline: none; }
.md-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.md-card h3 { margin: 0; font-size: 16.5px; line-height: 1.4; color: var(--ink); }
.md-card p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.md-when { display: grid; gap: 4px; margin-top: auto; padding: 10px; border-radius: 10px; background: var(--s); font-size: 13px; color: var(--ink-2); }
.md-when b { color: var(--c); font-size: 12.5px; }
.md-when span::before { content: "· "; }
.md-star { align-self: flex-start; padding: 6px 12px; border: 1px solid var(--c); border-radius: 999px; background: #fff; color: var(--c); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.md-star.on { background: var(--c); color: #fff; }
.md-all { margin-top: 12px; }
.md-all > summary, .md-reach > summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 6px 0; }
.md-matrix th { vertical-align: top; font-size: 13px; line-height: 1.4; }
.md-matrix td { vertical-align: top; min-width: 150px; font-size: 13.5px; line-height: 1.5; }

/* 시작하는 순서 */
.md-start { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.md-start li { display: grid; align-content: start; gap: 6px; padding: 14px; border-radius: 12px; background: var(--bg-2); font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.md-start .no, .md-stages .no { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: 14px; }
.md-start b { font-size: 15px; color: var(--ink); }

/* 모델별 자세히 */
.md-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.md-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.md-tabs button[aria-selected="true"] { border-color: var(--c); background: var(--s); color: var(--ink); box-shadow: inset 0 0 0 1px var(--c); }
.md-detail { display: grid; gap: 16px; }
.md-dhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 12px; border-bottom: 3px solid var(--s); }
.md-dhead h3 { margin: 8px 0 6px; font-size: 21px; color: var(--ink); }
.md-dhead p { margin: 0 0 4px; line-height: 1.65; color: var(--ink-2); }
.md-h { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 16px; color: var(--navy); }
.md-h .ic { width: 18px; height: 18px; color: var(--c, var(--navy)); }
.md-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.md-stages li { display: grid; align-content: start; gap: 6px; padding: 12px; border-radius: 12px; background: var(--s); font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.md-stages .no { background: var(--c); }
.md-stages b { font-size: 14.5px; color: var(--ink); }
.md-stages li.weak { box-shadow: inset 0 0 0 2px #e03131; background: #fff5f5; }
.md-stages li.weak::after { content: "먼저 채울 단계"; justify-self: start; padding: 1px 8px; border-radius: 999px; background: #e03131; color: #fff; font-size: 12px; font-weight: 700; }
.md-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.md-box { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.md-box ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.md-box.warn { background: #fffaf0; border-color: #f5d9a8; }
.md-levels { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0; font-size: 14px; line-height: 1.6; }
.md-levels dt { font-weight: 800; color: var(--c); }
.md-levels dd { margin: 0; color: var(--ink-2); }
.md-reach .tbl th, .md-reach .tbl td { font-size: 13.5px; line-height: 1.55; vertical-align: top; }

/* 점검표 */
.md-check-wrap { padding: 14px 16px; border-radius: 12px; background: var(--bg-2); }
.md-check { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; counter-reset: c; }
.md-check li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #fff; counter-increment: c; }
.md-check label { display: flex; align-items: center; gap: 10px; flex: 1; font-size: 14.5px; line-height: 1.5; cursor: pointer; }
.md-check label::before { content: counter(c); flex: none; width: 22px; text-align: right; color: var(--ink-3); font-size: 13px; font-weight: 700; }
.md-check input { flex: none; width: 18px; height: 18px; accent-color: var(--c); }
.md-check input:disabled + span { color: var(--ink-2); }
.md-st { flex: none; font-size: 12px; font-weight: 700; color: var(--c); }
.md-result { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: #fff; border: 1px dashed var(--c); font-size: 14.5px; line-height: 1.6; }
.md-result .ic { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--c); }

/* 적용 계획 · 관리자 현황 */
.md-picked { display: flex; flex-wrap: wrap; gap: 8px; }
.md-pick { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--s); color: var(--ink); font-weight: 700; font-size: 14px; }
#md-memo { min-height: 110px; }
.md-pickbar { display: grid; gap: 8px; margin-bottom: 12px; }
.md-pb { display: grid; grid-template-columns: minmax(0, 300px) 1fr 50px; align-items: center; gap: 10px; font-size: 14px; }
.md-pb b { text-align: right; }
.md-common { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.7; color: var(--ink-2); }
.md-src { margin: 14px 0 0; line-height: 1.6; }

/* AI 적용 도우미 */
.md-coach { margin-top: 16px; padding: 16px; border-radius: 14px; background: linear-gradient(180deg, #f3f6ff 0%, #fbfcff 100%); box-shadow: inset 0 0 0 1px #d9e2fb; }
.md-coach-head { display: flex; gap: 12px; align-items: flex-start; }
.md-coach-head > div { display: grid; gap: 2px; }
.md-coach-head b { font-size: 16px; color: var(--navy); }
.md-coach-head span { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.md-coach-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #4f7cff, #9b5cff); color: #fff; }
.md-coach-ic .ic { width: 20px; height: 20px; }
.md-coach-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.md-coach-chips button { padding: 7px 12px; border: 1px solid #c9d5f5; border-radius: 999px; background: #fff; color: var(--navy); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
@media (max-width: 600px) { .md-coach-chips button { border-radius: 14px; font-size: 13px; } }
.md-coach-chips button:hover, .md-coach-chips button:focus-visible { border-color: #4f7cff; background: #eef3ff; }
.md-coach-log { display: grid; gap: 12px; }
.md-coach-log:not(:empty) { margin-bottom: 12px; }
.md-qa { display: grid; gap: 8px; }
.md-q { justify-self: end; max-width: 85%; padding: 9px 14px; border-radius: 14px 14px 4px 14px; background: var(--navy); color: #fff; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; }
.md-a { padding: 12px 16px; border-radius: 4px 14px 14px 14px; background: #fff; box-shadow: 0 1px 4px rgba(15, 42, 95, .08); font-size: 14.5px; line-height: 1.75; color: var(--ink); overflow-wrap: anywhere; }
.md-a h3, .md-a h4 { margin: 10px 0 4px; font-size: 15px; color: var(--navy); }
.md-a h3:first-child, .md-a h4:first-child { margin-top: 0; }
.md-a ul, .md-a ol { margin: 4px 0; padding-left: 20px; }
.md-a p { margin: 4px 0; }
.md-wait { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); }
.md-wait .ic { width: 16px; height: 16px; animation: md-spin 1.6s linear infinite; }
@keyframes md-spin { to { transform: rotate(360deg); } }
.md-err { margin: 6px 0 0; color: #c0392b; font-weight: 600; }
.md-a-act { display: flex; gap: 6px; margin-top: 10px; }
.md-coach-form { display: flex; gap: 8px; align-items: stretch; }
.md-coach-form textarea { flex: 1; min-height: 52px; resize: vertical; }
.md-coach-form .btn { flex: none; }
.md-coach-note { margin: 8px 0 0; }

@media (max-width: 1180px) {
  .md-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md-start, .md-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .md-flow, .md-insights, .md-roles, .md-two { grid-template-columns: 1fr; }
  .md-flow li + li::before { content: "↓"; left: 50%; top: -14px; transform: translateX(-50%); }
  .md-flow { gap: 16px; }
  .md-cards, .md-start, .md-stages { grid-template-columns: 1fr; }
  .md-dhead { flex-direction: column; }
  .md-pb { grid-template-columns: 1fr 50px; }
  .md-pb .progress { grid-column: 1 / -1; grid-row: 2; }
}
@media print { .md-star, .md-tabs, #md-csv { display: none; } }
