/* ============================================================
   DIRECTRIX TENDER — 앱 화면 스타일 (tokens.css v1.0 위)
   규칙: STYLEGUIDE.md 외의 색·그림자·효과 추가 금지.
   블루·그라디언트·뉴모피즘 없음 · 색이 보이면 무조건 상태.
   ============================================================ */

* { box-sizing: border-box; }
h1, h2, h3 { color: var(--ink); margin: 0 0 var(--sp-3); font-weight: 700; line-height: 1.35; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
main { max-width: 1440px; margin: 0 auto; padding: var(--sp-8) 40px 80px; }
.muted { color: var(--muted); font-size: var(--text-sm); }
.faint { color: var(--faint); }
.eyebrow { /* 레거시명 → .label 규격 */
  font-family: var(--font-mono); font-size: var(--text-label); font-weight: 600;
  letter-spacing: .16em; color: var(--faint); text-transform: uppercase; }
.num { font-family: var(--font-mono); text-align: right; }

/* ---------- 헤더 / 푸터 ---------- */
.site-header {
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 40px;
}
.site-header .brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.brand-word { font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: .02em; }
.brand-word .sep { color: var(--ghost); font-weight: 400; margin: 0 2px; }
.brand-word .sub { color: var(--muted); font-weight: 600; }
.site-header nav { display: flex; align-items: center; gap: var(--sp-6); }
.site-header nav a { text-decoration: none; font-size: 13.5px; color: var(--muted); }
.site-header nav a:hover { color: var(--ink); }
.site-footer-wrap { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer {
  max-width: 1440px; margin: 0 auto; padding: var(--sp-6) 40px var(--sp-2);
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--faint);
  letter-spacing: .16em; text-transform: uppercase;
}
.site-footer-legal { max-width: 1440px; margin: 0 auto; padding: 0 40px var(--sp-6);
  font-size: 12px; color: var(--faint); display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.site-footer-legal a { color: var(--muted); text-decoration: none; }

/* ---------- 섹션 ---------- */
.section { padding: var(--sp-6) 0; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-4); }

/* ---------- 레거시 버튼명 → 3단 위계 매핑 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--surface);
  border: none; border-radius: var(--r-chip);
  padding: 10px 22px; font-size: 13.5px; font-weight: 700;
  font-family: var(--font-body); cursor: pointer; text-decoration: none;
}
.btn:hover { opacity: .85; }
.btn.secondary {
  background: transparent; color: #43443A; border: 1px solid #C9C7B9; font-weight: 600;
}
.btn.secondary:hover { opacity: 1; border-color: var(--ink); color: var(--ink); }
.btn.ghost {
  background: none; border: none; padding: 4px 2px; border-radius: 0;
  font-size: 13px; font-weight: 700; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px;
}
.btn.ghost:hover { opacity: 1; color: var(--muted); }
.btn.danger { background: var(--red); color: var(--surface); }  /* 파괴적 행동 전용 */
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.busy { opacity: .6; pointer-events: none; }
.btn.on-dark { background: var(--surface); color: var(--ink); }
.btn.on-dark-secondary { background: transparent; color: var(--surface); border: 1px solid rgba(251,250,246,.4); }

/* ---------- 폼 ---------- */
input, select, textarea {
  font-family: var(--font-body); font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid #C9C7B9; border-radius: 10px;
  padding: 10px 14px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
::placeholder { color: var(--ghost); }

/* ---------- 레거시 칩명 → 상태 칩 매핑 ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-chip);
  font-size: 11.5px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.chip .node { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip.wait     { color: var(--muted); background: var(--stone); }
.chip.run      { color: var(--green); background: var(--green-bg); }
.chip.done     { color: var(--surface); background: var(--ink); }
.chip.gate     { color: var(--amber); background: var(--amber-bg); }
.chip.approved { color: var(--surface); background: var(--ink); }
.chip.rejected { color: var(--red);   background: var(--red-bg); }

/* ---------- 알림 (색=상태) ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; margin: var(--sp-3) 0; font-size: 13.5px; border-radius: 10px; }
.alert .node { width: 5px; height: 5px; border-radius: 50%; margin-top: 8px; flex: none; background: currentColor; }
.alert b { display: block; }
.alert.info    { background: var(--stone); color: var(--muted); }
.alert.info b  { color: var(--ink); }
.alert.success { background: var(--green-bg); color: var(--green); }
.alert.success b { color: var(--green); }
.alert.warning { background: var(--amber-bg); color: var(--amber); }
.alert.warning b { color: var(--amber); }
.alert.danger  { background: var(--red-bg); color: var(--red); }
.alert.danger b { color: var(--red); }

/* ---------- 산출물 md ---------- */
.md { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: var(--sp-6); font-size: var(--text-body);
  line-height: 1.7; max-height: 560px; overflow: auto; }
.md h1, .md h2, .md h3 { margin: 1.2em 0 .5em; } .md h1:first-child, .md h2:first-child { margin-top: 0; }
.md table { border-collapse: collapse; margin: .6em 0; width: 100%; }
.md th { text-align: left; padding: 6px 8px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .1em; color: var(--faint); border-bottom: 2px solid var(--ink); }
.md td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.md code { font-family: var(--font-mono); background: var(--paper); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.md blockquote { margin: .6em 0; padding: 10px 16px; border-left: 3px solid var(--ink);
  background: var(--paper); border-radius: 0 10px 10px 0; color: var(--muted); }

/* ---------- 테이블 (대시보드 등) ---------- */
table { border-collapse: collapse; width: 100%; font-size: var(--text-body); }
th { text-align: left; padding: 10px; font-family: var(--font-mono); font-size: var(--text-label);
  letter-spacing: .14em; color: var(--faint); text-transform: uppercase; font-weight: 600;
  border-bottom: 2px solid var(--ink); }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.action-needed { background: rgba(166,106,46,.05); }
td.dday-soon { color: var(--amber); font-weight: 700; }

/* ---------- SOP 스파인 (프로젝트 상세 — 시안 9a) ---------- */
.detail-wrap { display: grid; grid-template-columns: 1fr 300px; gap: var(--sp-8); align-items: start; }
.spine { position: relative; padding-left: 26px; }
.spine::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line-strong); }
.snode { position: relative; margin-bottom: var(--sp-3); }
.snode::before { content: ""; position: absolute; left: -24px; top: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ghost); z-index: 1; }
.snode.done::before { background: var(--ink); border-color: var(--ink); }
.snode.current::before { background: var(--green-bar); border-color: var(--green-bar); }
.snode.gate-node::before { border-radius: 2px; transform: rotate(45deg); border-color: var(--amber); background: var(--amber-bg); }
.snode.gate-node.approved::before { background: var(--ink); border-color: var(--ink); }
/* 과거 = 접힘 한 줄 */
.snode details.past > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px; }
.snode details.past > summary::-webkit-details-marker { display: none; }
.snode details.past > summary:hover { background: var(--surface); }
.snode .past-title { font-weight: 700; color: var(--ink); font-size: 14px; white-space: nowrap; }
.snode .past-sum { color: var(--faint); font-size: 12.5px; flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.snode .past-date { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.snode details.past > summary::after { content: "▾"; color: var(--ghost); font-size: 11px; }
.snode details.past[open] > summary::after { content: "▴"; }
.snode .past-body { padding: 4px 14px 14px; }
/* 승인 = 로그 한 줄 */
.gate-log { display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  font-size: 13px; color: var(--muted); }
.gate-log .dia { color: var(--amber); font-style: normal; }
.gate-log.approved .dia { color: var(--ink); }
.gate-log .when { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
/* 현재 = 승격 컨테이너 */
.snode .stage-open { background: var(--surface); border: 2px solid var(--ink);
  border-radius: var(--r-card); box-shadow: var(--shadow-float); padding: var(--sp-6); }
.stage-open .stage-head { display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--sp-4); }
/* 미래 = dashed 고스트 */
.snode .future { border: 1.5px dashed #C9C7B9; border-radius: 12px; padding: 10px 14px;
  color: var(--ghost); font-size: 13.5px; display: flex; justify-content: space-between; gap: 10px; }
.snode .future .cond { font-size: 12px; }

/* now-card 확장 */
.now-card { flex-wrap: wrap; }
.now-card .now-main { flex: 1; min-width: 240px; }
.now-card .now-title { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.now-card .label { color: #8B8C80; }
.now-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 사이드 레일 */
.side-rail { display: flex; flex-direction: column; gap: var(--sp-4); }
.side-rail .card { padding: var(--sp-5); }
.side-rail dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.side-rail dt { color: var(--faint); } .side-rail dd { margin: 0; color: var(--ink); }
.share-row { display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 12.5px; }
.share-row code { font-family: var(--font-mono); font-size: 10.5px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* ---------- 랜딩 ---------- */
.band { padding: var(--sp-10) 40px; margin-left: -40px; margin-right: -40px; }
.band.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band > .inner { max-width: 1120px; margin: 0 auto; }
.sec-no { font-family: var(--font-dot); font-size: 34px; color: var(--ghost); line-height: 1; }
.landing-lockup { font-family: var(--font-dot); font-size: 17px; letter-spacing: .06em; color: var(--ink); }
.display { font-weight: 800; font-size: 40px; line-height: 1.2; letter-spacing: -.01em; color: var(--ink); }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--sp-10); align-items: center; }
.hero-sub { font-size: 15.5px; line-height: 1.75; color: var(--muted); margin: var(--sp-4) 0 var(--sp-5); }
.hero-cta { display: flex; align-items: center; gap: var(--sp-4); }
.mock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: 18px; font-size: 12px; }
.mock-head b { color: var(--ink); font-size: 14px; }
.mock-head .eyebrow { display: block; }
.mock-row { display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-top: 1px solid var(--line); color: var(--muted); }
.mock .seg { margin: 10px 0 12px; }
.stats { display: flex; }
.stats > div { flex: 1; padding: var(--sp-5); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; }
.stats > div:first-child { border-left: 0; padding-left: 0; }
.stats b { font-family: var(--font-dot); font-size: 30px; color: var(--ink); font-weight: 600; }
.stats span { font-size: 13px; color: var(--faint); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); margin-top: var(--sp-4); }
.feature h3 { border-top: 2px solid var(--ink); padding-top: 12px; }
.feature p { margin: 0; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: var(--sp-4); }
.detail-grid > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.evidence { display: grid; grid-template-columns: 1.4fr .6fr; gap: var(--sp-8); margin-top: var(--sp-4); align-items: start; }
.faq { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 14.5px; }
.faq p { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.cta-band { background: var(--ink); color: var(--surface); text-align: center;
  border-radius: var(--r-card); padding: var(--sp-10) var(--sp-6); margin-top: var(--sp-8);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); }
.cta-band .display { color: var(--surface); font-size: 28px; margin: 0; }
.buyer-teaser { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--sp-8); }
.price-scroll { overflow-x: auto; }
.price-table th.hot, .price-table td.hot { background: var(--paper); }
.blur, .blur td { filter: blur(4px); user-select: none; pointer-events: none; }

