/* Global Campus design system — bright, professional, accessible.
   Contrast (on #fff): text #0f172a 17.9:1, muted #475569 7.6:1, primary #1d4ed8 6.7:1, teal #0f766e 5.5:1, danger #b91c1c 6.5:1. */
:root {
  --bg: #f6f8fc; --surface: #ffffff; --surface-2: #f1f5fb; --line: #e2e8f0; --line-2: #cbd5e1;
  --text: #0f172a; --muted: #475569; --primary: #1d4ed8; --primary-600: #2563eb; --primary-50: #eff6ff;
  --teal: #0f766e; --teal-50: #ecfdf5; --amber: #92400e; --amber-50: #fffbeb; --danger: #b91c1c; --danger-50: #fef2f2;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.06);
  --font: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; font-size: 16px; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-600); }
:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { inset-inline-start: 8px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.role-map { margin-block: 24px; border-inline-start: 4px solid var(--teal); }
.role-map ul { margin: 8px 0 16px; padding-inline-start: 1.25rem; color: var(--muted); }
.role-map li { margin-block: 6px; }
.rtl { direction: rtl; }
.rtl .topbar .wrap, .rtl .nav, .rtl .actions { direction: rtl; }
.rtl .skip { inset-inline-start: -999px; }
.rtl .skip:focus { inset-inline-start: 8px; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--primary), var(--teal)); display: inline-grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 800; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--primary-50); color: var(--primary); }
.lang { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 30px 6px 12px; font: inherit; font-size: .9rem; color: var(--text); width: auto; min-height: 38px; margin-inline-start: 6px; }
.nav #navPortal { background: var(--primary); color: #fff; margin-inline-start: 6px; }
.nav #navPortal:hover, .nav #navPortal[aria-current="page"] { background: var(--primary-600); color: #fff; }
@media (max-width: 640px) { .topbar .wrap { padding-block: 8px; } .nav { margin-inline-start: 0; width: 100%; justify-content: space-between; } .nav a { padding: 6px 8px; font-size: .88rem; } }

/* Buttons */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px;
  padding: 10px 18px; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; background: var(--primary); color: #fff; text-decoration: none; min-height: 44px; }
