/* 레인 제목 — 흰 카드 위에 아무 경계 없이 얹혀 있어 위계가 생기지 않았다.
   단계 색의 옅은 면을 카드 폭만큼 깔고 아래 경계를 둬서 "여기부터 목록"을 만든다.
   색은 상태 점에 쓰던 변수를 그대로 쓰고(--todo/--doing/--done), HTML에 이미
   붙어 있던 stage-* 클래스를 훅으로 삼는다. */
.lane-header {
  margin: -14px -14px 12px;
  padding: 10px 14px;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  border-radius: 13px 13px 0 0;
  background: var(--stage-tint, var(--surface-2));
}
/* 굵기는 700 — 900(Black)은 획이 너무 강해 제목이 딱딱해 보였다. 자간은 0.05em으로
   넉넉히 벌리고, 색은 본문 검정(--text #17212b) 대신 --text와 --muted의 중간 톤인
   회색을 써서 존재감은 남기되 인상을 부드럽게 한다. */
.lane-header h3 { font-size: 17px; font-weight: 700; letter-spacing: 0.05em; color: #3d4a56; white-space: nowrap; }
.stage-todo { --stage-tint: rgba(71, 118, 180, 0.08); }
.stage-do { --stage-tint: rgba(192, 123, 38, 0.08); }
.stage-done { --stage-tint: rgba(39, 129, 93, 0.08); }
/* 부제에서 제목과 겹치던 문구(대기·완료·보류)를 걷어내 설명 pill만 남겼다. */
.lane-subhead { justify-content: flex-end; }
/* 건수 배지: 0건이어도 레인 헤더 바탕에 묻히지 않게 항상 단계 색 동그라미로 칠한다. */
.stage-todo .lane-header .count-badge { background: rgba(71, 118, 180, 0.16); color: var(--todo); }
.stage-do .lane-header .count-badge { background: rgba(192, 123, 38, 0.18); color: #8a5510; }
.stage-done .lane-header .count-badge { background: rgba(39, 129, 93, 0.16); color: var(--done); }

/* 탭 영역과 보드 사이는 그림자를 머금은 경계선 하나로만 나눈다 — 배경은 페이지와
   같은 색을 유지하고(면을 따로 깔지 않는다), 선 아래로만 그림자가 부드럽게 번진다. */
.topbar {
  position: relative;
  z-index: 5;
  margin: -28px -28px 24px;
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 9px -6px rgba(20, 33, 45, 0.26);
}
.topbar-heading {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#personalWorkPanel #holdNotice { display: none; }
.stage-done .lane-header .count-badge.hold { background: rgba(122, 94, 168, 0.15); color: var(--hold); }

.do-tag-message {
  padding: 4px 12px;
  border: 1px solid rgba(63, 95, 219, 0.3);
  border-radius: 999px;
  background: rgba(63, 95, 219, 0.08);
  color: #33449e;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.do-tag-message.hidden { display: none; }

.form-warning {
  margin: -6px 0 0;
  padding: 8px 12px;
  border: 1px solid #e5a3a3;
  border-radius: 6px;
  background: rgba(179, 38, 30, 0.08);
  color: #b3261e;
  font-size: 12.5px;
  font-weight: 800;
}
.form-warning.hidden { display: none; }
.primary-button:disabled { opacity: 0.5; cursor: not-allowed; }

#taskHistoryPage .filter-bar { grid-template-columns: 240px 190px minmax(220px, 1fr); }
/* 검색어가 걸린 글자 강조 — 본문 색은 그대로 두고 배경만 옅게 입힌다. */
.task-history-group mark { background: rgba(230, 162, 0, 0.32); color: inherit; border-radius: 3px; padding: 0 1px; }
.task-history-list { display: grid; gap: 14px; }
.task-history-group { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 16px 18px; }
.task-history-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.task-history-group-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.task-history-group-title strong { color: #111c27; font-size: 15px; font-weight: 900; }
.task-history-timeline { display: grid; gap: 0; border-left: 2px solid var(--line); margin-left: 6px; padding-left: 18px; }
.task-history-entry { position: relative; padding-bottom: 16px; }
.task-history-entry:last-child { padding-bottom: 0; }
.task-history-dot { position: absolute; left: -23px; top: 4px; width: 10px; height: 10px; border-radius: 999px; background: var(--muted); border: 2px solid var(--surface); }
.task-history-entry.status-do .task-history-dot { background: var(--doing); }
.task-history-entry.status-done .task-history-dot { background: var(--done); }
.task-history-entry.status-hold .task-history-dot { background: var(--hold); }
.task-history-entry-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.task-history-period { color: var(--primary-dark); font-size: 13.5px; font-weight: 900; white-space: nowrap; }
.task-history-week { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.task-history-entry-body p { margin: 0; font-size: 13px; color: var(--text); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-history-link-badge { display: inline-flex; align-items: center; min-height: 20px; border-radius: 999px; background: rgba(47, 103, 233, 0.12); color: var(--primary-dark); padding: 0 8px; font-size: 11px; font-weight: 800; }
.task-history-boundary-notice {
  position: relative;
  margin: -4px 0 12px;
  padding: 4px 10px;
  border: 1px solid #e8c37b;
  border-radius: 6px;
  background: rgba(230, 162, 0, 0.1);
  color: #7a5400;
  font-size: 11.5px;
  font-weight: 700;
}
/* 업무 구분 세그먼트 컨트롤 — 트랙 안에서 활성 탭만 색으로 채워 떠오른다.
   (기존 화살표형 탭은 브레드크럼처럼 보여 전환 컨트롤로 인지되지 않았다)
   어느 보드를 보고 있는지는 이 활성 탭 색 하나로만 말한다 — 보드 상단에
   가로 라인을 따로 두면 신호가 중복되고 그리드와 어긋나 보인다. */
:root {
  --tab-personal: var(--todo);
  --tab-team: var(--primary);
}
.work-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 4px;
}
.work-tab {
  position: relative;
  min-height: 40px;
  min-width: 128px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  padding: 0 20px;
  font-weight: 700;
  font-size: 14px;
  clip-path: none;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.work-tab:hover { color: var(--text); background: rgba(23, 33, 43, 0.05); }
.work-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.work-tab.active {
  color: #fff;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(23, 33, 43, 0.18);
}
.work-tab.active:hover { color: #fff; }
.work-tab[data-work-tab="personal"].active,
.work-tab[data-work-tab="personal"].active:hover { background: var(--tab-personal); }
.work-tab[data-work-tab="team"].active,
.work-tab[data-work-tab="team"].active:hover { background: var(--tab-team); }
/* 팀 전체 업무 탭 최초 1회 안내 말풍선 (닫으면 다시 뜨지 않는다) */
.work-tab-hint {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 380px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 10px 24px rgba(20, 33, 45, 0.24);
}
.work-tab-hint::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: var(--hint-arrow-x, 200px);
  margin-left: -7px;
  border: 7px solid transparent;
  border-bottom-color: var(--primary-dark);
}
.work-tab-hint p { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.45; }
.work-tab-hint strong { font-weight: 800; }
.work-tab-hint-close {
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
}
.work-tab-hint-close:hover { background: rgba(255, 255, 255, 0.3); }
.master-card-header, .team-task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.master-card-header h3 { margin: 0; }
.team-pipeline-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.team-pipeline-grid .lane { min-height: 540px; }
.add-tile {
  min-height: 52px;
  margin-top: 10px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.add-tile:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary-dark); }
.add-tile:disabled { cursor: not-allowed; opacity: 0.5; }
/* 할일이 없을 때 전주·금주 추가를 누르면 할일 칸의 + 타일을 두 번 맥박처럼 강조한다. */
.add-tile.attention-pulse {
  border-color: var(--todo);
  color: var(--todo);
  animation: attention-pulse 0.7s ease-out 2;
}
@keyframes attention-pulse {
  0% { box-shadow: 0 0 0 0 rgba(71, 118, 180, 0.45); background: rgba(71, 118, 180, 0.12); }
  100% { box-shadow: 0 0 0 10px rgba(71, 118, 180, 0); background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .add-tile.attention-pulse { animation-duration: 1.4s; animation-iteration-count: 1; animation-timing-function: steps(1, end); }
}
.add-tile:disabled:hover { background: transparent; border-color: var(--line); color: var(--muted); }

.do-add-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.do-add-row .add-tile { margin-top: 0; gap: 2px; }
.do-add-row.hidden { display: none; }
#doPickForm .field-hint { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
#doPickForm select.hidden { display: none; }
.do-pick-status { border: none; padding: 0; margin: 16px 0 0; min-inline-size: 0; }
.do-pick-status.hidden { display: none; }
.do-pick-status legend { padding: 0; margin-bottom: 7px; font-size: 12px; font-weight: 600; color: var(--muted); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segmented label { display: flex; align-items: center; justify-content: center; padding: 8px 4px; font-size: 13px; font-weight: 600; color: var(--muted); border-radius: 7px; cursor: pointer; user-select: none; white-space: nowrap; transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease; }
.segmented label:hover { color: var(--text); background: rgba(33, 110, 118, 0.07); }
.segmented input:checked + label { background: var(--surface); color: var(--primary); font-weight: 700; box-shadow: 0 1px 2px rgba(23, 33, 43, 0.14), 0 0 0 1px rgba(33, 110, 118, 0.12); }
.segmented input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 1px; }
#personalWorkPanel #personalWorkPanel .task-card { padding: 10px 12px; }
#personalWorkPanel .task-card:not(.expanded) { height: 70px; }
/* Do/Todo 카드는 상태 줄(태그·기간초과·이월)이 한 줄 추가되어 3줄 구성.
   배지가 줄바꿈되어도 제목까지 항상 보이도록 접힌 상태 높이를 내용에 맞춘다. */
#personalWorkPanel .task-card.status-do:not(.expanded),
#personalWorkPanel .task-card.status-todo:not(.expanded) { height: auto; min-height: 96px; }
#personalWorkPanel .task-card.expanded { min-height: 156px; }
#personalWorkPanel .task-card.status-do.expanded { min-height: 0; }
#personalWorkPanel .task-row-main { align-items: flex-start; }
#personalWorkPanel .task-row-copy { gap: 6px; }
#personalWorkPanel .expand-button { margin-top: 4px; }
.team-task-card {
  min-height: 96px;
  padding: 10px 12px;
}
.team-task-card:not(.expanded) { height: 96px; }
.team-task-card.expanded { min-height: 156px; }
.team-task-card.status-do { border-left-color: var(--doing); }
.team-task-card.status-done { border-left-color: var(--done); }
.team-task-card.status-hold { border-left-color: var(--hold); }
.team-task-card.expanded.status-do { border-left-color: var(--doing); }
.team-task-card.expanded.status-done { border-left-color: var(--done); }
.team-task-card.expanded.status-hold { border-left-color: var(--hold); }
.team-task-card .task-row-main { align-items: flex-start; }
.team-task-card .task-row-copy { gap: 6px; }
.team-task-card .expand-button { margin-top: 4px; }
.team-card-badges { min-width: 0; display: flex; align-items: center; gap: 5px; }
.team-card-badges .pill { min-height: 20px; border-radius: 6px; padding: 0 7px; background: #edf3f7; color: #496777; font-size: 11px; }
.team-card-work-type { margin-left: auto; }
.team-task-card .task-expanded { padding-top: 10px; }
.team-task-card .task-actions { margin-top: 0; }
.master-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.master-card {
  display: grid;
  gap: 16px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
}
.member-master-card { grid-column: 1 / -1; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.member-form { display: grid; grid-template-columns: 1.3fr .8fr 1fr 1fr auto; gap: 8px; align-items: end; }
.master-chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.master-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 0 7px 0 12px;
  font-size: 13px;
  font-weight: 800;
}
.master-chip button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--danger);
  padding: 0;
}
.member-master-list { display: grid; gap: 8px; }
.member-master-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
}
.member-master-row img, .member-photo-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.member-photo-fallback {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--primary-dark);
  font-weight: 900;
}
.member-master-row strong, .member-master-row small { display: block; }
.member-master-row small { margin-top: 4px; color: var(--muted); }
.view-detail dl { display: grid; grid-template-columns: 100px 1fr; gap: 0; margin: 0; }
.view-detail dt, .view-detail dd { margin: 0; border-bottom: 1px solid var(--line); padding: 11px 0; }
.view-detail dt { color: var(--muted); font-weight: 800; }
.view-detail dd { color: var(--text); overflow-wrap: anywhere; }

.week-migration-body { margin: 0; color: var(--text); font-size: 14px; line-height: 1.6; }
.week-migration-body strong { color: #111c27; }
@media (max-width: 1400px) {
  .team-pipeline-grid, #personalWorkPanel .pipeline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .team-pipeline-grid, #personalWorkPanel .pipeline-grid, .master-grid, .member-form { grid-template-columns: 1fr; }
  .member-master-card { grid-column: auto; }
  .topbar { margin: -18px -18px 20px; padding: 14px 18px 12px; }
  #taskHistoryPage .filter-bar { grid-template-columns: 1fr; }
  .lane-header { margin: -18px -18px 12px; padding: 10px 18px; }
  .work-tabs { width: 100%; }
  .work-tab { flex: 1; min-width: 0; padding: 0 8px; }
  .do-matrix-row { grid-template-columns: 1fr; }
}

.period-overdue-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 6px;
  border: 1px solid #e5a3a3;
  border-radius: 999px;
  background: rgba(179, 38, 30, 0.1);
  color: #b3261e;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

.team-carry-tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border: 1px solid #e8c37b;
  border-radius: 999px;
  background: rgba(230, 162, 0, 0.12);
  color: #9a6b00;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 800;
}

.do-matrix-row { align-items: stretch; }
.do-cell-empty { height: 100%; }
.do-placeholder-card { height: 100%; }

/* 진행중 헤더의 회의 배지 — 제목 바로 옆에 붙고, 조작 버튼은 오른쪽 끝에 남는다.
   태그 변경 알림(do-tag-message)이 뜨는 동안은 자리를 비켜 준다.
   레인이 좁으면 배지만 다음 줄로 내린다(아래 @container). */
.stage-do { container-type: inline-size; }
.meeting-badge-slot { margin-right: auto; }
.do-tag-message:not(.hidden) ~ .meeting-badge-slot { display: none; }
.meeting-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #b9cde6;
  border-radius: 999px;
  background: #e8f0fa;
  color: #1f4f8a;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.meeting-badge:empty { display: none; }
.meeting-badge.is-other-week { border-color: var(--line); background: var(--surface-2); color: var(--muted); }
.stage-do .lane-header { flex-wrap: wrap; row-gap: 8px; }
@container (max-width: 560px) {
  .meeting-badge-slot { order: 3; flex-basis: 100%; }
}

/* 주간 기준 창: 새 설정으로 오늘 보이는 두 주와 회의 날짜, 변경 영향 */
.week-settings-preview {
  display: grid;
  gap: 4px;
  border: 1px solid #b9cde6;
  border-radius: 8px;
  background: #f1f6fc;
  color: #1f3f66;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}
.week-settings-preview:empty { display: none; }
.week-settings-status { margin-top: 4px; font-weight: 600; }
.week-settings-status.is-forward { color: #7a5400; }
.week-settings-status.is-backward { color: #b3261e; }

.do-preview-notice {
  margin-bottom: 10px;
  border: 1px solid #e8c37b;
  border-radius: 8px;
  background: rgba(230, 162, 0, 0.08);
  color: #7a5400;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
}
.do-preview-notice.hidden { display: none; }

.task-status-line { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.task-status-line .period-overdue-badge,
.task-status-line .carryover-badge { margin-left: 0; }

.carryover-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 6px;
  border: 1px solid #e8c37b;
  border-radius: 999px;
  background: rgba(230, 162, 0, 0.12);
  color: #9a6b00;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.task-row-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.delete-icon-button, .week-move-button {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border: 1px solid #c9d6df;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fa 100%);
  color: #355d70;
  padding: 0;
  box-shadow: 0 1px 2px rgba(20, 46, 61, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.delete-icon-button svg, .week-move-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.delete-icon-button:hover { border-color: #e5a3a3; color: #b3261e; box-shadow: 0 2px 5px rgba(179, 38, 30, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.95); }
/* 주 옮기기(◀ 전주로 / ▶ 금주로) — 되돌리기와 같은 모양이되 지우는 동작이 아니라서
   호버 색만 주조색으로 둔다. 옮길 수 없는 카드에는 버튼 자체가 안 붙는다. */
.week-move-button:hover { border-color: var(--primary); color: var(--primary-dark); box-shadow: 0 2px 5px rgba(33, 110, 118, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.95); }

.editable-field { cursor: pointer; border-radius: 4px; transition: background 120ms ease; }
.task-title.editable-field { justify-self: start; max-width: 100%; }
.editable-field:hover { background: rgba(33, 110, 118, 0.08); }
.task-period.editable-field, .task-title.editable-field { padding: 1px 4px; margin: -1px -4px; }
.task-card p.editable-field { padding: 4px 6px; margin: 7px -6px 10px; }
.field-editor { display: inline-flex; align-items: center; gap: 6px; }
.task-card { position: relative; }
.task-card.period-editing { overflow: visible; z-index: 40; }
.period-field { position: relative; display: inline-flex; }
.task-period.is-editing { font-weight: 900; color: var(--primary-dark); }
.team-period-field { position: relative; display: block; }
.team-period-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: var(--surface-2);
  border-radius: 12px;
  min-height: 46px;
  padding: 11px 14px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.team-period-toggle:hover { background: #eef1f3; }
.team-period-toggle.is-active { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(33, 110, 118, 0.14); }
.period-editor {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  display: flex;
  gap: 22px;
  align-items: flex-start;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(20, 33, 45, 0.22);
  padding: 18px 20px;
  width: max-content;
  max-width: min(640px, 92vw);
}
.team-period-editor { position: fixed; top: 0; left: 0; z-index: 60; }
.period-month { display: flex; flex-direction: column; gap: 10px; min-width: 220px; }
.period-month-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.period-month-head strong { color: #111c27; font-size: 14px; font-weight: 900; }
.period-nav, .period-nav-spacer { width: 26px; height: 26px; flex: 0 0 26px; }
.period-nav {
  display: grid;
  place-items: center;
  border: 1px solid #d8dee3;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font-size: 14px;
  cursor: pointer;
}
.period-nav:hover { background: #f3f4f6; }
.period-weekdays, .period-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.period-weekdays { gap: 2px; text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.period-days { gap: 16px 2px; }
.period-day, .period-day-empty { width: 32px; height: 32px; }
.period-day-empty { visibility: hidden; }
.period-day {
  position: relative;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #111c27;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.period-day:hover { background: #f0f0f0; }
.period-day.is-in-range { background: #f2f2f2; border-radius: 0; }
.period-day.is-start, .period-day.is-end {
  background: #111c27;
  color: #fff;
  border-radius: 999px;
}
.period-day-num { pointer-events: none; }
.period-day-badge {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 3px;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}
.period-day-badge.start { background: #2f9e44; }
.period-day-badge.end { background: #e8590c; }
.period-day-badge.both { background: linear-gradient(90deg, #2f9e44 50%, #e8590c 50%); }
.title-editor { display: flex; align-items: center; gap: 6px; width: 100%; }
.title-worktype-input {
  flex: 0 0 60px;
  width: 60px;
  min-height: 26px;
  border: 1px solid #9fb3c8;
  border-radius: 4px;
  background: #fff;
  color: #17384b;
  padding: 1px 14px 1px 4px;
  font-size: 11px;
  font-weight: 800;
}
.title-text-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 26px;
  border: 1px solid #9fb3c8;
  border-radius: 4px;
  background: #fff;
  color: #111c27;
  padding: 1px 8px;
  font-size: 13px;
  font-weight: 700;
}
.report-status { margin: 0 0 18px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.rs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 14px; }
.rs-missing-count { font-size: 12px; font-weight: 700; color: var(--accent); }
.rs-all-done { font-size: 12px; font-weight: 600; color: var(--primary); }
.rs-list { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.rs-name { font-size: 13px; font-weight: 600; color: var(--text); }
.rs-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.rs-written .rs-badge { background: #dff3ec; color: #0f6e56; }
.rs-missing .rs-badge { background: #fbe3dd; color: #a83a22; }
/* 팀 진행중: 팀원별 묶음 박스(누구 업무인지 헤더에 한 번만 표시) */
.team-do-group { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.team-do-group-head { display: flex; align-items: center; gap: 8px; }
.team-do-group-count { font-size: 11.5px; color: var(--muted); }
/* 개인 보드 Do 카드와 동일한 높이 규칙(전역 .task-card 고정 높이 때문에 상세가 잘리는 걸 방지) */
#teamWorkPanel .team-do-card:not(.expanded) { height: auto; min-height: 96px; }
#teamWorkPanel .team-do-card.expanded { height: auto; min-height: 0; }
.team-do-card { cursor: pointer; }
.task-card.needs-report { background: rgba(240, 146, 42, 0.12); border-color: rgba(216, 120, 40, 0.6); }
.detail-editor-textarea {
  width: 100%;
  margin: 7px 0 10px;
  border: 1px solid #9fb3c8;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 7px 8px;
  font-size: 13px;
  line-height: 1.45;
  resize: none;
  overflow: hidden;
}

/* ---------- DB 동기화(db-sync.js): 인증·초대·권한 게이팅 ---------- */
.login-form input[type="email"], .login-form input[type="password"], .login-form input[type="text"] {
  width: 100%; min-height: 42px; border: 1px solid #d8d8d8; border-radius: 10px; padding: 0 12px; font: inherit;
}
.login-form form { display: grid; gap: 8px; margin: 0; }
#authModeToggle, #orgSetupSignOut { margin-top: 4px; }
.org-setup-divider { text-align: center; color: #999; font-size: 12.5px; margin: 12px 0; }
#orgSetupSection { display: grid; gap: 6px; }
#orgSetupSection.hidden { display: none; }

.invite-status.linked { color: #217646; font-weight: 700; font-size: 12.5px; }
.invite-code { font-family: ui-monospace, monospace; font-weight: 800; letter-spacing: 1px; background: #f2f7f6; border: 1px dashed #216e76; color: #216e76; border-radius: 8px; padding: 4px 10px; }
.invite-issue { white-space: nowrap; }

/* 관리자(owner/leader)가 아니면 조직 설정·마스터 편집·초대 UI를 숨긴다 (RLS와 동일 기준) */
body.not-admin #openWeekSettings,
body.not-admin #locationForm,
body.not-admin #workTypeForm,
body.not-admin #memberForm,
body.not-admin #inviteCard,
body.not-admin .master-chip-list button,
body.not-admin .member-master-list button { display: none !important; }

/* ---------- 팀 코드 · 참여 요청 승인 ---------- */
#joinPendingSection { display: grid; gap: 8px; }
#joinPendingSection.hidden { display: none; }
.team-code-row { display: flex; align-items: center; gap: 10px; }
.team-code-row .invite-code { font-size: 16px; padding: 6px 14px; }
.join-request-item { flex-wrap: wrap; gap: 8px; }
.join-request-actions { display: flex; align-items: center; gap: 6px; }
.join-request-actions select { min-height: 32px; border: 1px solid #d8d8d8; border-radius: 8px; font: inherit; padding: 0 8px; max-width: 180px; }
.join-request-actions .primary-button, .join-request-actions .ghost-button { min-height: 32px; padding: 0 12px; }
.nav-item .count-badge { margin-left: auto; }

/* ---------- 로그인/회원가입 폼 위계 ---------- */
.auth-title { margin: 0 0 2px; font-size: 20px; font-weight: 800; color: var(--text); }
.auth-form .field-hint { margin: -6px 0 0; font-size: 12px; color: var(--muted); }
#authPasswordConfirmRow { display: grid; gap: 7px; }
#authPasswordConfirmRow.hidden { display: none; }

/* 비밀번호 표시 토글.
   styles.css의 `.login-form button`이 모든 버튼을 주 버튼(높이 42·청록 배경)으로
   칠하므로, 같은 구체성 이상으로 눌러써야 입력칸 안의 작은 텍스트 버튼이 된다. */
.password-field { position: relative; display: block; }
.login-form .password-field input { width: 100%; box-sizing: border-box; padding-right: 60px; }
.login-form button.password-reveal {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: auto; height: 30px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.login-form button.password-reveal:hover { color: var(--primary); background: rgba(33, 110, 118, 0.10); }

.checkbox-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.checkbox-label input { width: 16px; height: 16px; min-height: 0; accent-color: var(--primary); margin: 0; }

/* 주 동작(로그인/가입)만 채운 버튼, 모드 전환은 문장형 링크 */
.auth-switch { margin: 2px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.login-form .text-link {
  min-height: 0; padding: 0 2px; border: 0; background: none;
  color: var(--primary); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer;
}
.login-form .text-link:hover { background: none; color: var(--primary-dark); }

/* ---------- 개선 요청 ---------- */
.feature-request-notice { margin: -4px 0 0; line-height: 1.6; color: var(--muted); }

/* 팝업 안 탭: 새 요청 / 내 요청 */
#featureRequestModal .modal-card { width: min(560px, 100%); }
.request-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -2px 0 2px; }
.request-tab {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.request-tab:hover { color: var(--text); }
.request-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.request-tab .count-badge { background: var(--surface-2); color: var(--muted); }
.request-tab.active .count-badge { background: rgba(33, 110, 118, 0.14); color: var(--primary); }
.request-panel { display: grid; gap: 14px; }
.request-panel.hidden { display: none; }
.request-list { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; }
.request-item { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 12px 14px; }
#featureRequestForm textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; line-height: 1.6;
  border: 1px solid var(--line); border-radius: 8px; resize: vertical;
}
.request-item { display: grid; gap: 8px; }
.request-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.request-list .field-hint { margin: 0; padding: 20px 0; text-align: center; }
.request-status {
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800;
  background: #eef1f4; color: #5a6572;
}
.request-status[data-tone="reviewing"] { background: #fff3e0; color: #a35b00; }
.request-status[data-tone="planned"]   { background: #e8f1ff; color: #1f5fbf; }
.request-status[data-tone="done"]      { background: #e6f5ec; color: #1c7a45; }
.request-status[data-tone="declined"]  { background: #f3eef4; color: #6d5773; }
.request-type { font-size: 12px; font-weight: 700; color: var(--muted); }
.request-date { margin-left: auto; font-size: 12px; color: var(--muted); }
.request-title { margin: 0; font-size: 15px; font-weight: 800; }
.request-body { margin: 0; color: var(--muted); line-height: 1.65; white-space: pre-wrap; }
.request-answer {
  margin-top: 2px; padding: 10px 12px; border-radius: 8px;
  background: rgba(33, 110, 118, 0.07); border-left: 3px solid var(--primary);
}
.request-answer strong { display: block; font-size: 12px; color: var(--primary); margin-bottom: 4px; }
.request-answer p { margin: 0; line-height: 1.65; white-space: pre-wrap; }

/* 진행중 보고 순서 — 행(같은 업무의 전주·금주 묶음)을 통째로 올리고 내린다.
   카드 위에 겹치지 않도록 매트릭스 왼쪽에 전용 여백을 두고, 머리글·추가 버튼 줄도
   같은 여백을 받아 칸 정렬이 그대로 유지된다. 순서를 바꿀 수 없는 주(과거 주 조회)나
   행이 하나뿐일 때는 has-reorder가 빠져 여백째 사라진다 — 원래 화면 그대로다. */
.do-reorder-spacer { display: none; }
#personalWorkPanel .do-matrix.has-reorder .do-matrix-head,
#personalWorkPanel .do-matrix.has-reorder .do-matrix-row,
#personalWorkPanel .do-matrix.has-reorder .do-add-row { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); }
#personalWorkPanel .do-matrix.has-reorder .do-reorder-spacer { display: block; }
.do-reorder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.do-reorder-button {
  width: 24px; height: 22px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  color: #7c8892; font-size: 9px; line-height: 1; opacity: 0.35;
  transition: opacity 140ms ease, color 140ms ease, border-color 140ms ease;
}
.do-matrix-row:hover .do-reorder-button { opacity: 1; }
.do-reorder-button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-dark); }
.do-reorder-button:focus-visible { opacity: 1; }
.do-reorder-button:disabled { opacity: 0.12; cursor: default; }
.do-matrix-row:hover .do-reorder-button:disabled { opacity: 0.2; }

/* 좁은 화면에서는 전주/금주가 위아래로 쌓인다. 왼쪽 여백을 만들면 칸이 엇갈리므로
   기존 1열 배치를 그대로 두고, 순서 버튼만 그 줄 위에 가로로 붙인다(hover가 없어 항상 보임). */
@media (max-width: 860px) {
  #personalWorkPanel .do-matrix.has-reorder .do-matrix-head,
  #personalWorkPanel .do-matrix.has-reorder .do-matrix-row { grid-template-columns: 1fr; }
  #personalWorkPanel .do-matrix.has-reorder .do-add-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #personalWorkPanel .do-matrix.has-reorder .do-reorder-spacer { display: none; }
  #personalWorkPanel .do-matrix-row > .do-reorder { flex-direction: row; justify-content: flex-end; }
  #personalWorkPanel .do-reorder-button { opacity: 1; }
}