/* ---------- SOP 레이스트랙 (시안 10a) ---------- */
.racetrack-wrap { position: relative; margin: var(--sp-8) 0 var(--sp-5); }
.racetrack { position: relative; border: 2px solid var(--ink); border-radius: 56px;
  height: 190px; margin: 26px 40px; }
.rt-row { position: absolute; left: 44px; right: 44px; display: flex;
  justify-content: space-between; align-items: center; }
.rt-row.top { top: 0; transform: translateY(-50%); }
.rt-row.bottom { bottom: 0; transform: translateY(50%); }
.rt-chip { background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-chip);
  padding: 5px 13px; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.rt-chip.win { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 700; }
.rt-gate { background: var(--paper); color: var(--amber); font-size: 12px; font-weight: 700;
  padding: 4px 8px; white-space: nowrap; }
.rt-gate i { font-style: normal; margin-right: 4px; }
.rt-tick { position: absolute; font-size: 11px; color: var(--faint); font-family: var(--font-mono); text-align: center; }
.rt-tick::before { content: ""; display: block; width: 1px; height: 12px; background: var(--ghost); margin: 0 auto 4px; }
.rt-zone { position: absolute; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: var(--text-label); letter-spacing: .16em;
  text-transform: uppercase; color: var(--ghost); }

