:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #ecebe6;
  --ink: #16171a;
  --ink-2: #464950;
  --ink-3: #868992;
  --line: #e1dfd8;
  --line-2: #cfccc3;
  --weekend: rgba(22, 23, 26, 0.035);
  --today: #e5383b;
  --invert-bg: #16171a;
  --invert-ink: #f4f3ef;

  --k-meeting: #1d9a5f;
  --k-review: #2b68dc;
  --k-feedback: #c4860a;
  --k-qc: #7856d4;
  --k-delivery: #d4382c;
  --k-internal: #6b7080;

  --r-sm: 5px;
  --r: 9px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 24px rgba(0, 0, 0, 0.07);
  --font: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --mono: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101113;
    --surface: #18191c;
    --surface-2: #212327;
    --ink: #ececee;
    --ink-2: #b2b5bc;
    --ink-3: #7a7e88;
    --line: #2a2c31;
    --line-2: #383b42;
    --weekend: rgba(255, 255, 255, 0.025);
    --invert-bg: #ececee;
    --invert-ink: #16171a;
    --k-meeting: #34b779;
    --k-review: #5a8ff0;
    --k-feedback: #e0a42a;
    --k-qc: #9a7ff0;
    --k-delivery: #f0584b;
    --k-internal: #8d92a1;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }

