/* ============================================================
   MoSE Task Board — 스타일
   색상 토큰은 라이트/다크 두 모드를 각각 선택해 정의합니다.
   ============================================================ */

:root {
  color-scheme: light;

  --plane:          #f9f9f7;
  --surface-1:      #fcfcfb;
  --surface-2:      #f2f1ed;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --muted:          #898781;
  --grid:           #e1e0d9;
  --axis:           #c3c2b7;
  --border:         rgba(11, 11, 11, 0.10);
  --shadow:         0 1px 2px rgba(11, 11, 11, 0.05);

  /* 상태 색 — 항상 라벨/아이콘과 함께 쓰며 색만으로 구분하지 않습니다 */
  --st-done:  #0ca30c;
  --st-doing: #2a78d6;
  --st-todo:  #898781;
  --st-verify: #8a5cd6;
  --st-late:  #d03b3b;

  /* MoSE(국민대) 심볼에서 딴 브랜드 파랑. 다크 모드는 같은 색상의 밝은 단계를 따로 고른다 */
  --accent:      #055dab;
  --accent-ink:  #ffffff;
  --radius:      10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --plane:          #0d0d0d;
    --surface-1:      #1a1a19;
    --surface-2:      #232322;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --muted:          #898781;
    --grid:           #2c2c2a;
    --axis:           #383835;
    --border:         rgba(255, 255, 255, 0.10);
    --shadow:         none;
    --st-doing:       #3987e5;
    --st-verify:      #a179e6;
    --accent:         #2b86d9;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --plane:          #0d0d0d;
  --surface-1:      #1a1a19;
  --surface-2:      #232322;
  --text-primary:   #ffffff;
  --text-secondary: #c3c2b7;
  --muted:          #898781;
  --grid:           #2c2c2a;
  --axis:           #383835;
  --border:         rgba(255, 255, 255, 0.10);
  --shadow:         none;
  --st-doing:       #3987e5;
  --st-verify:      #a179e6;
  --accent:         #2b86d9;
}

/* 로고 태그라인이 Gotham 계열 지오메트릭 산세리프라, 오픈 폰트 중 가장 가까운
   Montserrat(OFL)를 직접 받아 함께 둔다. 브랜드 글자에만 쓰고 본문은 시스템 폰트 그대로. */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;                 /* 폰트가 늦어도 글자는 바로 보이게 */
  src: url('montserrat-700.woff2') format('woff2');
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--plane);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── 헤더 ─────────────────────────────────────────────── */
.app-header {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px 18px; padding: 10px 24px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }

/* 브랜드 아이콘 — MoSE 로고에서 'o' 자리를 차지하는 자물쇠를 비율 그대로 옮겨 그렸다.
   이미지가 아니라 벡터라 어느 배율에서도 또렷하고, 열쇠구멍은 타일 색을 그대로 따라간다. */
