:root {
  --brand: #24C7D9;
  --primary-deep: #0092A3;
  --ink: #1c2b30;
  --ink-soft: #5b6b70;
  --line: #E4E9EB;
  --bg: #FAFBFC;
  --panel-bg: #FFFFFF;

  /* 트랙 색 (하반기 보드 원본 톤) — c-blue / c-green / c-yellow */
  --blue-fill: #D3E0F7;
  --blue-border: #B4C8EE;
  --blue-ink: #33456b;
  --green-fill: #C4EBD4;
  --green-border: #9FDCBA;
  --green-ink: #2b5f44;
  --yellow-fill: #F8E3A8;
  --yellow-border: #EBCF7E;
  --yellow-ink: #6b5a1e;

  --month-fill: #ECE3F8;
  --month-ink: #574a70;
  --grid-cell: #EDEEEF;

  --gutter: 176px; /* 좌측 트랙 라벨 열 폭 */
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1760px; margin: 0 auto; padding: 40px 32px 80px; }

header.page-head {
  margin-bottom: 28px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
header.page-head h1 {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px;
}
header.page-head p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* 반기 토글 */
.half-switch {
  display: inline-flex; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: #fff; flex-shrink: 0;
}
.half-btn {
  appearance: none; border: none; background: none; cursor: pointer;
  padding: 9px 20px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  font-family: inherit; transition: background .12s, color .12s;
}
.half-btn + .half-btn { border-left: 1px solid var(--line); }
.half-btn:hover { color: var(--ink); }
.half-btn.on { background: var(--primary-deep); color: #fff; }

/* 범례 */
.legend { display: flex; gap: 18px; align-items: center; margin: 18px 0 24px; flex-wrap: wrap; }
.legend-items { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.legend .item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); }
.legend .swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid; }
.legend .hint { margin-left: auto; font-size: 12.5px; color: var(--ink-soft); }
.legend .hint b { color: var(--primary-deep); font-weight: 600; }

.swatch.c-blue   { background: var(--blue-fill);   border-color: var(--blue-border); }
.swatch.c-green  { background: var(--green-fill);  border-color: var(--green-border); }
.swatch.c-yellow { background: var(--yellow-fill); border-color: var(--yellow-border); }

/* ── 타임라인 ─────────────────────────────── */
.timeline-scroll {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow-x: auto;
  overflow-y: hidden;
}
.timeline {
  position: relative;
  min-width: 1540px;
}

/* 월 헤더 (좌측 거터만큼 들여쓰기) */
.months { position: relative; height: 46px; border-bottom: 1px solid var(--line); margin-left: var(--gutter); }
.month {
  position: absolute; top: 8px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--month-fill); color: var(--month-ink);
  font-size: 14px; font-weight: 600; border-radius: 8px;
  box-sizing: border-box;
  border-left: 3px solid transparent; border-right: 3px solid transparent;
  background-clip: padding-box;
}

/* 보드 + 주차 셀 배경 (거터 우측 영역) */
.board { position: relative; padding: 0 0 4px; }
.weekcols { position: absolute; top: 0; bottom: 0; left: var(--gutter); right: 0; z-index: 0; }
.wcell {
  position: absolute; top: 12px; bottom: 12px;
  background: var(--grid-cell); border-radius: 8px;
  box-sizing: border-box;
  border-left: 3px solid transparent; border-right: 3px solid transparent;
  background-clip: padding-box;
}

/* 트랙 영역 */
.tracks { position: relative; z-index: 1; padding: 12px 0; }
.track { position: relative; display: flex; align-items: stretch; }
.track-head {
  width: calc(var(--gutter) - 32px); margin: 0 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid;
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  text-align: center; padding: 10px;
}
.track-head.c-blue   { background: var(--blue-fill);   border-color: var(--blue-border);   color: var(--blue-ink); }
.track-head.c-green  { background: var(--green-fill);  border-color: var(--green-border);  color: var(--green-ink); }
.track-head.c-yellow { background: var(--yellow-fill); border-color: var(--yellow-border); color: var(--yellow-ink); }
.lanes { position: relative; flex: 1; min-width: 0; }
.track-divider {
  height: 0; margin: 14px 0;
  border-top: 2px dashed #C9CED1;
}