.btn:hover, button:hover { background: var(--primary-600); color: #fff; }
.btn.secondary, button.secondary { background: #fff; color: var(--primary); border-color: #bfdbfe; }
.btn.secondary:hover, button.secondary:hover { background: var(--primary-50); color: var(--primary); }
button.ghost { background: transparent; color: var(--muted); border-color: var(--line-2); }
button.ghost:hover { background: var(--surface-2); color: var(--text); }
button.danger { background: #fff; color: var(--danger); border-color: #fecaca; }
button:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Hero */
.hero { background: radial-gradient(1200px 400px at 85% -10%, #dbeafe 0%, transparent 60%), radial-gradient(900px 400px at -10% 110%, #ccfbf1 0%, transparent 55%), #fff; border-bottom: 1px solid var(--line); }
.hero .wrap { padding-block: clamp(40px, 8vw, 96px); display: grid; gap: 28px; }
.eyebrow { display: inline-block; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--teal); margin-bottom: 10px; }
.lead { font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--muted); max-width: 46rem; }
.searchbar { display: grid; gap: 10px; grid-template-columns: 1fr; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); max-width: 980px; }
.searchbar label { font-size: .78rem; font-weight: 700; color: var(--muted); display: grid; gap: 4px; }
@media (min-width: 768px) { .searchbar { grid-template-columns: 1.3fr 1fr .7fr 1.2fr auto; align-items: end; } }

/* Sections & cards */
section.block { padding-block: clamp(36px, 6vw, 72px); }
section.block.alt { background: #fff; border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.two, .grid.three, .grid.four { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.four { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3 { margin-bottom: 6px; }
.role-card .icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; background: var(--primary-50); color: var(--primary); }
.role-card.teal .icon { background: var(--teal-50); color: var(--teal); }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.blue { background: var(--primary-50); color: var(--primary); border-color: #bfdbfe; }
.badge.teal { background: var(--teal-50); color: var(--teal); border-color: #a7f3d0; }
.badge.amber { background: var(--amber-50); color: var(--amber); border-color: #fde68a; }
.badge.red { background: var(--danger-50); color: var(--danger); border-color: #fecaca; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .9rem; margin: 6px 0 12px; }
.program-card { display: flex; flex-direction: column; gap: 8px; }
.program-card .cover { height: 112px; border-radius: 10px; background: linear-gradient(135deg, #dbeafe, #ccfbf1); display: flex; align-items: end; padding: 12px; font-weight: 800; color: #1e3a8a; }
.program-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Flow stepper */
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: 1fr; counter-reset: s; }
@media (min-width: 768px) { .flow { grid-template-columns: repeat(4, 1fr); } }
.flow li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; position: relative; }
.flow li::before { counter-increment: s; content: counter(s, decimal-leading-zero); display: block; font-weight: 800; color: var(--primary); font-size: .85rem; margin-bottom: 4px; }
.flow li.mine { border-color: #93c5fd; background: var(--primary-50); }
.flow li strong { display: block; }
.stepper { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; padding: 0; margin: 8px 0 0; }
.stepper li { font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.stepper li.done { background: var(--teal-50); color: var(--teal); border-color: #a7f3d0; }
.stepper li.now { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Forms */
form.stack, .stack { display: grid; gap: 12px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--text); background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 3px solid #bfdbfe; outline-offset: 0; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
label.check input { width: 20px; min-height: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--primary); }
.hint { font-size: .82rem; color: var(--muted); font-weight: 400; }
.notice { background: var(--primary-50); border: 1px solid #bfdbfe; color: #1e3a8a; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .92rem; }
.notice.amber { background: var(--amber-50); border-color: #fde68a; color: var(--amber); }
.notice.teal { background: var(--teal-50); border-color: #a7f3d0; color: #065f46; }
.result { white-space: pre-wrap; font-size: .92rem; min-height: 1.2em; }
.result.ok { color: var(--teal); }
.result.error, .error { color: var(--danger); }
.empty { text-align: center; padding: 36px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: #fff; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }

/* Workspace */
.ws { display: grid; gap: 20px; padding-block: 28px 64px; }
@media (min-width: 1024px) { .ws { grid-template-columns: 250px 1fr; align-items: start; } }
.side { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; position: sticky; top: 80px; }
.side .who { padding: 8px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 1023px) { .side { position: static; } .side nav { flex-direction: row; overflow-x: auto; } }
.side nav button { justify-content: flex-start; background: transparent; color: var(--muted); border-radius: 10px; font-weight: 600; min-height: 40px; padding: 8px 12px; white-space: nowrap; }
.side nav button:hover { background: var(--surface-2); color: var(--text); }
.side nav button[aria-current="true"] { background: var(--primary-50); color: var(--primary); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.kpi b { display: block; font-size: 1.6rem; font-weight: 800; }
.kpi span { color: var(--muted); font-size: .85rem; }
.record { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: #fff; display: grid; gap: 8px; }
.record + .record { margin-top: 10px; }
.record header { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; padding: 0 14px; }
details + details { margin-top: 10px; }
summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
details > :last-child { margin-bottom: 14px; }
pre.doc { white-space: pre-wrap; font-family: inherit; background: var(--surface-2); border-radius: 10px; padding: 12px; margin: 0; }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface-2); padding: 2px 8px; border-radius: 6px; font-size: 1.05rem; letter-spacing: .08em; }

/* Footer */
footer.site { border-top: 1px solid var(--line); background: #fff; padding-block: 28px; color: var(--muted); font-size: .9rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.legal h2 { margin-top: 1.2em; font-size: 1.2rem; }
[hidden] { display: none !important; }

/* 2026-11-19: documents, companions, trust strip */
.docs { border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 8px; }
.docs h4 { margin: 0; font-size: .95rem; }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.doc-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface-2); border-radius: 10px; padding: 6px 10px; }
.doc-list button { min-height: 34px; padding: 4px 12px; }
.docs input[type=file] { width: auto; min-height: 40px; padding: 6px; }
.docs select, .actions select, .actions input:not([type=checkbox]) { width: auto; }
fieldset.checks { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; display: grid; gap: 6px; margin: 0; }
fieldset.checks legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.fam-ex { margin-top: 4px; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: .92rem; font-weight: 600; }
.trust span { display: inline-flex; align-items: center; gap: 8px; }
.trust span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
@media (prefers-reduced-motion: no-preference) { .card, .btn, button { transition: background .15s, border-color .15s, color .15s; } }