.brand-mark {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-mark-lg { width: 46px; height: 46px; border-radius: 12px; }
.brand-mark-lg svg { width: 34px; height: 34px; }

/* 헤더의 MoSE 로고 — 부제(Mobility Cybersecurity)를 뺀 윗부분만. 글자색을 따라간다 */
.header-logo {
  display: block; flex: none; height: 28px; aspect-ratio: 286 / 96;
  background: var(--text-primary);
  -webkit-mask: url('mose-mark.png') center / contain no-repeat;
          mask: url('mose-mark.png') center / contain no-repeat;
}
a.brand:hover .header-logo { background: var(--accent); }

/* 헤더의 브랜드는 대시보드로 돌아가는 링크다 */
a.brand {
  color: inherit; text-decoration: none;
  border-radius: 10px; padding: 4px 6px; margin-left: -6px;
}
a.brand:hover .brand-text h1 { color: var(--accent); }
a.brand:hover .brand-mark { filter: brightness(1.1); }
a.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand-text h1 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 17px; font-weight: 700; letter-spacing: 0;
  line-height: 1;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

/* ── 연결 오류 배너 ───────────────────────────────────── */
.banner {
  margin: 0; padding: 9px 24px;
  background: var(--st-late); color: #ffffff;
  font-size: 13px; font-weight: 550;
}

/* ── 탭 ───────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 2px; margin-right: auto;
  overflow-x: auto; scrollbar-width: none;      /* 좁은 화면에서는 옆으로 밀어서 본다 */
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; background: none; border: 0; white-space: nowrap;
  padding: 7px 11px; border-radius: 8px;
  font: inherit; font-weight: 550; color: var(--text-secondary);
  cursor: pointer;
}
.tab:hover { color: var(--text-primary); background: var(--surface-2); }
.tab.is-active { color: var(--accent); background: var(--surface-2); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ── 레이아웃 ─────────────────────────────────────────── */
.app-main { max-width: 1120px; margin: 0 auto; padding: 24px; }
.view { display: none; }
.view.is-active { display: block; }

/* 하위 보기 전환 — 상위 탭과 같은 무게로 보이면 층이 헷갈리므로
   테두리로 묶은 세그먼트 컨트롤로 만들어 한 단계 아래임을 드러낸다. */
.subnav {
  display: inline-flex; gap: 2px; margin-bottom: 16px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.subtab {
  appearance: none; background: none; border: 0; white-space: nowrap;
  padding: 5px 14px; border-radius: 7px;
  font: inherit; font-size: 13px; font-weight: 550; color: var(--text-secondary);
  cursor: pointer;
}
.subtab:hover { color: var(--text-primary); }
.subtab.is-active {
  background: var(--surface-1); color: var(--text-primary);
  box-shadow: var(--shadow);
}
.subtab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.subtab[hidden] { display: none; }
.input[hidden] { display: none; }   /* .input 의 display 지정이 hidden 속성을 이기지 않도록 */

.subview { display: none; }
.subview.is-active { display: block; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card-head { margin-bottom: 14px; }
.card-head h2 { font-size: 14px; }
.card-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-secondary); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── KPI 타일 ─────────────────────────────────────────── */
.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 16px;
}
@media (max-width: 820px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.kpi-label { font-size: 12px; color: var(--text-secondary); }
.kpi-value { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.kpi-note { font-size: 12px; color: var(--muted); }
.kpi-note.is-late { color: var(--st-late); font-weight: 550; }

/* ── 차트 ─────────────────────────────────────────────── */
.chart { display: flex; flex-direction: column; gap: 12px; }

.bar-track {
  display: flex; width: 100%; height: 16px;
  background: var(--surface-2); border-radius: 4px; overflow: hidden;
  gap: 2px; /* 인접 세그먼트 사이 2px 표면 간격 */
}
.bar-seg { height: 100%; border-radius: 2px; }
.bar-seg:first-child { border-radius: 4px 2px 2px 4px; }
.bar-seg:last-child  { border-radius: 2px 4px 4px 2px; }
.bar-seg:only-child  { border-radius: 4px; }
.bar-seg:hover { outline: 2px solid var(--surface-1); outline-offset: -2px; }

.seg-done  { background: var(--st-done); }
.seg-doing { background: var(--st-doing); }
.seg-todo  { background: var(--st-todo); }
.seg-verify { background: var(--st-verify); }

.member-row {
  display: grid; grid-template-columns: 140px 1fr 92px;
  align-items: center; gap: 12px;
}
@media (max-width: 640px) { .member-row { grid-template-columns: 100px 1fr 72px; } }
.member-row .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.member-row .who span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 550;
}
.member-row .tally {
  text-align: right; font-size: 12px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.status-rows { display: flex; flex-direction: column; gap: 8px; }
.status-row {
  display: grid; grid-template-columns: 88px 1fr 64px;
  align-items: center; gap: 12px; font-size: 13px;
}
.status-row .tally { text-align: right; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.status-row .mini-track { height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.status-row .mini-fill { display: block; height: 100%; border-radius: 4px; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12px; color: var(--text-secondary); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11px; font-weight: 650; color: var(--text-secondary);
}
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }

.table-toggle summary { cursor: pointer; font-size: 13px; font-weight: 550; }
.table-toggle table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.table-toggle th, .table-toggle td {
  text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--grid);
  font-variant-numeric: tabular-nums;
}
.table-toggle th { color: var(--text-secondary); font-weight: 550; }
.table-toggle td:not(:first-child), .table-toggle th:not(:first-child) { text-align: right; }

/* ── 마감 임박 목록 ───────────────────────────────────── */
.due-list { display: flex; flex-direction: column; }
.due-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--grid);
}
.due-item:last-child { border-bottom: 0; }
.due-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-when { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.due-when.is-late { color: var(--st-late); font-weight: 600; }

/* ── 배지 ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 550; white-space: nowrap;
  background: var(--surface-2); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-done  { background: var(--st-done); }
.dot-doing { background: var(--st-doing); }
.dot-todo  { background: var(--st-todo); }
.dot-verify { background: var(--st-verify); }


/* ── 폼 컨트롤 ────────────────────────────────────────── */
.input {
  width: 100%; padding: 7px 10px;
  font: inherit; color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--axis); border-radius: 8px;
}
.input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea.input { resize: vertical; }

/* 아이콘 — 스프라이트에서 <use> 로 꺼내 쓰고 색·굵기는 여기서 한 번에 정한다 */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font: inherit; font-weight: 550; white-space: nowrap;
  border-radius: 8px; border: 1px solid var(--axis);
  background: var(--surface-1); color: var(--text-primary);
  cursor: pointer;
}
/* 아이콘은 글자를 거드는 역할이라 조금 흐리게 둔다 (기본 버튼에서만) */
.btn:not(.btn-primary) .icon { color: var(--text-secondary); }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); background: var(--accent); }
.btn-ghost { background: none; }
.btn-icon {
  display: inline-grid; place-items: center;
  border: 0; background: none; cursor: pointer; padding: 5px;
  color: var(--muted); font: inherit; border-radius: 6px;
}
.btn-icon .icon { width: 16px; height: 16px; }
.btn-icon:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-icon:disabled:hover { color: var(--muted); background: none; }
.btn-icon:hover { color: var(--st-late); background: var(--surface-2); }

