/* 꽁밥 — 장학 한눈에와 같은 suhan-dev 작업 기록 디자인(galaxy-sfr-progress/assets/style.css)을 바탕으로 한 스타일 */

:root {
  --bg: #f8f8f5;
  --surface: #ffffff;
  --text: #17181c;
  --text-2: #4b4e56;
  --text-3: #6f727a;
  --rule: #e4e4df;
  --rule-strong: #c9c9c3;
  --tag-bg: #efefea;
  --code-bg: #f2f2ee;
  --accent: var(--text);
  --accent-soft: var(--tag-bg);
  --on-accent: var(--bg);
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 860px;
  --wide: 1140px;
  --bar-h: 56px;
  --tab-h: 0px;
  color-scheme: light;
}

[data-project="galaxy"] {
  --accent: #4b50d6;
  --accent-soft: #eceeff;
  --on-accent: #fff;
  --cover: #11143a;
  --cover-ink: #c7d0ff;
}
[data-project="kcb"] {
  --accent: #0e7468;
  --accent-soft: #e3f3ef;
  --on-accent: #fff;
  --cover: #0c3532;
  --cover-ink: #a7e3d4;
}
.has-tabs { --tab-h: 54px; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --surface: #17181c;
    --text: #ecedef;
    --text-2: #b5b8bf;
    --text-3: #8d9097;
    --rule: #2a2c31;
    --rule-strong: #45484f;
    --tag-bg: #22242a;
    --code-bg: #1a1c20;
    color-scheme: dark;
  }
  [data-project="galaxy"] {
    --accent: #a9b2ff;
    --accent-soft: #1d2040;
    --on-accent: #101114;
  }
  [data-project="kcb"] {
    --accent: #6fd6c2;
    --accent-soft: #12302c;
    --on-accent: #101114;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: -0.006em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 24px;
}
.wide { max-width: var(--wide); }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--rule-strong); }
a:hover { text-decoration-color: var(--accent); }

code, pre, kbd, .mono { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.6;
  font-size: 13.5px;
}
pre code { font-size: inherit; }

