* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, "Malgun Gothic", sans-serif;
  background: #0d1b2a;
  color: #ffffff;
  margin: 0;
  padding: 20px;
}

.wrap, .card {
  max-width: 460px;
  margin: 0 auto;
}

h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #ffffff;
}

.card h1 {
  font-size: 2.2rem;
  margin-bottom: 0.3rem;
  text-align: center;
}

p.role {
  color: #8fa3b8;
  margin-top: 0;
  margin-bottom: 2rem;
  line-height: 1.5;
  text-align: center;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

a.link-btn, button, input[type="submit"] {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: #16324a;
  border: none;
  border-radius: 3px;
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

a.link-btn:hover, button:hover {
  background: #8b7ff0;
  color: #0d1b2a;
}

.accent {
  color: #8b7ff0;
}

label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  color: #8fa3b8;
  font-size: 0.9rem;
  font-weight: 600;
}

input, textarea, select {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: none;
  border-radius: 3px;
  color: #0d1b2a;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
}

/* 프로젝트 유형/조건 체크박스 - 일반 input 스타일(흰 박스, 100% 너비)이 적용되면 안 되니
   input[type=checkbox] 쪽 특이도를 높여서 따로 덮어씀 */
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 4px;
}
.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: none;
  cursor: pointer;
}
.check-row input[type="checkbox"] {
  width: auto;
  background: none;
  padding: 0;
  accent-color: #8b7ff0;
  cursor: pointer;
}

/* 날짜 선택 전용 - 흰 입력칸 대신 작은 달력 아이콘 버튼처럼 보이게 함.
   실제 <input type="date">는 투명하게 그 위에 얹어서 클릭/탭하면 브라우저 기본 달력이 뜨고,
   선택된 값은 옆의 datepick-text에 연도 없이(M/D) 짧게 표시함 */