/* ── 필터 줄 ──────────────────────────────────────────── */
.filter-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px;
}
.filter-row .input { width: auto; min-width: 130px; }
.filter-row #fSearch { flex: 1; min-width: 200px; }
.filter-count { font-size: 12px; color: var(--text-secondary); margin-left: auto; }

/* ── 할 일 표 ─────────────────────────────────────────── */
.table-card { padding: 0; overflow-x: auto; }
.task-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.task-table th {
  text-align: left; font-size: 12px; font-weight: 550; color: var(--text-secondary);
  padding: 11px 14px; border-bottom: 1px solid var(--grid); white-space: nowrap;
}
.task-table td { padding: 11px 14px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.task-table tr:last-child td { border-bottom: 0; }
.task-table tr:hover td { background: var(--surface-2); }
.col-status { width: 118px; }
.col-member { width: 150px; }
.col-due    { width: 120px; }
.col-act    { width: 44px; }
.task-title { font-weight: 550; }
.task-desc  { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.task-result { white-space: pre-line; }
.task-result b { color: var(--text-primary); font-weight: 600; margin-right: 4px; }
.task-table .input { padding: 4px 8px; font-size: 12px; }
.cell-due { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-due.is-late { color: var(--st-late); font-weight: 600; }
.row-done .task-title { text-decoration: line-through; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ── 칸반 보드 ────────────────────────────────────────── */

/* 도구 줄 — 담당자 필터·건수·안내가 한 줄에 앉는다.
   긴 이동 권한 설명은 오른쪽 접이식으로 빼서 평소에는 줄을 넘기지 않는다. */
.board-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.board-bar .input { width: auto; min-width: 150px; }
.board-bar .filter-count { margin-left: 0; }

.board-hint {
  margin: 0 0 0 auto; font-size: 12px; color: var(--text-secondary);
}
.board-hint kbd {
  display: inline-block; padding: 1px 5px; margin: 0 1px;
  border: 1px solid var(--axis); border-bottom-width: 2px; border-radius: 4px;
  background: var(--surface-1); font: inherit; font-size: 11px;
}

/* 접이식 권한 설명 — 열어도 보드를 밀어내지 않도록 카드 위에 띄운다 */
.board-help { position: relative; font-size: 12px; }
.board-help > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-1);
  color: var(--text-secondary); font-weight: 550; white-space: nowrap;
}
.board-help > summary::-webkit-details-marker { display: none; }
.board-help > summary::after { content: '▾'; font-size: 9px; }
.board-help[open] > summary { border-color: var(--accent); color: var(--text-primary); }
.board-help[open] > summary::after { content: '▴'; }
.board-help > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.board-help-body {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  width: min(360px, 80vw); padding: 13px 15px;
  background: var(--surface-1); border: 1px solid var(--axis);
  border-radius: var(--radius); box-shadow: 0 8px 26px rgba(11, 11, 11, 0.16);
  color: var(--text-secondary); line-height: 1.55; text-align: left; font-weight: 400;
}
.board-help-body p { margin: 0 0 8px; }
.board-help-body p:last-child { margin-bottom: 0; }
.board-help-body b { color: var(--text-primary); font-weight: 600; }
.board-help-note {
  margin-top: 10px !important; padding-top: 9px;
  border-top: 1px solid var(--grid); color: var(--muted);
}

/* 3열 — ToDo · In-Progress · (To Verify 위 / Done 아래).
   마지막 열만 세로로 쪼개 검수를 통과한 카드가 바로 아래로 내려가는 모양을 만든다. */
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(248px, 1fr));
  gap: 14px; align-items: start;
  overflow-x: auto; padding-bottom: 8px;
}