/* 바 */
.bar {
  position: absolute; height: 38px; border-radius: 8px;
  display: flex; align-items: center; gap: 6px; padding: 3px 11px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: 1px solid; overflow: hidden;
  z-index: 1; transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.bar-label { flex: 1; min-width: 0; line-height: 1.18; white-space: normal; word-break: keep-all;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bar:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.10); filter: brightness(1.02); z-index: 2; }
.bar.c-blue   { background: var(--blue-fill);   border-color: var(--blue-border);   color: var(--blue-ink); }
.bar.c-green  { background: var(--green-fill);  border-color: var(--green-border);  color: var(--green-ink); }
.bar.c-yellow { background: var(--yellow-fill); border-color: var(--yellow-border); color: var(--yellow-ink); }
.bar .cnt {
  flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,.65);
}
.bar.active { box-shadow: 0 0 0 2px var(--brand), 0 4px 14px rgba(36,199,217,.25); }
.bar.dim { opacity: .38; }

/* 참고 텍스트 (막대 아님, 클릭 불가) */
.note-label {
  position: absolute; height: 38px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 12px; font-weight: 500; line-height: 1.25; color: #4a6fd0;
  pointer-events: none; z-index: 1; padding: 0 6px; word-break: keep-all;
}

/* ── 우측 패널 ─────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(20,30,34,.32);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 40;
}
.overlay.open { opacity: 1; pointer-events: auto; }

.panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw;
  background: var(--panel-bg); box-shadow: -8px 0 30px rgba(0,0,0,.14);
  transform: translateX(100%); transition: transform .24s cubic-bezier(.22,.61,.36,1);
  z-index: 50; display: flex; flex-direction: column;
}
.panel.open { transform: translateX(0); }

.panel-head { padding: 24px 26px 18px; border-bottom: 1px solid var(--line); position: relative; }
.panel-head .tag {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  margin-bottom: 10px;
}
.panel-head .tag.c-blue   { background: var(--blue-fill);   color: var(--blue-ink); }
.panel-head .tag.c-green  { background: var(--green-fill);  color: var(--green-ink); }
.panel-head .tag.c-yellow { background: var(--yellow-fill); color: var(--yellow-ink); }
.panel-head h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.02em; }
.panel-head .meta { font-size: 12.5px; color: var(--ink-soft); }
.panel-head .meta.sub { margin-top: 3px; font-size: 12px; }
.panel-head .summary { margin: 12px 0 0; font-size: 13.5px; color: var(--ink); line-height: 1.55; }

/* 가설 / 성과 블록 */
.ib { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.ib .ib-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .03em; margin-bottom: 6px; }
.ib p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink); }
.ib-hyp { background: #f4fdfe; border: 1px solid #cdeef1; }
.ib-hyp .ib-label { color: var(--primary-deep); }
.ib-res { background: #fbfaf4; border: 1px solid #ece6cf; }
.ib-res .ib-label { color: #8a7414; }
.panel-close {
  position: absolute; top: 18px; right: 18px; border: none; background: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--ink-soft); padding: 4px;
}
.panel-close:hover { color: var(--ink); }

.panel-body { flex: 1; overflow-y: auto; padding: 18px 26px 40px; }

.doc-group { margin-bottom: 22px; }
.doc-group h3 {
  font-size: 12px; font-weight: 700; color: var(--primary-deep); letter-spacing: .03em;
  margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.doc {
  display: flex; align-items: flex-start; gap: 10px; text-decoration: none; color: inherit;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px;
  transition: border-color .12s, background .12s;
}
.doc:hover { border-color: var(--brand); background: #f4fdfe; }
.doc .ic { font-size: 15px; margin-top: 1px; }
.doc .txt { flex: 1; min-width: 0; }
.doc .t { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.doc .s { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.doc .arrow { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.empty {
  text-align: center; color: var(--ink-soft); font-size: 13px; padding: 30px 10px; line-height: 1.6;
}
.empty code { background: #f0f2f3; padding: 2px 6px; border-radius: 5px; font-size: 12px; }

@media (max-width: 720px) {
  .wrap { padding: 24px 16px 60px; }
  .bar { font-size: 11.5px; padding: 0 8px; }
}