.datepick {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: auto;
}
.datepick-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  padding: 0;
  border: none;
  cursor: pointer;
}
.datepick-display {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #16324a;
  border-radius: 3px;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: #ffffff;
  white-space: nowrap;
  pointer-events: none;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

button[type="submit"] {
  margin-top: 24px;
}

button:disabled {
  background: #ccc;
  border-color: #ccc;
  color: #666;
}

.msg {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 3px;
  font-size: 0.9rem;
  display: none;
}
.msg.ok { background: #e6f6ea; color: #1a7a34; display: block; }
.msg.err { background: #fdeceb; color: #b3251a; display: block; }

a.back {
  display: inline-block;
  margin-top: 10px;
  margin-bottom: 20px;
  color: #8fa3b8;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.empty {
  color: #8fa3b8;
  text-align: center;
  margin-top: 40px;
}

/* 프로젝트 카드(목록) */
.project-card {
  display: block;
  background: #16324a;
  border: none;
  border-radius: 3px;
  padding: 16px 18px;
  margin-bottom: 14px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.project-card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.project-card .name {
  font-weight: 800;
  font-size: 1.05rem;
}
.project-card .due {
  font-size: 0.8rem;
  color: #8fa3b8;
  margin-bottom: 10px;
}
.project-card .due.overdue { color: #e8362a; font-weight: 700; }

.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.status-badge.status-진행중 { background: #8b7ff0; color: #0d1b2a; }
.status-badge.status-완료 { background: #3ecf8e; color: #0d1b2a; }
.status-badge.status-보류 { background: #6b7d8f; color: #ffffff; }

.progress-outer {
  width: 100%;
  height: 10px;
  background: #0d1b2a;
  border-radius: 6px;
  overflow: hidden;
}
.progress-inner {
  height: 100%;
  background: #8b7ff0;
  transition: width 0.3s;
}
.progress-label {
  font-size: 0.75rem;
  color: #8fa3b8;
  margin-top: 6px;
  text-align: right;
}

/* 프로젝트 상세 - 타임라인 */
.timeline-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.timeline-add-row input { flex: 1; }
.timeline-add-row button { width: auto; margin-top: 0; padding: 10px 16px; }

.timeline-event-label {
  font-size: 0.75rem;
  color: #8fa3b8;
  margin-bottom: 6px;
}
.timeline-scroll {
  /* overflow-x:auto를 주면 overflow-y:visible이 무시되고 auto로 강제 전환되는 CSS 특성 때문에
     지그재그로 내려간 2줄짜리 라벨이 짤려서 세로 스크롤이 생겼음 - 위아래 여백을 넉넉히 줘서
     세로 스크롤이 아예 필요 없게(내용이 항상 다 들어가게) 만듦 */
  overflow-x: auto;
  padding: 40px 70px 90px;
  margin: 0 -20px 6px;
  cursor: grab;
  /* 스크롤바를 안 보이게 숨기고(PC에서도 폰처럼) 대신 JS로 마우스 드래그를 지원함 */
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* 브라우저의 "스크롤 앵커링"이 내용 재생성 후 JS가 복원한 스크롤 위치를 제멋대로 다시
     조정해버리는 걸 막음 - 안 그러면 마일스톤을 눌러도 스크롤이 살짝 있다가 튐 */
  overflow-anchor: none;
}
.timeline-scroll::-webkit-scrollbar { display: none; }
.timeline-scroll.dragging { cursor: grabbing; }
.timeline-track {
  position: relative;
  height: 4px;
}
.timeline-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #16324a;
  border-radius: 2px;
}
/* 오늘까지 지나간 시간만큼 채워지는 선 - 마일스톤 완료색(초록)과 구분되는 회색조라
   "시간은 이만큼 지났는데 초록(완료)이 여기까지 안 왔다"는 걸 한눈에 비교할 수 있음 */
.timeline-line-elapsed {
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  background: #56708a;
  border-radius: 2px;
}
.timeline-today-tick {
  position: absolute;
  top: -6px;
  width: 2px;
  height: 16px;
  background: #e8362a;
  transform: translateX(-50%);
}
.timeline-today-label {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: #e8362a;
  white-space: nowrap;
}
.timeline-marker {
  position: absolute;
  top: -11px;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  /* 배경(파이차트)은 JS에서 완료율에 따라 conic-gradient로 매번 계산해서 넣음 */
  cursor: pointer;
  border: 3px solid #0d1b2a;
  box-sizing: content-box;
}
.timeline-marker.selected { box-shadow: 0 0 0 4px rgba(139, 127, 240, 0.45); }
/* 마일스톤을 누르면 점 아래로 짧은 선이 내려와서 "여기서 아래로 이어진다"는 걸 보여줌 */
.timeline-marker.selected::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 14px;
  background: #8b7ff0;
}
/* 타임라인 점을 눌렀을 때 바로 아래 뜨는 단일 마일스톤 카드 */
.timeline-detail-card {
  background: #16324a;
  border-radius: 3px;
  padding: 14px;
  margin-bottom: 14px;
}
.timeline-detail-card .milestone-row-head {
  padding: 0 0 12px;
  cursor: default;
}

/* 마일스톤 아코디언 목록 - 원(파이차트)+제목/날짜를 누르면 아래로 할일 목록이 펼쳐짐 */
.milestone-row {
  background: #16324a;
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}
.milestone-row-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.milestone-pie {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #0d1b2a;
  box-sizing: border-box;
}
.milestone-row-info { flex: 1; min-width: 0; }
.milestone-row-title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.milestone-row-date {
  font-size: 0.75rem;
  color: #8fa3b8;
  margin-top: 2px;
}
.milestone-row-chevron {
  color: #8fa3b8;
  font-size: 0.7rem;
  flex: 0 0 auto;
}
.milestone-row-body {
  padding: 0 14px 14px;
}

/* 연결(등록)만 하는 평범한 버튼과 구분되게, 실제로 내보내기가 실행되는 버튼은 강조색으로 표시 */
.btn-accent {
  background: #8b7ff0;
  color: #0d1b2a;
}
.btn-accent:hover {
  background: #a89bff;
}

/* 간트차트 "생성"(최초 1회, 만드는 동작)과 "가져오기"(그 이후 반복하는 동기화 동작)를
   색으로 구분 - 가져오기는 앱에서 "완료/정상" 의미로 이미 쓰는 초록을 재사용 */
.btn-accent-green {
  background: #3ecf8e;
  color: #0d1b2a;
}
.btn-accent-green:hover {
  background: #63dba4;
}

/* 구글 드라이브 열기 - 배경/테두리 없이 아이콘만 (기본 button의 padding을 반드시
   0으로 눌러줘야 함 - 안 그러면 큰 기본 padding 때문에 아이콘이 안으로 짜부러져 안 보임) */
.sheet-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  flex-shrink: 0;
}
.sheet-icon-btn:hover {
  opacity: 0.75;
}
/* 마일스톤 추가/할일 추가/메모 추가 - 작은 텍스트 버튼, 누르면 아래로 입력창이 펼쳐짐 */
.add-trigger-btn {
  width: auto;
  margin: 0;
  padding: 6px 12px;
  font-size: 0.8rem;
  background: none;
  color: #8fa3b8;
}
/* 날짜는 동그라미 위, 마일스톤 이름(들)은 동그라미 아래 - 전부 왼쪽 정렬로 맞춤.
   가까운 마일스톤끼리는 JS가 하나의 클러스터로 묶어서 날짜 하나 + 이름 목록으로 보여줌 */
.timeline-cluster-date {
  position: absolute;
  bottom: 100%;
  margin-bottom: 6px;
  font-size: 0.7rem;
  color: #8fa3b8;
  white-space: nowrap;
  text-align: left;
}
.timeline-cluster-names {
  position: absolute;
  top: 100%;
  margin-top: 8px;
  text-align: left;
  max-width: 140px;
}
.timeline-cluster-name {
  font-size: 0.7rem;
  line-height: 1.4;
  color: #8fa3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.timeline-cluster-name:hover { color: #ffffff; }
/* 클러스터끼리도 너무 붙어 보이면 한 칸씩 지그재그로 더 벌림 */
.timeline-cluster-date.stagger { margin-bottom: 22px; }
.timeline-cluster-names.stagger { margin-top: 24px; }

/* WBS 간트뷰 - 막대 대신 얇은 선으로 기간 표시 */
.gantt-view {
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 4px;
}
.gantt-range {
  font-size: 0.7rem;
  color: #8fa3b8;
  margin-bottom: 8px;
  min-width: 420px;
}
.gantt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 420px;
  margin-bottom: 8px;
}
.gantt-label {
  flex: 0 0 110px;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-label.done {
  color: #6b7d8f;
  text-decoration: line-through;
}
.gantt-track {
  position: relative;
  flex: 1;
  height: 10px;
  background: #16324a;
  border-radius: 5px;
  overflow: hidden;
}
.gantt-line {
  position: absolute;
  top: 3px;
  height: 4px;
  border-radius: 2px;
  background: #8b7ff0;
}
.gantt-line.done {
  background: #3ecf8e;
}
.gantt-group {
  margin-bottom: 14px;
}
.gantt-group-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #8b7ff0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  min-width: 420px;
}

/* 팀 구성 */
.team-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #16324a;
  border-radius: 3px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.team-name {
  font-weight: 700;
}
.team-role {
  font-size: 0.8rem;
  color: #8fa3b8;
}
.team-item .team-del {
  margin-left: auto;
  width: auto;
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* 프로젝트 상세 - 할일 */
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #16324a;
  border: none;
  border-radius: 3px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.todo-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  accent-color: #8b7ff0;
  cursor: pointer;
}
.todo-item .todo-text {
  flex: 1;
  font-size: 1rem;
  word-break: break-word;
  cursor: text;
  outline: none;
  border-radius: 2px;
}
.todo-item .todo-text:focus {
  background: #1e3a52;
}
.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: #6b7d8f;
}
.todo-item .todo-due {
  font-size: 0.75rem;
  color: #8fa3b8;
  white-space: nowrap;
}
.todo-item .todo-del {
  width: auto;
  margin-top: 0;
  padding: 4px 10px;
  font-size: 0.8rem;
}
.todo-item .wbs-edit-toggle {
  width: auto;
  margin: 0;
  padding: 4px 10px;
  font-size: 0.8rem;
  background: #0d1b2a;
}
/* 하위 업무가 있는(=완료 체크 대상이 아닌) 상위 업무 표시 - 체크박스 자리에 짙은 색으로
   채워진 사각형을 대신 넣고, 이름도 굵게 해서 말단 업무와 한눈에 구분되게 함 */
.wbs-node-group-mark {
  display: inline-block;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 4px;
  background: #0d1b2a;
  border: 2px solid #3ecf8e;
  box-sizing: border-box;
}
.wbs-name-group {
  font-weight: 800;
}
/* WBS 트리 - 하위 업무 메타(담당/산출물/진행률)는 체크박스 폭만큼 들여써서 이름과 줄을 맞춤 */
.wbs-node-meta {
  font-size: 0.72rem;
  color: #8fa3b8;
  margin: -4px 0 8px 32px;
}
/* 조직도(팀 구성)가 있으면 "담당 OOO" 글씨를 눌러서 담당자를 바로 바꿀 수 있음 */
.wbs-assignee-pick {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.wbs-assignee-pick:hover {
  color: #ffffff;
}
.assignee-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px 32px;
}
.assignee-pick-btn {
  width: auto;
  margin: 0;
  padding: 4px 10px;
  font-size: 0.75rem;
  background: #0d1b2a;
}
.assignee-pick-clear {
  background: #2a3f52;
  color: #8fa3b8;
}
.wbs-children {
  margin-top: 2px;
}
.wbs-tree {
  margin-bottom: 4px;
}
.task-edit-box {
  margin: 4px 0 10px;
}
.task-edit-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
  margin-top: 8px;
}
.task-edit-grid label {
  margin: 0;
  font-size: 0.8rem;
  color: #8fa3b8;
  font-weight: 600;
  text-transform: none;
}
.todo-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.todo-add-row input {
  flex: 1;
}
.todo-add-row button {
  width: auto;
  margin-top: 0;
  padding: 10px 16px;
}

/* 메모/문서 첨부 */
.note-item {
  background: #16324a;
  border: none;
  border-radius: 3px;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  word-break: break-word;
}
.note-item a { color: #8b7ff0; }
.note-item .note-del {
  width: auto;
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #8fa3b8;
  margin: 26px 0 12px;
}

a.hwp-btn {
  text-transform: none;
  background: #cfe9f5;
  color: #0d1b2a;
}
a.hwp-btn:hover {
  background: #a9d7ec;
  color: #0d1b2a;
}