.kstack { display: flex; flex-direction: column; min-width: 0; }
/* 두 열 사이의 흐름 표시 — 권한 규칙을 그것이 걸리는 자리에서 한 번 더 알린다 */
.kstack-link {
  display: flex; align-items: center; gap: 8px;
  margin: 0; padding: 9px 2px;
  font-size: 11px; font-weight: 550; color: var(--muted); white-space: nowrap;
}
.kstack-link::before, .kstack-link::after {
  content: ''; flex: 1; height: 1px; background: var(--grid);
}

.kcol {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-height: 132px; min-width: 0;
}
.kcol-head {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; border-bottom: 1px solid var(--grid);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 13px; font-weight: 650; letter-spacing: -0.01em;
}
.kcol-head .kcount {
  margin-left: auto; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-secondary);
  font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums;
}
/* 이 열은 관리자만 다룬다는 표시 — Done 열에 일반 사용자로 들어왔을 때만 뜬다 */
.kcol-lock {
  padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
  font-size: 11px; font-weight: 550;
}

.kcol-body {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; flex: 1; min-height: 76px;
  max-height: min(58vh, 620px); overflow-y: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}
/* 쌓인 두 열은 한 열 자리를 나눠 쓰므로 각자의 스크롤 높이를 낮게 잡는다 */
.kstack .kcol-body { max-height: min(30vh, 320px); }

.kcol-body.is-over {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-1));
  outline: 2px dashed var(--accent); outline-offset: -5px;
}
.kcol-empty {
  margin: 0; padding: 18px 4px; text-align: center;
  font-size: 12px; color: var(--muted);
  border: 1px dashed var(--grid); border-radius: 8px;
}

/* 열마다 머리에 상태 색 — 왼쪽 띠와 아주 옅은 바탕을 함께 쓴다.
   색을 못 섞는 브라우저에서는 띠만 남고 바탕은 기본색 그대로다. */
.kcol[data-status="todo"]   .kcol-head { box-shadow: inset 3px 0 0 var(--st-todo); }
.kcol[data-status="doing"]  .kcol-head { box-shadow: inset 3px 0 0 var(--st-doing); }
.kcol[data-status="verify"] .kcol-head { box-shadow: inset 3px 0 0 var(--st-verify); }
.kcol[data-status="done"]   .kcol-head { box-shadow: inset 3px 0 0 var(--st-done); }
.kcol[data-status="todo"]   .kcol-head { background: color-mix(in srgb, var(--st-todo)   7%, transparent); }
.kcol[data-status="doing"]  .kcol-head { background: color-mix(in srgb, var(--st-doing)  7%, transparent); }
.kcol[data-status="verify"] .kcol-head { background: color-mix(in srgb, var(--st-verify) 8%, transparent); }
.kcol[data-status="done"]   .kcol-head { background: color-mix(in srgb, var(--st-done)   7%, transparent); }