/* ---------- seg 범례 ---------- */
.seg-legend { display: flex; gap: 16px; align-items: center; font-size: 11.5px; color: var(--faint);
  margin-bottom: var(--sp-3); flex-wrap: wrap; }
.seg-legend i { display: inline-block; width: 14px; height: 6px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.seg-legend .l-done i { background: var(--ink); }
.seg-legend .l-run i { background: var(--green-bar); }
.seg-legend .l-idle i { background: var(--stone); }
.seg-legend .l-gate { color: var(--amber); }

/* ---------- 기타 ---------- */
details.manage summary { cursor: pointer; font-size: 13px; color: var(--faint); }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: var(--sp-3); }
.stage-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stage-cell .k { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); letter-spacing: .1em; }
.stage-cell .n { font-size: 13px; font-weight: 700; color: var(--ink); margin: 2px 0 6px; }
.stage-cell form { display: inline; }

/* ---------- 반응형 ---------- */
@media (max-width: 1024px) {
  .detail-wrap { grid-template-columns: 1fr; }
  .side-rail { order: -1; }
}
@media (max-width: 720px) {
  main { padding: var(--sp-5) 16px 60px; }
  .band { padding: var(--sp-8) 16px; }
  .hero, .feature-grid, .detail-grid, .evidence { grid-template-columns: 1fr; }
  .display { font-size: 30px; }
  .stats { flex-direction: column; }
  .stats > div { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .stats > div:first-child { border-top: 0; }
  .site-header { flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px; }
  .site-header nav { gap: var(--sp-4); flex-wrap: wrap; }
  .site-header nav a { white-space: nowrap; font-size: 12.5px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .racetrack { margin: 26px 8px; }
  .rt-row { left: 30px; right: 30px; }
}

/* ---------- 랜딩 A/B 파츠 (contrl 구성 번안 — 색·그림자는 v1.0 토큰만) ---------- */
/* 어나운스 바 (A안) */
.announce { display: flex; justify-content: center; align-items: center; gap: 14px;
  background: var(--ink); color: var(--surface); font-size: 12.5px;
  padding: 8px 16px; margin: calc(-1 * var(--sp-8)) -40px var(--sp-6); }
.announce a { color: var(--surface); font-weight: 700; }

/* 히어로 실화면 + 플로팅 칩 */
.hero-shot-wrap { position: relative; }
.hero-shot-img { width: 100%; display: block; border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-float); background: var(--surface); }
.float-chip { position: absolute; }
.float-chip .chip { box-shadow: var(--shadow-card); }

/* 페인 포인트 — 잉크 다크 밴드 */
.band.dark { background: var(--ink); border: 0; }
.pain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.pain-card { border: 1px solid rgba(251,250,246,.14); border-radius: var(--r-card);
  padding: var(--sp-6); background: rgba(251,250,246,.04); }
.pain-quote { color: var(--surface); font-weight: 700; font-size: 15.5px; margin: 10px 0 14px; }
.pain-points { list-style: none; margin: 0; padding: 0; }
.pain-points li { color: #B0B1A3; font-size: 13.5px; padding: 5px 0 5px 18px; position: relative; }
.pain-points li::before { content: "–"; position: absolute; left: 0; color: var(--red); }
.pain-result { color: var(--amber); font-weight: 700; font-size: 13.5px;
  border-top: 1px solid rgba(251,250,246,.14); padding-top: 12px; margin: 14px 0 0; }

/* 구간별 상세 — 실화면 + F/B/D */
.step-detail { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8);
  align-items: center; margin-top: var(--sp-8); }
.step-detail.flip .sd-shot { order: 2; }
.sd-shot img { width: 100%; display: block; border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-card); background: var(--surface);
  max-height: 420px; object-fit: cover; object-position: top; }
.fbd { border-top: 1px solid var(--line); padding: 10px 0; }
.fbd p { margin: 2px 0 0; font-size: 13.5px; }
.fbd.diff { background: var(--amber-bg); border-top: 0; border-radius: 10px; padding: 10px 14px; }
.fbd.diff p { color: var(--ink); }

/* AEO — 푸터 직전 조용한 텍스트 */
.aeo { border-top: 1px solid var(--line); padding-top: var(--sp-5); }
.aeo h3 { font-size: 13px; margin: 14px 0 2px; color: var(--muted); }
.aeo p { margin: 0; font-size: 12.5px; color: var(--faint); line-height: 1.65; }

@media (max-width: 720px) {
  .pain-grid, .step-detail { grid-template-columns: 1fr; }
  .step-detail.flip .sd-shot { order: 0; }
  .announce { margin-left: -16px; margin-right: -16px; flex-wrap: wrap; text-align: center; }
}