strong { font-weight: 650; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  height: var(--bar-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 100%; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.012em;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.brand .mark { flex: none; width: 14px; height: 14px; border-radius: 3px; background: var(--text); }
.nav-links { display: flex; align-items: center; gap: 22px; min-width: 0; }
.nav-links a { font-size: 14.5px; font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); font-weight: 650; }

/* ---------- Header (landing) ---------- */
.masthead {
  padding: 72px 0 44px;
}
.eyebrow {
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 18px;
}
.masthead h1 {
  font-size: clamp(30px, 5.2vw, 44px);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.028em;
  margin: 0 0 14px;
}
.subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 0 0 28px;
  max-width: 40em;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid var(--rule-strong);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: opacity .15s ease;
}
.btn:hover { opacity: .82; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-secondary { background: transparent; color: var(--text); }
.btn[aria-disabled="true"] {
  background: transparent;
  color: var(--text-3);
  border: 1px dashed var(--rule-strong);
  cursor: not-allowed;
  opacity: 1;
}
.btn .meta { font-family: var(--mono); font-size: 12px; font-weight: 400; opacity: .7; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; flex: none; }
.updated { font-size: 13px; color: var(--text-3); margin: 0; }
.updated .mono { font-size: 12.5px; }

/* ---------- Project cards (landing) ---------- */
.landing { padding-bottom: 8px; }
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 24px; }
.card {
  position: relative;
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.cover { height: 190px; flex: none; background: var(--cover); color: var(--cover-ink); overflow: hidden; }
.cover svg { display: block; width: 100%; height: 100%; }
.card-body { flex: 1; display: flex; flex-direction: column; padding: 22px 24px 20px; }
.meta-row { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 12px; }
.meta-row .eyebrow { margin: 3px 0 0; min-width: 0; }
.status {
  flex: none;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.card h2 { margin: 0 0 10px; font-size: 23px; line-height: 1.32; font-weight: 700; letter-spacing: -0.02em; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a::after { content: ""; position: absolute; inset: 0; }
.card:hover h2 a { text-decoration: underline; text-decoration-color: var(--accent); }
.summary { font-size: 15.5px; line-height: 1.65; color: var(--text-2); margin: 0 0 18px; }
.note { font-size: 13.5px; line-height: 1.6; color: var(--text-3); margin: 0 0 16px; }
.card .note a, .card-links a { position: relative; z-index: 1; }
.metrics { display: flex; flex-wrap: wrap; gap: 12px 30px; margin: 0 0 14px; }
.metrics dt { font-size: 12.5px; line-height: 1.4; font-weight: 500; color: var(--text-3); }
.metrics dd {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.chips { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { margin: 0; padding: 2px 9px; border-radius: 6px; background: var(--tag-bg); color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.card-links { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 14px; }
.card-links a { color: var(--text-2); }
.card-links .card-more { color: var(--text); font-weight: 650; text-decoration: none; }
.card-links .card-more:hover { text-decoration: underline; text-decoration-color: var(--accent); }

/* ---------- Recent work (landing) ---------- */
.recent { padding: 60px 0 0; }
.recent h2 { margin: 0 0 14px; font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; }
.recent-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule-strong); }
.recent-list li { margin: 0; border-bottom: 1px solid var(--rule); }
.recent-list a { display: grid; grid-template-columns: 7.2em 7.6em minmax(0, 1fr); gap: 2px 16px; align-items: baseline; padding: 11px 0; text-decoration: none; font-size: 15px; line-height: 1.55; }
.recent-list .mono { font-size: 13px; color: var(--text-3); }
.recent-project { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.recent-list a:hover .recent-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--accent); }

/* ---------- Project hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--cover); color: #fff; }
.hero-art {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(56%, 620px);
  color: var(--cover-ink);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 35%);
  mask-image: linear-gradient(to right, transparent, #000 35%);
}
.hero-art svg { display: block; width: 100%; height: 100%; }
.hero-text { position: relative; z-index: 1; max-width: 640px; padding: 40px 0 44px; }
.hero a { color: #fff; text-decoration-color: rgba(255, 255, 255, .5); }
.hero a:hover { text-decoration-color: #fff; }
.crumbs { font-size: 13.5px; line-height: 1.5; color: rgba(255, 255, 255, .72); margin-bottom: 26px; }
.hero .meta-row { justify-content: flex-start; align-items: center; }
.hero .meta-row .eyebrow { margin: 0; color: rgba(255, 255, 255, .72); }
.hero .status { background: transparent; border: 1px solid rgba(255, 255, 255, .45); color: #fff; }
.hero h1 { margin: 0 0 12px; font-size: clamp(30px, 5.2vw, 44px); line-height: 1.22; font-weight: 700; letter-spacing: -0.028em; }
.hero .summary { font-size: 17px; color: rgba(255, 255, 255, .88); margin-bottom: 22px; }
.hero .metrics dt { color: rgba(255, 255, 255, .72); }
.hero .metrics dd { color: #fff; }
.hero .note { color: rgba(255, 255, 255, .72); margin: 0; }

/* ---------- Round tabs ---------- */
.tab-input { position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none; }   /* fixed: 포커스로 페이지가 끌려가지 않게 */
.tabbar {
  position: sticky; top: var(--bar-h); z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.tabbar .wrap { display: flex; flex-wrap: wrap; column-gap: 28px; row-gap: 0; }
.tabbar label {
  display: inline-block;
  padding: 15px 0 13px;
  font-size: 15px;
  font-weight: 600;
  line-height: 24px;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  user-select: none;
}
.tabbar label:hover { color: var(--text-2); }
/* 탭별 선택·표시 규칙(#tab-KEY:checked ~ ...)은 build_site.py 가 탭 키 목록에서 자동으로 만들어
   각 프로젝트 페이지의 <style id="tab-rules"> 에 넣는다. 여기에 키를 손으로 적지 말 것. */
.panel { display: none; }

.panel-head { padding: 40px 0 18px; border-bottom: 1px solid var(--rule); }
.panel-head.compact { padding-top: 28px; }
.panel-head .eyebrow { margin-bottom: 12px; }
.panel-title {
  font-size: clamp(22px, 3.4vw, 28px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.panel-head .subtitle { font-size: 16.5px; margin-bottom: 24px; }
.panel-head .actions { margin-bottom: 4px; }

/* ---------- Layout + Nav ---------- */
.layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 48px; }
.content { min-width: 0; max-width: var(--measure); }
.content > section:first-child { padding-top: 34px; }
.toc {
  position: sticky;
  top: calc(var(--bar-h) + var(--tab-h) + 20px);
  align-self: start;
  margin-top: 34px;
  font-size: 14px;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--rule); text-decoration: none; color: var(--text-2); line-height: 1.5; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc .n { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-right: 6px; }
.toc a.active .n { color: inherit; }

/* ---------- Sections ---------- */
section { padding: 64px 0 8px; scroll-margin-top: calc(var(--bar-h) + var(--tab-h) - 28px); }
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 26px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-strong);
}
.sec-head .n { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.sec-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
}
h3 { font-size: 18px; font-weight: 650; letter-spacing: -0.012em; margin: 36px 0 10px; line-height: 1.45; }
h4 { font-size: 16px; font-weight: 650; margin: 26px 0 8px; }
p { margin: 0 0 14px; }
ul, ol { padding-left: 1.3em; margin: 0 0 14px; }
li { margin: 3px 0; }
li::marker { color: var(--text-3); }
.lead { font-size: 17px; color: var(--text-2); }
.muted { color: var(--text-3); }
.small { font-size: 14px; }

/* ---------- Definition grid (overview) ---------- */
.deflist { margin: 0; border-top: 1px solid var(--rule); }
.deflist > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.deflist dt { font-weight: 600; font-size: 14.5px; color: var(--text-2); }
.deflist dd { margin: 0; }
.deflist dd ul { margin: 0; }

.models { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.models li {
  margin: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 3px 12px 3px 4px;
  font-size: 14.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.models .no {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--tag-bg);
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--text-2);
}

.formula {
  font-family: var(--mono);
  font-size: 13.5px;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 10px 14px;
  margin: 10px 0 0;
  overflow-x: auto;
  white-space: nowrap;
}

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; margin: 6px 0 22px; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
thead th {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid var(--text);
  padding: 8px 14px 8px 0;
  white-space: nowrap;
}
tbody td {
  border-bottom: 1px solid var(--rule);
  padding: 10px 14px 10px 0;
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 1px solid var(--rule-strong); }
th:last-child, td:last-child { padding-right: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.env th[scope="row"] { font-weight: 600; color: var(--text-2); font-size: 13.5px; white-space: nowrap; border-bottom: 1px solid var(--rule); padding: 10px 14px 10px 0; text-align: left; vertical-align: top; }

/* ---------- Workflow diagram ---------- */
.flow {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 22px;
  counter-reset: step;
}
.flow li {
  position: relative;
  margin: 0;
  border-top: 2px solid var(--text);
  padding: 12px 0 0;
}
.flow li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.flow li:not(:nth-child(4n)):not(:last-child)::after {
  content: "";
  position: absolute;
  top: -6px;
  right: -17px;
  width: 0; height: 0;
  border-left: 7px solid var(--text);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.flow .t { display: block; font-weight: 650; font-size: 15.5px; line-height: 1.4; letter-spacing: -0.01em; }
.flow .d { display: block; font-size: 13.5px; line-height: 1.6; color: var(--text-2); margin-top: 6px; }
.flow li.key { border-color: var(--accent); }
.flow li.key::before { display: inline-block; background: var(--accent); color: var(--on-accent); border-radius: 2px; padding: 0 5px; }
.flow-note { font-size: 13.5px; color: var(--text-3); margin-top: 22px; }

/* ---------- Timeline ---------- */
.timeline { margin: 0; padding: 0; list-style: none; position: relative; }
.tl-day {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--text-3);
  margin: 0 0 10px;
  padding-left: 132px;
}
.tl-day:not(:first-child) { margin-top: 28px; }
.tl-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 22px;
  position: relative;
}
.tl-when {
  text-align: right;
  padding-top: 2px;
}
.tl-time { font-family: var(--mono); font-size: 15px; font-weight: 500; display: block; line-height: 1.6; }
.tl-body {
  position: relative;
  border-left: 1px solid var(--rule-strong);
  padding: 0 0 30px 24px;
}
.tl-body::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--text);
}
.tl-item:last-child .tl-body { padding-bottom: 6px; }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 6px; }
.tl-title { font-size: 17px; font-weight: 650; letter-spacing: -0.012em; margin: 0; line-height: 1.5; }
.tag {
  display: inline-block;
  font-size: 12px;
  line-height: 1.5;
  padding: 1px 9px;
  border-radius: 3px;
  white-space: nowrap;
  font-weight: 500;
}
.tag-local { background: var(--tag-bg); color: var(--text-2); border: 1px solid var(--rule-strong); }
.tag-server { background: var(--text); color: var(--bg); border: 1px solid var(--text); }
.tag-both { background: var(--surface); color: var(--text); border: 1px solid var(--text); }
.tag-none { background: transparent; color: var(--text-3); border: 1px dashed var(--rule-strong); }
.tl-content { color: var(--text); font-size: 15px; }
.tl-content ul, .tl-content ol { margin-bottom: 6px; }
.tl-content p:last-child, .tl-content ul:last-child { margin-bottom: 0; }