.kcard {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--axis); border-radius: 8px;
  padding: 10px 11px 10px 14px; cursor: grab;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
/* 카드 왼쪽의 얇은 띠 — 카드 경계를 또렷하게 */
.kcard::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--axis);
}

.kcard:hover {
  border-color: var(--accent); transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(11, 11, 11, 0.09);
}
.kcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kcard.is-dragging { opacity: 0.45; cursor: grabbing; transform: none; }
/* 옮길 권한이 없는 카드 — 색을 빼지 않고 손잡이(커서)만 거둔다. 읽기는 그대로 된다 */
.kcard.is-locked { cursor: default; border-style: dashed; }
.kcard.is-locked:hover { border-color: var(--axis); transform: none; box-shadow: none; }

.kcard-title { font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
.kcol[data-status="done"] .kcard-title { text-decoration: line-through; color: var(--muted); }
.kcard-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.kcard-meta .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard-meta .avatar { width: 22px; height: 22px; font-size: 10px; }
.kcard-due { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kcard-due.is-late { color: var(--st-late); font-weight: 600; }
.kcard-result { font-size: 12px; color: var(--text-secondary); white-space: pre-line; overflow-wrap: anywhere; }
.kcard-result b { color: var(--text-primary); font-weight: 600; margin-right: 4px; }
.kcard-result-btn {
  align-self: flex-start; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 3px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface-1); color: var(--accent);
}
.kcard-result-btn:hover { background: var(--surface-2); }
.kcard-result-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dialog-hint { font-size: 12px; color: var(--text-secondary); background: var(--surface-2);
               border-radius: 8px; padding: 8px 10px; margin: 0; }
.input[readonly], .input:disabled { background: var(--surface-2); color: var(--text-secondary); }
.input:disabled { cursor: not-allowed; opacity: 1; }

/* 좁은 화면에서는 옆으로 미는 대신 한 줄에 한 열씩 쌓는다 */
@media (max-width: 860px) {
  .board { grid-template-columns: 1fr; }
  .board-hint { margin-left: 0; }
  .board-help-body { right: auto; left: 0; }
  .kcol-body, .kstack .kcol-body { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  .kcard { transition: none; }
  .kcard:hover { transform: none; }
}

/* ── 담당자 화면 ──────────────────────────────────────── */
.member-form h2 { font-size: 14px; margin-bottom: 12px; }
.member-form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.member-form-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.member-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.member-card { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.member-card .top { display: flex; align-items: center; gap: 10px; }
.member-card .nm { font-weight: 600; }
.member-card .rl { font-size: 12px; color: var(--text-secondary); }
.member-card .stat { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* ── 다이얼로그 ───────────────────────────────────────── */
.dialog {
  width: min(520px, 92vw); padding: 0;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-1); color: var(--text-primary);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.dialog form { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dialog h2 { font-size: 15px; }
.dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) { .form-row-3 { grid-template-columns: 1fr; } }
.req { color: var(--st-late); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ── 툴팁 ─────────────────────────────────────────────── */
.tip {
  position: fixed; z-index: 50; pointer-events: none;
  padding: 6px 9px; border-radius: 7px;
  background: var(--text-primary); color: var(--surface-1);
  font-size: 12px; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ── 로그인 ───────────────────────────────────────────── */

/* 세션을 확인하기 전에는 로그인 화면도 앱도 띄우지 않는다 (깜빡임 방지) */
.login-screen { display: none; }
body.is-anon .login-screen { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
body:not(.is-authed) .app-header,
body:not(.is-authed) .tabs,
body:not(.is-authed) .app-main,
body:not(.is-authed) .banner { display: none; }

.login-card {
  width: min(380px, 100%);
  display: flex; flex-direction: column; gap: 14px;
  padding: 28px;
}
.login-brand {
  flex-direction: column; gap: 14px;
  margin-bottom: 6px; text-align: center;
}
/* MoSE 로고 — 검정 단색 PNG 를 마스크로 쓰고 글자색으로 칠한다.
   라이트/다크 어느 쪽이든 본문 글자색을 따라가 invert 필터가 필요 없다. */
.login-logo {
  display: block; width: 200px; max-width: 100%; aspect-ratio: 480 / 216;
  background: var(--text-primary);
  -webkit-mask: url('mose-logo.png') center / contain no-repeat;
          mask: url('mose-logo.png') center / contain no-repeat;
}
.login-brand h1 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 19px; font-weight: 700; letter-spacing: 0;
}
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-secondary); }
.btn-block { width: 100%; justify-content: center; padding: 9px; font-size: 14px; }

.form-error {
  margin: 0; padding: 9px 11px; border-radius: 8px;
  background: color-mix(in srgb, var(--st-late) 12%, transparent);
  color: var(--st-late); font-size: 12px; font-weight: 550;
}

/* ── 로그인한 사람 ────────────────────────────────────── */

/* 이름을 누르면 비밀번호 변경 — 자물쇠를 흐리게 붙여 누를 수 있음을 알린다 */
.user-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 10px; border: 1px solid transparent; border-radius: 999px;
  background: none; font: inherit; color: inherit; cursor: pointer;
}
.user-chip:hover { background: var(--surface-2); border-color: var(--border); }
.user-chip:hover .chip-lock { color: var(--accent); }
.user-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip-lock { width: 13px; height: 13px; color: var(--muted); }
.chip-user { width: 16px; height: 16px; color: var(--text-secondary); }
.user-name { font-size: 13px; font-weight: 550; }
.role-tag {
  padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-secondary);
  font-size: 11px; font-weight: 550;
}

/* ── 사용자 화면 ──────────────────────────────────────── */

.form-note { margin-top: 12px; max-width: 62ch; line-height: 1.55; }
.col-user   { width: 160px; }
.col-role   { width: 120px; }
.col-useract { width: 200px; }
.user-table { min-width: 660px; }
.user-table td { vertical-align: middle; }
.user-name-cell { font-weight: 550; }
.user-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.user-me { font-size: 11px; color: var(--muted); margin-left: 6px; }
.user-acts { display: flex; gap: 6px; justify-content: flex-end; }
.btn-mini { padding: 3px 9px; font-size: 12px; gap: 5px; }
.btn-mini .icon { width: 13px; height: 13px; }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: min(460px, 92vw);
  padding: 10px 14px; border-radius: 9px;
  background: var(--text-primary); color: var(--surface-1);
  font-size: 13px; line-height: 1.45;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* ── 완료 추이 (선 그래프) ────────────────────────────── */

.chart-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.chart-toolbar .input { width: auto; }

.linechart svg.lc { display: block; width: 100%; height: auto; }
.lc-grid  { stroke: var(--grid); stroke-width: 1; }
.lc-ytick { fill: var(--text-secondary); font-size: 11px; text-anchor: end; }
.lc-xtick { fill: var(--text-secondary); font-size: 11px; text-anchor: middle; }
.lc-line  { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* 두 선이 겹치는 지점에서도 서로 구분되도록 배경색 링을 두른다 */
.lc-end, .lc-dot { stroke: var(--surface-1); stroke-width: 2; }
.lc-endlabel { fill: var(--text-secondary); font-size: 11px; font-weight: 600; }
.lc-cross { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 3 3; }
#lcSurface { cursor: crosshair; }

.sub-toggle { margin-top: 16px; }
.sub-toggle summary { cursor: pointer; font-size: 12px; color: var(--text-secondary); }
.sub-toggle > div { max-height: 260px; overflow: auto; }

/* ── 최근 활동 · 변경 이력 ────────────────────────────── */

.activity { display: flex; flex-direction: column; }
.act-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--grid);
}
.act-item:last-child { border-bottom: 0; }
.act-tag {
  flex: none; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
}
.act-delete { color: var(--st-late); }
.act-body { flex: 1; min-width: 0; }
.act-line { font-size: 13px; }
.act-task { color: var(--text-secondary); }
.act-changes { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.act-change b { color: var(--text-secondary); font-weight: 600; }
.act-from { text-decoration: line-through; }
.act-when { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }

.task-history { border-top: 1px solid var(--grid); padding-top: 10px; }
.task-history summary { cursor: pointer; font-size: 12px; color: var(--text-secondary); }
.activity-compact .act-item { padding: 7px 0; }
#taskHistory { max-height: 210px; overflow: auto; margin-top: 4px; }
