:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eef4ff;
  --primary-line: #c7d7fe;
  --bg: #f6f8fc;
  --card: #ffffff;
  --text: #111827;
  --text-2: #374151;
  --muted: #64748b;
  --border: #e6eaf2;
  --ok: #047857;
  --ok-soft: #e8f8f1;
  --err: #dc2626;
  --err-soft: #fef1f1;
  --warn: #b45309;
  --warn-soft: #fff6e6;
  --gray-soft: #f1f4f8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
}
html { font-size: 16px; }
html.large { font-size: 18.5px; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Pretendard', -apple-system, 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--primary-line); outline-offset: 2px; border-radius: 6px; }

/* ---------- 상단 ---------- */
header { background: var(--card); }
header .inner {
  max-width: 1040px; margin: 0 auto; padding: 0.875rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; cursor: pointer; }
.brand img { height: 2.375rem; width: auto; flex-shrink: 0; }
.brand h1 { font-size: 1.1875rem; font-weight: 700; margin: 0; line-height: 1.3; letter-spacing: -0.01em; }
.top-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.user-name { font-size: 0.9375rem; color: var(--muted); }
@media (max-width: 600px) {
  header .inner { padding: 0.75rem 1rem; }
  .brand h1 { font-size: 1rem; }
  .brand img { height: 1.875rem; }
  .user-name { display: none; }
}

.navbar {
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.navbar .inner {
  max-width: 1040px; margin: 0 auto; display: flex; gap: 0.25rem; padding: 0 0.75rem;
  overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.navbar .inner::-webkit-scrollbar { display: none; }
.navbar button {
  flex-shrink: 0; border: 0; background: transparent; font: inherit; font-size: 1rem; font-weight: 600;
  color: var(--muted); padding: 0.875rem 0.875rem; border-bottom: 3px solid transparent; cursor: pointer;
  min-height: 3rem;
}
.navbar button:hover { color: var(--text); }
.navbar button.active { color: var(--primary); border-bottom-color: var(--primary); }

main { max-width: 1040px; margin: 0 auto; padding: 1.75rem 1.25rem 3.5rem; min-height: 60vh; }
.narrow { max-width: 440px; margin: 0 auto; }
@media (max-width: 600px) { main { padding: 1.25rem 1rem 3rem; } }

/* ---------- 공통 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem 1.375rem; margin-bottom: 1rem;
}
.card h2 { margin: 0 0 0.375rem; font-size: 1.25rem; letter-spacing: -0.01em; }
.muted { color: var(--muted); font-size: 0.9375rem; }
.loading { text-align: center; color: var(--muted); padding: 2.5rem 0; }
.empty { text-align: center; color: var(--muted); padding: 2rem 0; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 2rem 0 0.875rem; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { margin: 0; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; }
.head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }

.tabs { display: flex; background: var(--gray-soft); border-radius: 12px; padding: 0.25rem; margin-bottom: 1.25rem; }
.tabs button {
  flex: 1; border: 0; background: transparent; padding: 0.625rem; border-radius: 10px; min-height: 2.75rem;
  font: inherit; font-size: 1rem; font-weight: 600; color: var(--muted); cursor: pointer;
}
.tabs button.active { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }

label { display: block; font-size: 0.9375rem; font-weight: 600; margin: 1rem 0 0.375rem; color: var(--text-2); }
label .req { color: var(--err); }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], input[type=datetime-local], textarea {
  width: 100%; padding: 0.75rem 0.875rem; font: inherit; font-size: 1rem; min-height: 3rem;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: auto; }
input:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
input:disabled { background: var(--gray-soft); color: var(--muted); }
.hint { font-size: 0.875rem; color: var(--muted); margin-top: 0.25rem; }
label.check { display: flex; gap: 0.5rem; align-items: center; margin-top: 1rem; font-weight: 500; color: var(--text); }
label.check input { width: 1.125rem; height: 1.125rem; }

.consent {
  margin-top: 1.25rem; padding: 0.875rem 1rem; background: var(--gray-soft); border-radius: 10px;
  font-size: 0.875rem; color: var(--muted); line-height: 1.7;
}
.consent label { display: flex; gap: 0.5rem; align-items: center; margin: 0.5rem 0 0; color: var(--text); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  border: 0; border-radius: 10px; padding: 0.75rem 1.125rem; min-height: 2.75rem;
  font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--primary); color: #fff; width: 100%; margin-top: 1.5rem; min-height: 3.25rem; font-size: 1.0625rem; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-small { background: var(--primary); color: #fff; padding: 0.5rem 0.875rem; font-size: 0.9375rem; min-height: 2.5rem; }
.btn-small:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; color: var(--text-2); border: 1px solid var(--border); padding: 0.5rem 0.875rem; font-size: 0.9375rem; min-height: 2.5rem; }
.btn-ghost:hover { border-color: #cbd5e1; }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #e0eaff; }
.btn-danger-outline { background: #fff; color: var(--err); border: 1px solid #fbb6b6; }
.btn-danger { background: var(--err); color: #fff; }
.btn-disabled { background: var(--gray-soft); color: var(--muted); cursor: not-allowed; }
.btn:disabled { opacity: .7; cursor: not-allowed; }
.font-toggle { background: var(--gray-soft); color: var(--text-2); padding: 0.375rem 0.75rem; font-size: 0.875rem; min-height: 2.375rem; }

.msg { margin-top: 1rem; padding: 0.75rem 0.875rem; border-radius: 10px; font-size: 0.9375rem; display: none; }
.msg.show { display: block; }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.err { background: var(--err-soft); color: var(--err); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }

.badges { display: flex; gap: 0.375rem; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8125rem; font-weight: 700;
  padding: 0.2rem 0.625rem; border-radius: 999px; line-height: 1.5;
}
.badge::before { content: ''; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-open { background: var(--primary-soft); color: var(--primary); }
.b-upcoming { background: var(--warn-soft); color: var(--warn); }
.b-full { background: var(--err-soft); color: var(--err); }
.b-closed { background: var(--gray-soft); color: var(--muted); }
.b-mine { background: var(--ok-soft); color: var(--ok); }
.b-wait { background: #f3efff; color: #6d28d9; }
.btn-wait { background: #6d28d9; color: #fff; }
.btn-wait:hover { background: #5b21b6; }
.wait-line {
  margin-top: 0.75rem; padding: 0.5rem 0.75rem; background: #f3efff; color: #6d28d9;
  border-radius: 10px; font-size: 0.9375rem; font-weight: 600;
}
.meta { font-size: 0.9375rem; color: var(--muted); }
.meta b { color: var(--text-2); font-weight: 600; margin-right: 0.25rem; }

/* ---------- 홈(공지사항) 대시보드 ---------- */
.hero {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; align-items: stretch;
  background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
  border: 1px solid var(--border); border-radius: 20px; padding: 2.25rem 2rem; box-shadow: var(--shadow);
}
.hero .eyebrow { display: inline-block; font-size: 0.875rem; font-weight: 700; color: var(--primary); background: #fff; border: 1px solid var(--primary-line); padding: 0.2rem 0.75rem; border-radius: 999px; }
.hero h2 { font-size: 1.875rem; line-height: 1.35; margin: 0.875rem 0 0.625rem; letter-spacing: -0.03em; }
.hero p { margin: 0; color: var(--text-2); }
.hero-actions { display: flex; gap: 0.625rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-actions .btn { min-height: 3rem; padding: 0.75rem 1.375rem; }
.next-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.375rem;
  display: flex; flex-direction: column; justify-content: center; gap: 0.375rem;
}
.next-card .label { font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.next-card .title { font-size: 1.125rem; font-weight: 700; line-height: 1.4; }
.next-card .count { font-size: 2rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.3; }
.next-card .btn { margin-top: 0.5rem; align-self: flex-start; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 1.5rem 1.25rem; }
  .hero h2 { font-size: 1.5rem; }
  .hero-actions .btn { flex: 1; }
}

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.875rem; margin-top: 1rem; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.125rem 1.25rem; cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: border-color .15s, transform .15s;
}
.stat:hover { border-color: var(--primary-line); transform: translateY(-1px); }
.stat .k { font-size: 0.9375rem; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
.stat .v small { font-size: 1rem; font-weight: 600; color: var(--muted); margin-left: 0.125rem; }
.stat.s-open .v { color: var(--primary); }
.stat.s-upcoming .v { color: var(--warn); }
.stat.s-done .v { color: var(--muted); }
@media (max-width: 600px) {
  .stats { gap: 0.5rem; }
  .stat { padding: 0.875rem 0.75rem; }
  .stat .k { font-size: 0.8125rem; }
  .stat .v { font-size: 1.375rem; }
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.875rem; }
.step { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.step .num {
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9375rem;
}
.step h3 { margin: 0.625rem 0 0.25rem; font-size: 1.0625rem; }
.step p { margin: 0; font-size: 0.9375rem; color: var(--muted); line-height: 1.6; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- 접고 펴는 목록 (공지 / FAQ) ---------- */
.acc { padding: 0.25rem 1.375rem; }
.acc-item { border-bottom: 1px solid var(--border); }
.acc-item:last-child { border-bottom: 0; }
.acc-head {
  width: 100%; display: flex; align-items: center; gap: 0.625rem; text-align: left; min-height: 3.5rem;
  border: 0; background: transparent; font: inherit; padding: 1rem 0; cursor: pointer; color: var(--text);
}
.acc-head .title { flex: 1; font-weight: 600; font-size: 1.0625rem; }
.acc-head .date { font-size: 0.875rem; color: var(--muted); flex-shrink: 0; }
.acc-head .arrow {
  width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--gray-soft); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .2s; font-size: 0.75rem;
}
.acc-item.open .arrow { transform: rotate(180deg); background: var(--primary-soft); color: var(--primary); }
.acc-body { display: none; padding: 0 0 1.25rem; white-space: pre-line; color: var(--text-2); line-height: 1.8; }
.acc-item.open .acc-body { display: block; }
.q-mark {
  width: 1.75rem; height: 1.75rem; border-radius: 8px; background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.875rem; flex-shrink: 0;
}
@media (max-width: 600px) {
  .acc { padding: 0.25rem 1rem; }
  .acc-head .date { display: none; }
}

/* ---------- 과정 신청 ---------- */
.filters { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; margin-bottom: 1rem; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; border: 1px solid var(--border); background: #fff; color: var(--text-2);
  font: inherit; font-size: 0.9375rem; font-weight: 600; padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer; min-height: 2.5rem;
}
.chip .n { color: var(--muted); font-weight: 700; margin-left: 0.25rem; }
.chip.active { background: var(--text); border-color: var(--text); color: #fff; }
.chip.active .n { color: #cbd5e1; }

.course-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 760px) { .course-grid { grid-template-columns: 1fr; } }
.course { display: flex; flex-direction: column; margin-bottom: 0; position: relative; overflow: hidden; }
.course::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--border); }
.course.st-open::before { background: var(--primary); }
.course.st-upcoming::before { background: #f59e0b; }
.course.st-full::before { background: var(--err); }
.course h3 { margin: 0.625rem 0 0.5rem; font-size: 1.1875rem; line-height: 1.4; letter-spacing: -0.01em; }
.course .info { display: grid; gap: 0.125rem; }
.desc { font-size: 0.9375rem; margin: 0.75rem 0 0; white-space: pre-line; color: var(--text-2); }
.countdown-line {
  margin-top: 0.75rem; padding: 0.5rem 0.75rem; background: var(--warn-soft); color: var(--warn);
  border-radius: 10px; font-size: 0.9375rem; font-weight: 600;
}
.countdown-line span { font-variant-numeric: tabular-nums; font-weight: 800; }
.seats { margin-top: auto; padding-top: 1rem; }
.seats .bar { height: 0.5rem; background: var(--gray-soft); border-radius: 999px; overflow: hidden; }
.seats .bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.seats .bar span.full { background: var(--err); }
.seats .txt { display: flex; justify-content: space-between; font-size: 0.875rem; color: var(--muted); margin-top: 0.375rem; }
.seats .txt b { color: var(--text); font-size: 1rem; }
.course .action { width: 100%; margin-top: 1rem; min-height: 3.125rem; }

/* ---------- 목록형 (마이페이지 / 관리자) ---------- */
.app-item {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  padding: 1rem 0; border-bottom: 1px solid var(--border);
}
.app-item:last-child { border-bottom: 0; }
.app-item .t { font-weight: 700; margin: 0.25rem 0 0.125rem; }
.app-item .btn { padding: 0.5rem 0.75rem; font-size: 0.9375rem; white-space: nowrap; min-height: 2.5rem; }

/* ---------- 관리자 ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 760px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-course { margin-bottom: 0; }
.admin-course h3 { margin: 0.625rem 0 0.5rem; font-size: 1.125rem; }
.admin-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
.panel { border: 2px solid var(--primary); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.375rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.75rem; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.danger-zone {
  margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
}
.danger-zone .btn { white-space: nowrap; }
.inline-row { display: flex; gap: 0.5rem; }
.inline-row input { max-width: 9rem; }
.summary { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; margin-top: 0.75rem; }
table.list { width: 100%; border-collapse: collapse; font-size: 0.9375rem; white-space: nowrap; }
table.list th, table.list td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
table.list th { background: var(--gray-soft); color: var(--muted); font-weight: 600; }
table.list td .btn { padding: 0.3rem 0.625rem; font-size: 0.875rem; min-height: 2rem; }
details { margin-top: 1rem; }
summary { cursor: pointer; color: var(--muted); font-size: 0.9375rem; }

/* ---------- 개인정보처리방침 ---------- */
.policy h3 { font-size: 1.0625rem; margin: 1.5rem 0 0.375rem; }
.policy p, .policy li { color: var(--text-2); }
.policy ul { padding-left: 1.25rem; margin: 0.25rem 0; }

/* ---------- 하단 ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--border); }
.site-footer .inner {
  max-width: 1040px; margin: 0 auto; padding: 2rem 1.25rem 2.5rem;
  display: grid; grid-template-columns: 1fr auto; gap: 1.25rem 2rem; align-items: start;
}
.f-title { font-weight: 700; font-size: 1.0625rem; margin-bottom: 0.625rem; }
.f-contact { display: grid; gap: 0.25rem; font-size: 0.9375rem; color: var(--text-2); }
.f-contact b { display: inline-block; min-width: 4.5rem; color: var(--muted); font-weight: 600; }
.f-contact a { color: var(--text-2); text-decoration: none; }
.f-contact a:hover { color: var(--primary); text-decoration: underline; }
.f-links { display: flex; gap: 1rem; font-size: 0.9375rem; }
.f-links button { border: 0; background: none; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; padding: 0; }
.f-links button:hover { color: var(--primary); }
.f-copy { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--muted); }
@media (max-width: 600px) { .site-footer .inner { grid-template-columns: 1fr; padding: 1.5rem 1rem 2rem; } }

/* ---------- 알림(토스트) ---------- */
#toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(20px);
  max-width: calc(100% - 2rem); padding: 0.875rem 1.25rem; border-radius: 12px;
  font-size: 1rem; font-weight: 600; color: #fff; background: #111827; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok { background: var(--ok); }
#toast.err { background: var(--err); }

/* ---------- 챗봇 ---------- */
#chatFab {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40;
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--primary); color: #fff; border: 0; border-radius: 999px;
  padding: 0.875rem 1.25rem; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .35);
}
#chatFab:hover { background: var(--primary-dark); }
#chatFab svg { width: 1.25rem; height: 1.25rem; }
#chatPanel {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 45;
  width: 380px; max-width: calc(100vw - 2.5rem); height: min(620px, calc(100vh - 2.5rem));
  background: #fff; border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 16px 48px rgba(16, 24, 40, .2);
  display: none; flex-direction: column; overflow: hidden;
}
#chatPanel.open { display: flex; }
.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.875rem 1rem; background: var(--primary); color: #fff;
}
.chat-head .ttl { font-weight: 700; }
.chat-head .sub { font-size: 0.8125rem; opacity: .85; }
.chat-head button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; width: 2.25rem; height: 2.25rem; font-size: 1.125rem; cursor: pointer; }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; background: var(--bg); display: flex; flex-direction: column; gap: 0.625rem; }
.bubble { max-width: 85%; padding: 0.625rem 0.875rem; border-radius: 14px; font-size: 0.9375rem; line-height: 1.65; white-space: pre-line; }
.bubble.bot { background: #fff; border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.user { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble .src { display: block; margin-top: 0.375rem; font-size: 0.75rem; color: var(--muted); }
.bubble.typing { color: var(--muted); }
.chat-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; align-self: flex-start; max-width: 100%; }
.chat-chips button {
  background: #fff; border: 1px solid var(--primary-line); color: var(--primary);
  border-radius: 999px; padding: 0.375rem 0.75rem; font: inherit; font-size: 0.875rem; cursor: pointer; text-align: left;
}
.chat-chips button:hover { background: var(--primary-soft); }
.chat-foot { border-top: 1px solid var(--border); padding: 0.625rem; background: #fff; }
.chat-form { display: flex; gap: 0.5rem; }
.chat-form input { flex: 1; min-height: 2.75rem; padding: 0.5rem 0.75rem; font-size: 0.9375rem; }
.chat-form button { flex-shrink: 0; min-height: 2.75rem; padding: 0.5rem 1rem; }
.chat-note { font-size: 0.75rem; color: var(--muted); margin-top: 0.375rem; line-height: 1.5; }
@media (max-width: 600px) {
  #chatFab { right: 1rem; bottom: 1rem; padding: 0.75rem 1rem; }
  #chatFab .lbl { display: none; }
  #chatPanel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 85vh; border-radius: 20px 20px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
  

/* =========================================================
   연수 운영 확장 (강사 · 관리자 · 문의 게시판)
   ========================================================= */
select {
  width: 100%; padding: 0.75rem 0.875rem; font: inherit; font-size: 1rem; min-height: 3rem;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}
select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.select-sm { width: auto; min-height: 2.5rem; padding: 0.375rem 2rem 0.375rem 0.75rem; font-size: 0.9375rem; }

body.wide main, body.wide header .inner, body.wide .navbar .inner, body.wide .site-footer .inner { max-width: 1240px; }

.role-badge {
  display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.125rem 0.5rem; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); margin-left: 0.375rem; vertical-align: middle;
}
.role-links { display: flex; gap: 0.375rem; }
.role-links a { text-decoration: none; }
@media (max-width: 600px) { .role-links { display: none; } }

.subtabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* 숫자 요약 카드 */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.875rem; margin-bottom: 1rem; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.125rem; }
.kpi .k { font-size: 0.875rem; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.35; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 0.9375rem; color: var(--muted); font-weight: 600; margin-left: 0.125rem; }
.kpi .s { font-size: 0.8125rem; color: var(--muted); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

/* 진행률 막대 */
.meter { height: 0.5rem; background: var(--gray-soft); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.meter span.ok { background: var(--ok); }
.meter span.low { background: #f59e0b; }
.meter-row { display: flex; align-items: center; gap: 0.625rem; }
.meter-row .meter { flex: 1; min-width: 4rem; }
.meter-row .pct { font-size: 0.875rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.25rem; text-align: right; }

/* 차시 목록 */
.sess-list { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.sess {
  display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem 0.875rem;
  background: var(--gray-soft); border-radius: 12px; font-size: 0.9375rem;
}
.sess .no {
  flex-shrink: 0; min-width: 2.75rem; text-align: center; font-weight: 800; font-size: 0.8125rem;
  color: var(--primary); background: #fff; border: 1px solid var(--primary-line); border-radius: 8px; padding: 0.125rem 0.375rem;
}
.sess .body { flex: 1; min-width: 0; }
.sess .when { font-weight: 700; }
.sess .sub { color: var(--muted); font-size: 0.875rem; }
.sess .side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 0.375rem; }
.sess.past { opacity: .75; }
.mode-tag { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.0625rem 0.5rem; border-radius: 999px; margin-left: 0.25rem; }
.mode-offline { background: #eef7f2; color: #047857; }
.mode-online { background: #eef4ff; color: #1d4ed8; }
.zoom-box { margin-top: 0.375rem; font-size: 0.875rem; }
.zoom-box a { font-weight: 700; }
details.sched { margin-top: 0.75rem; }
details.sched summary { font-size: 0.9375rem; font-weight: 600; color: var(--primary); }

/* 출석 상태 */
.att { display: inline-flex; gap: 0.25rem; }
.att button {
  border: 1px solid var(--border); background: #fff; color: var(--muted); font: inherit; font-size: 0.8125rem; font-weight: 700;
  padding: 0.25rem 0.625rem; border-radius: 8px; cursor: pointer; min-height: 2rem;
}
.att button.on-present { background: var(--ok-soft); border-color: #9ad8bd; color: var(--ok); }
.att button.on-late { background: var(--warn-soft); border-color: #f5cf8f; color: var(--warn); }
.att button.on-absent { background: var(--err-soft); border-color: #fbb6b6; color: var(--err); }
.st { font-size: 0.8125rem; font-weight: 700; padding: 0.125rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.st-present { background: var(--ok-soft); color: var(--ok); }
.st-late { background: var(--warn-soft); color: var(--warn); }
.st-absent { background: var(--err-soft); color: var(--err); }
.st-none { background: var(--gray-soft); color: var(--muted); }

/* 표 */
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list tr.warn td { background: #fffaf0; }
table.list tfoot td { font-weight: 700; background: var(--gray-soft); }
table.list input, table.list select { min-height: 2.25rem; padding: 0.25rem 0.5rem; font-size: 0.875rem; border-radius: 8px; }
table.list input[type=number] { width: 7rem; text-align: right; }

/* 파일 */
.file-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.file-row input[type=file] { flex: 1; min-width: 12rem; font-size: 0.9375rem; }
.file-icon {
  flex-shrink: 0; width: 2.5rem; height: 2.5rem; border-radius: 10px; background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 800; text-transform: uppercase;
}

/* 문의 게시판 */
.q-list .acc-head .q-meta { font-size: 0.8125rem; color: var(--muted); flex-shrink: 0; }
.q-answer { margin-top: 0.875rem; padding: 0.875rem 1rem; background: var(--primary-soft); border-radius: 12px; color: var(--text-2); white-space: pre-line; }
.q-answer b { color: var(--primary); display: block; margin-bottom: 0.25rem; }
.pager { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.75rem; }

/* 정산 상태 */
.c-unconfirmed { background: var(--gray-soft); color: var(--muted); }
.c-amount_ok { background: var(--primary-soft); color: var(--primary); }
.c-received { background: var(--ok-soft); color: var(--ok); }
.c-disputed { background: var(--err-soft); color: var(--err); }
.money { font-variant-numeric: tabular-nums; }
.calc-note { font-size: 0.8125rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.6; }

.notice-box { padding: 0.875rem 1rem; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 0.9375rem; margin-bottom: 1rem; }
.gate { max-width: 440px; margin: 2rem auto; text-align: center; }
.gate h2 { margin: 0 0 0.5rem; }

.link-btn { border: 0; background: none; padding: 0.25rem; font: inherit; font-size: 0.9375rem; color: var(--muted); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--primary); }
.mail-status-queued, .mail-status-sending { background: var(--warn-soft); color: var(--warn); }
.mail-status-sent { background: var(--ok-soft); color: var(--ok); }
.mail-status-failed { background: var(--err-soft); color: var(--err); }

/* ---------- 팝업 창 ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .45);
  display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow-y: auto;
}
.modal {
  width: 100%; max-width: 640px; background: var(--card); border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .3); padding: 1.5rem 1.375rem; margin-bottom: 4vh;
}
.modal.wide { max-width: 920px; }
.modal .panel-head { margin-bottom: 0.5rem; }
body.modal-open { overflow: hidden; }
@media (max-width: 600px) { .modal-wrap { padding: 0; } .modal { border-radius: 0; min-height: 100%; margin: 0; } }

/* ---------- 이수증 ---------- */
.cert-stage { position: fixed; left: -10000px; top: 0; }
.cert-page {
  width: 794px; height: 1123px; background: #fff; padding: 48px; box-sizing: border-box;
  font-family: 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; color: #111827;
}
.cert-border {
  height: 100%; border: 3px double #1e3a8a; padding: 64px 72px; box-sizing: border-box;
  display: flex; flex-direction: column; position: relative;
}
.cert-no { font-size: 15px; color: #374151; }
.cert-title { text-align: center; font-size: 46px; font-weight: 800; letter-spacing: 0.6em; margin: 56px 0 56px 0.6em; }
.cert-info { width: 100%; border-collapse: collapse; font-size: 18px; }
.cert-info th { width: 150px; text-align: left; font-weight: 700; padding: 10px 0; color: #1f2937; vertical-align: top; }
.cert-info td { padding: 10px 0; }
.cert-body { font-size: 21px; line-height: 2; margin: 64px 0 0; text-align: center; word-break: keep-all; }
.cert-date { text-align: center; font-size: 19px; margin-top: auto; }
.cert-issuer { text-align: center; font-size: 28px; font-weight: 800; margin-top: 40px; position: relative; display: inline-block; align-self: center; }
.cert-issuer img { position: absolute; right: -78px; top: 50%; transform: translateY(-50%); width: 92px; height: 92px; object-fit: contain; opacity: .9; }
.warn-line { padding: 0.75rem 0.875rem; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 0.9375rem; margin-bottom: 1rem; }

/* ---------- v4: 과정 선택·다운로드 ---------- */
.select-bar { display: flex; align-items: center; gap: 0.75rem 1rem; flex-wrap: wrap; padding: 0.875rem 1.25rem; margin-bottom: 1rem; }
.select-bar .head-actions { margin-left: auto; }
.admin-course { position: relative; }
.admin-course .course-sel { position: absolute; top: 0.875rem; right: 0.875rem; margin: 0; padding: 0.25rem; cursor: pointer; }
.admin-course .course-sel input { width: 1.125rem; height: 1.125rem; cursor: pointer; }
.admin-course h3 { padding-right: 1.75rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