/* RGB 스펙트럼 띠 */
.spectrum {
  height: 3px;
  background: linear-gradient(90deg, #ff2d3d 0%, #ff2d3d 33.3%, #19d36b 33.3%, #19d36b 66.6%, #2b6bff 66.6%, #2b6bff 100%);
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* 헤더 */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: 0.14em; }
.brand svg { width: 20px; height: 20px; }
.nav { display: flex; gap: 4px; }
.nav a {
  text-decoration: none; padding: 6px 12px; border-radius: 999px;
  color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current='page'] { background: var(--ink); color: var(--bg); }
.updated { margin-left: auto; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }

main.wrap { padding-top: 28px; padding-bottom: 56px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 15px; font-weight: 700; }
.section-head .sub { color: var(--ink-3); font-size: 12.5px; }

/* 다가오는 일정 */
.upcoming { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 36px; }
.up {
  appearance: none; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  transition: border-color .15s, transform .15s;
}
.up:hover { border-color: var(--line-2); transform: translateY(-1px); }
.up:focus-visible, .chip:focus-visible, .seg button:focus-visible, .tl-it:focus-visible, .cal-day:focus-visible, .row:focus-visible {
  outline: 2px solid var(--k-review); outline-offset: 2px;
}
.up .k { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.up .d { font-size: 34px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; margin-top: 6px; }
.up .when { font-size: 13px; color: var(--ink-2); }
.up .t { font-size: 14.5px; font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.up.first { background: var(--invert-bg); color: var(--invert-ink); border-color: var(--invert-bg); }
.up.first .k, .up.first .when { color: color-mix(in srgb, var(--invert-ink) 62%, transparent); }
.up-empty { grid-column: 1 / -1; color: var(--ink-3); padding: 16px 0; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.dot.dia { border-radius: 1px; transform: rotate(45deg); width: 7px; height: 7px; }

/* 툴바 */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.seg button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 6px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: 13.5px;
}
.seg button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); background: transparent; border-radius: 999px;
  padding: 4px 11px 4px 9px; font-size: 13px; color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip.ghost[aria-pressed='false'] { opacity: .55; }
.toolbar .sep { width: 1px; height: 20px; background: var(--line-2); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }

/* 타임라인 */
.tl { overflow-x: auto; overscroll-behavior-x: contain; position: relative; }
.tl-inner { position: relative; }
.tl-row { display: flex; position: relative; }
.tl-label {
  position: sticky; left: 0; z-index: 3; flex: none; width: var(--lw);
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; gap: 1px;
}
.tl-label .n { font-weight: 600; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tl-label .c { font-size: 11.5px; color: var(--ink-3); }
.tl-track { position: relative; flex: none; z-index: 2; }
.tl-row + .tl-row { border-top: 1px solid var(--line); }
.tl-row.ms .tl-label, .tl-row.ms { background: var(--surface); }
.tl-row.ms { border-bottom: 1px solid var(--line-2); }

.tl-head { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.tl-head .tl-label { justify-content: flex-end; font-size: 11.5px; color: var(--ink-3); }
.tl-months { position: relative; height: 26px; }
.tl-month { position: absolute; top: 0; height: 26px; border-left: 1px solid var(--line-2); }
.tl-month span { position: sticky; left: calc(var(--lw) + 8px); display: inline-block; padding: 5px 8px; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.tl-days { position: relative; height: 34px; display: flex; }
.tl-day { flex: none; text-align: center; font-size: 11px; line-height: 1.2; color: var(--ink-3); padding-top: 3px; }
.tl-day b { display: block; font-weight: 600; font-size: 11.5px; color: var(--ink-2); }
.tl-day.we b { color: var(--ink-3); }
.tl-day.mon { box-shadow: inset 1px 0 0 var(--line); }
.tl-day.today b { color: #fff; background: var(--today); border-radius: 4px; margin: 0 3px; }

.tl-cols { position: absolute; top: 0; bottom: 0; z-index: 1; pointer-events: none; }
.tl-cols .we { position: absolute; top: 0; bottom: 0; background: var(--weekend); }
.tl-cols .wk { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-cols .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--today); opacity: .8; }

.tl-it {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer;
  position: absolute; height: 22px; display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 550; white-space: nowrap; color: var(--ink);
}
.tl-it .bar { height: 20px; border-radius: var(--r-sm); background: var(--c); flex: none; }
.tl-it .dia { flex: none; width: var(--dw); height: 20px; display: grid; place-items: center; }
.tl-it .dia::before { content: ''; width: 11px; height: 11px; background: var(--c); transform: rotate(45deg); border-radius: 2px; }
.tl-it.in .lbl { position: absolute; left: 8px; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.18); }
.tl-it.tent .bar { background: color-mix(in srgb, var(--c) 18%, var(--surface)); border: 1.5px dashed var(--c); }
.tl-it.tent.in .lbl { color: var(--ink); text-shadow: none; }
.tl-it.tent .dia::before { background: var(--surface); border: 2px solid var(--c); }
.tl-it.off .bar { background: repeating-linear-gradient(135deg, var(--line-2) 0 4px, transparent 4px 8px); border: 1px solid var(--line-2); }
.tl-it.off.in .lbl { color: var(--ink-2); text-shadow: none; }
.tl-it.past { opacity: .42; }
.tl-it:hover .lbl { text-decoration: underline; text-underline-offset: 2px; }
.tl-empty { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* 월간 */
.cal-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cal-head h3 { font-size: 16px; font-weight: 700; min-width: 108px; }
.icon-btn {
  appearance: none; border: 1px solid var(--line-2); background: transparent; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-2);
}
.icon-btn:disabled { opacity: .3; cursor: default; }
.text-btn { appearance: none; border: 1px solid var(--line-2); background: transparent; cursor: pointer; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd { padding: 8px 10px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.cal-wd:nth-child(n+6) { color: var(--ink-3); }
.cal-day {
  appearance: none; text-align: left; border: 0; background: transparent; cursor: pointer;
  min-height: 112px; padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.we { background: var(--weekend); }
.cal-day.out { color: var(--ink-3); }
.cal-day.out .cal-n { opacity: .45; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-n { font-size: 12.5px; font-weight: 600; padding: 1px 5px; align-self: flex-start; border-radius: 5px; }
.cal-day.today .cal-n { background: var(--today); color: #fff; }
.cal-chip {
  display: flex; align-items: center; gap: 5px; font-size: 11.5px; line-height: 1.35;
  padding: 2px 6px; border-radius: 4px; min-width: 0;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--ink);
}
.cal-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.tent { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent); }
.cal-chip.past { opacity: .45; }
.cal-more { font-size: 11px; color: var(--ink-3); padding-left: 6px; }
.cal-sel { border-top: 1px solid var(--line-2); padding: 14px 16px 16px; }
.cal-sel h4 { margin: 0 0 8px; font-size: 13.5px; }

/* 목록 */
.list-month { padding: 10px 16px; font-weight: 700; font-size: 13px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.row {
  appearance: none; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  display: grid; grid-template-columns: 150px 70px minmax(0, 1fr) 150px; gap: 14px; align-items: center;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
}
.row:hover { background: var(--surface-2); }
.row .date { color: var(--ink-2); font-size: 13px; }
.row .dd { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.row .dd.soon { color: var(--today); }
.row .tt { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.row .tt span { overflow-wrap: anywhere; }
.row .note { display: block; font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.row .who { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.row.past { opacity: .5; }
.list-empty, .empty { padding: 28px 16px; color: var(--ink-3); text-align: center; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
}
.tag.st { color: var(--ink-3); background: var(--surface-2); font-weight: 500; }

/* 범례 */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dash { width: 18px; height: 10px; border: 1.5px dashed var(--ink-3); border-radius: 3px; }

/* 상세 카드 */
.detail {
  position: fixed; right: 20px; bottom: 20px; z-index: 20; width: min(360px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow);
  padding: 16px 18px 18px;
}
.detail[hidden] { display: none; }
.detail .x { position: absolute; top: 10px; right: 10px; }
.detail .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; padding-right: 36px; }
.detail h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; overflow-wrap: anywhere; }
.detail .meta { color: var(--ink-2); font-size: 13px; }
.detail .note { margin-top: 10px; font-size: 13px; color: var(--ink-2); padding-top: 10px; border-top: 1px solid var(--line); }

footer.wrap { padding-bottom: 40px; color: var(--ink-3); font-size: 12px; }

/* 전달파일 페이지 */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; margin-bottom: 32px; }
.hero h1 { font-size: 30px; font-weight: 750; letter-spacing: -0.025em; }
.hero p { margin: 6px 0 0; color: var(--ink-2); max-width: 560px; }
.cta {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  background: var(--ink); color: var(--bg); padding: 13px 20px; border-radius: 10px; font-weight: 650; white-space: nowrap;
}
.cta:hover { opacity: .88; }
.cta small { font-weight: 400; opacity: .7; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 40px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 20px; }
.step .no { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.step h3 { font-size: 15.5px; font-weight: 700; margin: 6px 0 6px; }
.step p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.step p + p { margin-top: 6px; }

.block { margin-bottom: 40px; }
.block > .section-head { margin-bottom: 14px; }

.naming { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.pattern { font-family: var(--font); font-weight: 600; font-size: clamp(16px, 2.4vw, 21px); display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px; overflow-wrap: anywhere; }
.pattern .seg-p { display: inline-flex; flex-direction: column; align-items: flex-start; }
.pattern .seg-p code { padding: 3px 7px; border-radius: 5px; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--ink); font-family: inherit; }
.pattern .seg-p small { font-family: var(--font); font-size: 11.5px; color: var(--ink-3); padding: 4px 2px 0; }
.pattern .sepc { color: var(--ink-3); padding: 3px 0; }
.examples { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.examples div { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.examples code { font-family: var(--font); font-weight: 600; color: var(--ink); font-size: 13.5px; min-width: 130px; }
.codes { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.codes code { font-family: var(--mono); color: var(--ink); margin-right: 6px; }
.hint { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }

.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.person .av { width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.person .who { flex: 1; min-width: 0; }
.person .who b { display: block; font-weight: 650; }
.person .who code { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.person a.go, .person span.go { font-size: 12.5px; padding: 6px 11px; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.person a.go { border: 1px solid var(--line-2); color: var(--ink); }
.person a.go:hover { background: var(--surface-2); }
.person span.go { color: var(--ink-3); border: 1px dashed var(--line-2); }

table.cols { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: 13.5px; }
table.cols th, table.cols td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.cols th { background: var(--surface-2); font-size: 12px; color: var(--ink-3); font-weight: 600; }
table.cols td:first-child { font-weight: 600; white-space: nowrap; }
table.cols td.ex { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
table.cols tr:last-child td { border-bottom: 0; }

.status-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.status-flow .st-card { flex: 1 1 160px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.status-flow .st-card .tag { margin-bottom: 6px; }
.status-flow .st-card p { margin: 0; font-size: 13px; color: var(--ink-2); }
.callout { border-left: 3px solid var(--k-feedback); background: var(--surface); padding: 12px 16px; border-radius: 0 var(--r) var(--r) 0; font-size: 13.5px; color: var(--ink-2); }
.callout b { color: var(--ink); }

/* 반응형 */
@media (max-width: 900px) {
  .upcoming { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 112px 56px minmax(0, 1fr); }
  .row .who { grid-column: 3; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top .wrap { gap: 14px; }
  .updated { font-size: 11.5px; }
  main.wrap { padding-top: 20px; }
  .up { padding: 12px 14px 14px; }
  .up .d { font-size: 26px; }
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
  .people { grid-template-columns: 1fr; }
  .cal-day { min-height: 64px; padding: 4px 3px; }
  .cal-chip { padding: 0; background: none; box-shadow: none; }
  .cal-chip.tent { box-shadow: none; }
  .cal-chip span { display: none; }
  .cal-chip { width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-left: 4px; }
  .cal-chip.tent { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
  .cal-more { font-size: 10px; padding-left: 3px; }
  .row { grid-template-columns: 84px minmax(0, 1fr); gap: 4px 12px; }
  .row .dd { grid-column: 1; grid-row: 2; }
  .row .tt { grid-column: 2; grid-row: 1 / span 2; }
  .row .who { grid-column: 2; }
  table.cols .hide-sm { display: none; }
  .detail { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