.placeholder {
  border: 1px dashed var(--rule-strong);
  border-radius: 4px;
  padding: 22px 24px;
  color: var(--text-2);
}
.placeholder strong { color: var(--text); }

/* ---------- Downloads ---------- */
.files td.name { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.files td.desc { color: var(--text-2); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--text-3); margin: -8px 0 26px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Footer ---------- */
footer {
  margin-top: 72px;
  border-top: 1px solid var(--rule);
  padding: 22px 0 48px;
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- Responsive ---------- */
@media (prefers-reduced-motion: reduce) {
  .card, .btn { transition: none; }
  .card:hover { transform: none; }
}
@media (max-width: 1000px) {
  .hero-art { opacity: .4; }
  .layout { display: block; }
  .toc { position: static; margin-top: 0; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .toc ol { flex-direction: row; flex-wrap: wrap; gap: 4px 22px; }
  .toc a { display: inline; padding: 0; border-left: 0; }
  .content { max-width: none; }
  .content > section:first-child { padding-top: 48px; }
}
@media (max-width: 760px) {
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow li::after { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 16px; }
  .brand-name { display: none; }
  .nav-links { gap: 18px; }
  .masthead { padding: 44px 0 28px; }
  .card-body { padding: 20px 18px 18px; }
  .metrics { column-gap: 20px; }
  .metrics dd { font-size: 26px; }
  .recent { padding-top: 44px; }
  .recent-list a { grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; }
  .recent-title { grid-column: 1 / -1; }
  .hero-art { width: 100%; opacity: .3; -webkit-mask-image: none; mask-image: none; }
  .hero-text { padding: 26px 0 32px; }
  .crumbs { margin-bottom: 18px; }
  .hero .summary { font-size: 16px; }
  .tabbar .wrap { column-gap: 20px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .tabbar label { white-space: nowrap; flex: none; }
  .panel-head { padding-top: 28px; }
  .subtitle { font-size: 16.5px; }
  .actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  section { padding-top: 48px; }
  .sec-head h2 { font-size: 21px; }
  .deflist > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .flow { grid-template-columns: 1fr; gap: 0; }
  .flow li { border-top: 0; border-left: 2px solid var(--text); padding: 0 0 18px 16px; }
  .flow li::before { margin-bottom: 0; }
  .tl-day { padding-left: 0; }
  .tl-item { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .content > section:first-child { padding-top: 36px; }
  .tl-when { text-align: left; padding: 0 0 2px 24px; border-left: 1px solid var(--rule-strong); }
  .tl-body::before { top: -18px; }
  .files thead { display: none; }
  .files, .files tbody { display: block; }
  .files tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
  .files tbody td, .files tbody tr:last-child td { border: 0; padding: 0; }
  .files td.name { white-space: normal; overflow-wrap: anywhere; }
  .files td.desc { grid-column: 1 / -1; font-size: 14px; }
}

/* ---------- Print ---------- */
@media print {
  :root {
    --bg: #fff; --surface: #fff; --text: #000; --text-2: #333; --text-3: #666;
    --rule: #ccc; --rule-strong: #999; --tag-bg: #eee; --code-bg: #f5f5f5;
  }
  body { font-size: 10.5pt; line-height: 1.55; background: #fff; }
  .wrap { max-width: none; padding: 0; }
  [data-project] { --accent: #000; --accent-soft: #fff; --on-accent: #fff; --cover: #fff; --cover-ink: #000; }
  .topbar, .toc, .actions, .no-print, .tabbar, .hero-art, .cover { display: none !important; }
  .panel { display: block !important; }
  .masthead { padding: 0 0 16px; }
  .hero { background: #fff; color: #000; }
  .hero-text { max-width: none; padding: 0 0 16px; }
  .hero *, .hero a { color: #000 !important; }
  .hero .status { border-color: #000; }
  .panel-head { padding: 12px 0 8px; }
  .panel-head.compact { display: none; }
  .layout { display: block; }
  .content { max-width: none; }
  .card { box-shadow: none; transform: none; break-inside: avoid; }
  section { padding-top: 24px; break-inside: auto; }
  .sec-head { break-after: avoid; }
  .tl-item, tr, .flow li { break-inside: avoid; }
  .tag-server { background: #000; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { text-decoration: none; }
  pre { white-space: pre-wrap; }
  .flow { grid-template-columns: repeat(4, 1fr); }
  footer { margin-top: 24px; }
}

/* =====================================================================
   장학 한눈에 전용
   ===================================================================== */

[data-project="gonggang"] {
  --accent: #c2410c;
  --accent-soft: #fdeee4;
  --on-accent: #fff;
  --cover: #2a160c;
  --cover-ink: #ffd3b4;
}
@media (prefers-color-scheme: dark) {
  [data-project="gonggang"] {
    --accent: #ffaa75;
    --accent-soft: #3a2116;
    --on-accent: #101114;
  }
}

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip { position: fixed; top: -100px; left: 12px; z-index: 50; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .4; cursor: default; }

/* top bar */
.nav-button { background: none; border: 0; padding: 0; font-size: 14.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.nav-button:hover { color: var(--accent); }

/* tabs */
.tabbar .tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 15px 0 13px;
  font-size: 15px; font-weight: 600; line-height: 24px;
  color: var(--text-3); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabbar .tab:hover { color: var(--text-2); }
.tabbar .tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabbar .count {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; line-height: 1.5;
  padding: 0 7px; border-radius: 999px; background: var(--tag-bg); color: var(--text-2);
}
.tabbar .tab[aria-selected="true"] .count { background: var(--accent-soft); color: var(--accent); }

/* views */
.view .content > section:first-child { padding-top: 40px; }
.content.solo { max-width: none; }
.sec-head .sec-aside { margin-left: auto; font-size: 13.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sec-head .btn { margin-left: auto; }

/* filters (left column, toc 자리) */
.filters {
  position: sticky;
  top: calc(var(--bar-h) + var(--tab-h) + 20px);
  align-self: start;
  margin-top: 40px;
  font-size: 14px;
}
.filters summary {
  list-style: none; cursor: default;
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--text-3);
  padding-bottom: 10px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 16px;
}
.filters summary::-webkit-details-marker { display: none; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin: 0 0 16px; }
.field small { font-weight: 400; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }
input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14.5px; font-weight: 400; line-height: 1.4;
  color: var(--text);
}
select { padding-right: 6px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; margin: 3px 0 0; flex: none; accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--text-2); margin: 0 0 10px; cursor: pointer; }
.text-button, .link-button { background: none; border: 0; padding: 0; font-size: 13.5px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-strong); }
.text-button:hover, .link-button:hover { color: var(--text); text-decoration-color: var(--accent); }
.filters .text-button { margin-top: 6px; }
.side-note { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.side-note p { margin: 0 0 8px; }
.side-title { font-weight: 650; color: var(--text); }

/* profile summary box */
.profile-box {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  background: var(--code-bg); border: 1px solid var(--rule); border-radius: 8px;
  padding: 16px 18px; margin: 0 0 18px;
}
.profile-box p { margin: 0; }
.profile-label { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.profile-summary { font-weight: 650; font-size: 15.5px; line-height: 1.5; margin-top: 2px !important; }
.profile-sub { font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin-top: 2px !important; }
.profile-box .btn { flex: none; }
.btn { cursor: pointer; background: transparent; color: var(--text); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; border-radius: 7px; }

/* search + toolbar */
.search {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 8px;
}
.search:focus-within { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.search svg { width: 19px; height: 19px; flex: none; color: var(--text-3); }
.search input { border: 0; outline: 0; background: transparent; padding: 0; height: 100%; font-size: 15.5px; }
.search input:focus { outline: 0; }
kbd { font-size: 12px; color: var(--text-3); border: 1px solid var(--rule-strong); border-radius: 4px; padding: 0 6px; line-height: 1.6; }
.result-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 16px 0 6px; }
.segments { display: flex; flex-wrap: wrap; gap: 6px; }
.segments button {
  border: 1px solid var(--rule-strong); background: transparent; border-radius: 999px;
  padding: 4px 13px; font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--text-2);
}
.segments button:hover { color: var(--text); border-color: var(--text-3); }
.segments button.selected { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.sort select { width: auto; border-radius: 999px; padding: 4px 10px; font-size: 14px; }
.result-note { font-size: 13px; color: var(--text-3); margin: 10px 0 14px; }

/* result cards */
.results { display: flex; flex-direction: column; gap: 14px; }
.s-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px 22px 0;
  min-width: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.s-card:hover { border-color: var(--rule-strong); box-shadow: 0 4px 14px rgba(0, 0, 0, .05); }
.s-card .meta-row { margin-bottom: 8px; align-items: center; }
.s-card .eyebrow { margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; }
.s-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.title-button {
  background: none; border: 0; padding: 0; text-align: left;
  font-size: 19px; font-weight: 700; line-height: 1.4; letter-spacing: -0.016em; color: var(--text);
}
.title-button:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.s-card .summary { font-size: 14.5px; margin: 6px 0 12px; }
.s-card .chips { margin-bottom: 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 26px; margin: 0 0 14px; font-size: 14px; }
.facts div { display: flex; gap: 8px; min-width: 0; }
.facts dt { color: var(--text-3); flex: none; }
.facts dd { margin: 0; font-weight: 600; }
.s-card .card-links { justify-content: space-between; padding: 11px 0 13px; }
.bookmark {
  flex: none; background: transparent; border: 1px solid var(--rule-strong); border-radius: 999px;
  padding: 2px 12px; font-size: 13.5px; font-weight: 600; line-height: 1.6; color: var(--text-2); white-space: nowrap;
}
.bookmark:hover { color: var(--text); border-color: var(--text-3); }
.bookmark[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.detail-button { background: none; border: 0; padding: 0; font-size: 14px; font-weight: 650; color: var(--text); white-space: nowrap; }
.detail-button:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }
.match { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-3); }
.match::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--text-3); flex: none; }
.match.partial { color: var(--accent); }
.match.partial::before { background: var(--accent); border-color: var(--accent); }
.match.mismatch { color: var(--text-2); }
.match.mismatch::before { border-style: dashed; }
.s-card.archived { background: transparent; }
.s-card.archived .title-button { color: var(--text-2); }

.status.closed { background: var(--tag-bg); color: var(--text-3); }
.status.guide, .status.unknown { background: transparent; border: 1px solid var(--rule-strong); color: var(--text-2); line-height: 1.4; }
.status.upcoming { background: transparent; border: 1px solid var(--accent); color: var(--accent); line-height: 1.4; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 22px 0 0; font-size: 14px; font-family: var(--mono); }
.pagination button { background: transparent; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 3px 14px; font-family: var(--sans); font-size: 14px; }
.empty { border: 1px dashed var(--rule-strong); border-radius: 8px; padding: 28px 24px; color: var(--text-2); margin-top: 14px; }
.empty-title { font-weight: 650; color: var(--text); }

/* timeline (마감 일정) */
.tl-title .title-button { font-size: 17px; font-weight: 650; }
.tl-meta { font-size: 14px; color: var(--text-2); margin: 0; }
.tl-time.muted { color: var(--text-3); font-size: 13px; }
.tl-section { margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--rule); }
.tl-empty { color: var(--text-3); font-size: 14.5px; }
.timeline .tag { flex: none; }

/* saved */
.stage-tabs { margin: 0 0 18px; }
.saved-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.saved-item { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 18px 20px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.saved-item .meta-row { margin: 0; align-items: center; }
.saved-item .eyebrow { margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; }
.saved-item p { margin: 0; font-size: 14px; color: var(--text-2); }
.saved-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.saved-row select { width: auto; font-size: 13.5px; padding: 4px 8px; }
.progress { height: 4px; border-radius: 2px; background: var(--tag-bg); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .2s; }

/* calculator */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 36px; margin: 8px 0 34px; align-items: start; }
.panel-box { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 22px 24px; min-width: 0; }
.panel-box h3, h3.flush { margin-top: 0; }
.panel-box .btn { width: 100%; justify-content: center; }
.estimate { margin: 16px 0 12px; padding: 14px 16px; border-radius: 8px; background: var(--code-bg); border: 1px solid var(--rule); font-size: 14px; color: var(--text-2); }
.estimate strong { display: block; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin: 4px 0; font-variant-numeric: tabular-nums; }
.estimate small { display: block; font-size: 13px; color: var(--text-3); line-height: 1.55; }
.estimate dl { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); }
.estimate dt { font-size: 12.5px; color: var(--text-3); }
.estimate dd { margin: 0; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
tbody th[scope="row"] { text-align: left; font-weight: 600; color: var(--text-2); font-size: 14px; white-space: nowrap; border-bottom: 1px solid var(--rule); padding: 10px 14px 10px 0; vertical-align: top; }
tbody tr:last-child th[scope="row"] { border-bottom: 1px solid var(--rule-strong); }

/* guide */
.faq-list { border-top: 1px solid var(--rule); }
.faq { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; font-weight: 600; font-size: 15.5px; line-height: 1.5; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--text-3); flex: none; }
.faq[open] summary::after { content: "−"; }
.faq p { color: var(--text-2); font-size: 15px; margin: -4px 0 16px; }
.directory td:first-child { white-space: nowrap; font-weight: 600; }
.directory td { font-size: 14.5px; }
.directory td.desc { color: var(--text-2); }
.file-label { position: relative; overflow: hidden; cursor: pointer; }
.file-label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.view .toc { margin-top: 40px; }

/* dialogs */
dialog {
  padding: 0; color: var(--text); background: var(--bg);
  border: 1px solid var(--rule-strong); border-radius: 14px;
  width: calc(100% - 32px); max-width: 780px; max-height: 92dvh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
dialog::backdrop { background: rgba(10, 12, 20, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 24px; background: var(--bg); border-bottom: 1px solid var(--rule);
}
.dialog-head .eyebrow { margin: 0; }
.dialog-head h2 { margin: 2px 0 0; font-size: 21px; line-height: 1.3; letter-spacing: -0.02em; }
.close { background: none; border: 0; font-size: 28px; line-height: 1; padding: 2px 6px; color: var(--text-2); }
.close:hover { color: var(--text); }
.dialog-body { padding: 22px 24px 26px; }
.dialog-bottom {
  position: sticky; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; background: var(--bg); border-top: 1px solid var(--rule);
}
.profile-help { color: var(--text-2); font-size: 14.5px; }
.profile-group { padding: 6px 0 0; }
.profile-group h3, .profile-group summary {
  display: flex; align-items: baseline; gap: 12px;
  font-size: 16px; font-weight: 650; margin: 18px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule-strong);
}
.profile-group summary { cursor: pointer; list-style: none; }
.profile-group summary::-webkit-details-marker { display: none; }
.profile-group summary::after { content: "+"; margin-left: auto; font-family: var(--mono); color: var(--text-3); }
.profile-group details[open] summary::after { content: "−"; }
.profile-group h3 small, .profile-group summary small { font-size: 13px; font-weight: 400; color: var(--text-3); }
.profile-group .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

.detail-title { margin: 6px 0 8px; font-size: clamp(22px, 3.4vw, 28px); line-height: 1.3; font-weight: 700; letter-spacing: -0.022em; }
.detail-lead { color: var(--text-2); font-size: 15.5px; }
.detail-dialog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.detail-facts { margin: 18px 0 0; }
.detail-section { padding: 30px 0 0; }
.detail-section .sec-head { margin-bottom: 14px; }
.detail-section .sec-head h3 { margin: 0; font-size: 17px; }
.condition { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.condition .symbol { font-family: var(--mono); font-weight: 600; color: var(--text-3); }
.condition.match .symbol { color: var(--accent); }
.condition-state { margin-left: 8px; font-size: 13px; color: var(--text-3); }
.condition.match .condition-state { color: var(--accent); }
.evidence { margin: 2px 0 0; font-size: 13.5px; color: var(--text-3); line-height: 1.6; }
.detail-list { margin: 0; color: var(--text-2); font-size: 15px; }
.detail-note { margin: 22px 0 0; padding: 12px 16px; border-radius: 6px; background: var(--code-bg); border: 1px solid var(--rule); font-size: 14px; color: var(--text-2); line-height: 1.7; }
.detail-check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 15px; cursor: pointer; }
.detail-check:has(input:checked) { color: var(--text-3); text-decoration: line-through; }
.detail-foot { font-size: 13px; color: var(--text-3); margin: 10px 0 0; }
.detail-stage { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.detail-stage select { width: auto; }
.detail-memo { min-height: 96px; resize: vertical; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.detail-actions .btn { min-height: 42px; padding: 8px 16px; font-size: 14.5px; }
.detail-source { font-size: 13px; color: var(--text-3); margin: 14px 0 0; overflow-wrap: anywhere; }

#toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
#toast.visible { opacity: 1; }

@media (max-width: 1000px) {
  .filters { position: static; margin-top: 24px; }
  .filters summary { cursor: pointer; display: flex; justify-content: space-between; }
  .filters summary::after { content: "+"; font-family: var(--mono); }
  .filters details[open] summary::after { content: "−"; }
  .filter-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
  .side-note { display: none; }
  .view .toc { margin-top: 0; }
  .view .content > section:first-child { padding-top: 32px; }
  .calc-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 600px) {
  .brand-name { display: inline; }
  .nav-links a { display: none; }
  .tabbar .tab { font-size: 14.5px; }
  .profile-box { flex-direction: column; align-items: stretch; gap: 12px; }
  .profile-box .btn { justify-content: center; }
  .filter-body { grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .filter-body .checkbox, .filter-body .text-button { grid-column: 1 / -1; }
  .s-card { padding: 16px 16px 0; }
  .title-button { font-size: 17.5px; }
  .facts { flex-direction: column; gap: 2px; }
  .s-card .card-links { flex-direction: column; align-items: flex-start; gap: 8px; }
  .profile-group .fields { grid-template-columns: 1fr; }
  .dialog-head, .dialog-body { padding-left: 16px; padding-right: 16px; }
  .dialog-bottom { padding: 12px 16px; }
  dialog { width: 100%; max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .sec-head { flex-wrap: wrap; }
  .hero .metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .hero .metrics dt { font-size: 12px; white-space: nowrap; }
  .hero .metrics dd { font-size: 22px; }
  .hero .summary { font-size: 15px; }
  .hero h1 { font-size: 28px; }
}
@media print {
  .filters, .tabbar, .profile-box, .search, .result-toolbar, .pagination, .bookmark, dialog { display: none !important; }
}
