:root {
  --bg: #f5f6f8;
  --card: #fff;
  --line: #dde1e6;
  --text: #1f2328;
  --muted: #667085;
  --primary: #2f5bea;
  --danger: #d92d20;
  --ok: #079455;
  --radius: 8px;
  --control-h: 38px;
  /* 선택칸·프로젝트 고르기 공통 아래 화살표(회색 꺾쇠) */
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23667085' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Pretendard", "Malgun Gothic", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
}

/* 머리말 */
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line);
}
.topbar[hidden] { display: none; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; color: var(--text); text-decoration: none; }
.brand-logo { display: block; height: 28px; width: auto; max-width: 160px; object-fit: contain; flex: none; }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.login-logo { display: block; height: 32px; width: auto; max-width: 200px; object-fit: contain; }
/* 기본정보 → 로고 */
.site-logo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-logo-preview { display: inline-flex; align-items: center; justify-content: center; min-width: 88px; height: 44px; padding: 4px 8px;
  border: 1px dashed var(--line); border-radius: 6px;
  background: repeating-conic-gradient(#f2f4f7 0 25%, #fff 0 50%) 0 0 / 12px 12px; }
.site-logo-preview img { display: block; height: 28px; width: auto; max-width: 200px; object-fit: contain; }
.field .switch-row { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 400; cursor: pointer; }
.site-logo-row .button { display: inline-flex; align-items: center; gap: 4px; }
.switch-row:has(input:disabled) { opacity: .55; cursor: default; }
.menu { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.menu a { padding: 6px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.menu a.active, .menu a:hover { background: var(--bg); color: var(--text); }
.who { display: flex; align-items: center; gap: 8px; color: var(--muted); }
/* 머리말 프로젝트 고르기(로고 옆) · 통합검색(오른쪽) */
.top-project { position: relative; display: inline-flex; align-items: center; color: var(--muted); }
.top-project .icon { position: absolute; left: 9px; pointer-events: none; }
.top-project select { height: 34px; max-width: 220px; padding-left: 32px; font-weight: 600; color: var(--text); }
.top-search { display: flex; align-items: center; position: relative; }
.top-search input { height: 34px; width: 200px; padding-right: 36px; }
.top-search .icon-btn { position: absolute; right: 1px; width: 32px; height: 32px; }
.who-link { display: inline-flex; align-items: center; gap: 6px; height: auto; padding: 2px 6px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; text-decoration: none; cursor: pointer; }
.who-link[aria-expanded=true] { background: var(--bg); }
.who-link:hover { background: var(--bg); }

/* 아이콘(Lucide 스프라이트) */
.icon { display: inline-block; flex: none; vertical-align: middle; }
.icon-btn {
  position: relative; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: none;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
}
.icon-btn:hover, .icon-btn[aria-expanded=true] { background: var(--bg); color: var(--text); }

/* 사용자 정보 카드(누른 자리에 뜬다) */
.user-card {
  position: absolute; z-index: 90; width: 300px; max-width: calc(100vw - 16px); background: #fff;
  max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .16); padding: 14px;
}
.user-card-head { display: flex; align-items: center; gap: 12px; }
.user-card-name { flex: 1; min-width: 0; display: grid; gap: 2px; }
.user-card-name strong { font-size: 15px; overflow-wrap: anywhere; }
.user-card-name .muted { font-size: 13px; }
.user-card-head .icon-btn { width: 28px; height: 28px; align-self: flex-start; }
.user-card-info { margin: 12px 0 0; display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.user-card-row { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 13px; }
.user-card-row dt { color: var(--muted); }
.user-card-row dd { margin: 0; overflow-wrap: anywhere; }
.user-card-row a { color: var(--primary); text-decoration: none; }
.user-card-row a:hover { text-decoration: underline; }
.user-card-projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.user-card-loading { margin: 4px 0; }
/* 화면을 바꾸는 동안: 머리말 아래 얇은 진행 막대 + 카드 모양 뼈대. 빨리 끝나면 깜박이지 않게 0.15초 뒤에 보인다 */
.route-loading { visibility: hidden; }   /* route() 가 0.15초 뒤 .show 를 붙인다(애니메이션이 멈춘 환경에서도 보이도록 스크립트로) */
.route-loading.show { visibility: visible; }
.route-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; overflow: hidden; background: rgba(47, 91, 234, .12);
}
.route-progress::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: route-bar 1.1s ease-in-out infinite;
}
@keyframes route-bar { to { left: 100%; } }
.skeleton { display: grid; gap: 12px; }
.sk {
  display: block; height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, #eceef2 0%, #f6f7f9 40%, #eceef2 80%) 0 0 / 300% 100%;
  animation: sk-shine 1.4s ease-in-out infinite;
}
.sk-title { height: 22px; width: 36%; margin-bottom: 6px; }
.sk-line { width: 72%; }
.sk-line.short { width: 48%; }
.sk-rows { display: grid; gap: 10px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.sk-row { height: 34px; }
.sk-row:nth-child(2n) { opacity: .7; }
@keyframes sk-shine { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) {
  .route-progress::after, .sk { animation: none; }
}
/* 목록의 사용자(누르면 카드) */
button.user-link {
  height: auto; padding: 2px 4px; margin: -2px -4px; border: 0; background: none; text-align: left;
  white-space: normal; border-radius: 6px; font: inherit; color: inherit;
}
button.user-link:hover { background: var(--bg); }
button.user-link:hover strong { color: var(--primary); text-decoration: underline; }

/* 알림(머리말 종) */
.notif { position: relative; }
.notif-count {
  position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.notif-count[hidden] { display: none; }
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 360px; max-height: 70vh; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}
.notif-panel[hidden] { display: none; }
.notif-head {
  position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line);
}
.notif-head button.link { display: inline-flex; align-items: center; gap: 4px; }
.notif-list { list-style: none; margin: 0; padding: 4px; display: grid; gap: 2px; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: #f3f6fe; }
.notif-item.unread:hover { background: #e9eefc; }
.notif-text { min-width: 0; display: grid; gap: 2px; font-size: 13px; }
.notif-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-excerpt { color: var(--muted); overflow-wrap: anywhere; }
.notif-text time { font-size: 12px; }
.notif-empty { margin: 0; padding: 24px; text-align: center; color: var(--muted); }

/* 프로필 사진 */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; vertical-align: middle; }
.avatar-initial { display: inline-flex; align-items: center; justify-content: center; background: #e4e9f7; color: var(--primary); font-weight: 700; }
.author { display: inline-flex; align-items: center; gap: 6px; }
.profile-card { max-width: 640px; margin-left: auto; margin-right: auto; }
.profile { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.profile-actions .actions { margin-top: 0; }
label.button {
  display: inline-flex; align-items: center; height: var(--control-h); padding: 0 14px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 400;
}
label.button:focus-within { outline: 2px solid var(--primary); }

/* 목록 섬네일 */
.title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
button.thumb {
  position: relative; flex: none; width: 56px; height: 42px; padding: 0; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg); cursor: zoom-in;
}
button.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
button.thumb.large { width: 160px; height: 120px; }
.thumb-count {
  position: absolute; right: 2px; bottom: 2px; padding: 0 4px; border-radius: 4px;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; line-height: 16px;
}

/* 원본 이미지 모달 */
body.no-scroll { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 100; background: rgba(15, 18, 24, .88); display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: #fff; }
.viewer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-count { color: #c9ced6; }
.viewer-open { color: #c9ced6; }
.viewer-close { background: none; border: 0; color: #fff; font-size: 28px; height: 40px; width: 40px; padding: 0; }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 8px 16px; }
.viewer-media { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.viewer-video { max-width: 100%; max-height: 100%; background: #000; }
.viewer-fail { color: #fff; text-align: center; line-height: 1.7; }
.viewer-fail a { color: #9fb6ff; }
.viewer-nav { flex: none; width: 48px; height: 64px; font-size: 32px; background: rgba(255, 255, 255, .12); border: 0; color: #fff; }
.viewer-nav[hidden] { display: none; }

/* 본문 */
.page { margin: 24px auto; padding: 0 24px; }   /* 화면 폭 끝까지(로그인·내 정보 카드는 각자 폭) */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
/* 글 상세 아래 답글 카드는 #thread 안에 그려져 위 규칙이 닿지 않는다 */
#thread > .card { margin-top: 16px; }
/* 글 상세: 담당자 줄(이름 + 접수·접수취소) */
.attach-settings { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 6px; }
.attach-settings legend { padding: 0 4px; font-weight: 600; }
.attach-sizes { display: flex; gap: 16px; flex-wrap: wrap; }
.attach-sizes label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.attach-sizes input { width: 90px; }
.assignee-field dd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.narrow { max-width: 420px; margin: 48px auto; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }

/* 폼 */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label:not(:where(.sun-editor *, .sun-editor-editable *)) { font-weight: 600; }
.req { color: var(--danger); margin-left: 2px; }
/* 앱 폼·표 기본 모양은 에디터(SunEditor) 안과 에디터 본문 보기에는 주지 않는다 — :where 라 우선순위는 그대로 */
:is(input, select, textarea):not(:where(.sun-editor *, .sun-editor-editable *)) {
  font: inherit; color: inherit;
  height: var(--control-h); padding: 0 10px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  width: 100%;
}
textarea:not(:where(.sun-editor *, .sun-editor-editable *)) { height: auto; min-height: 90px; padding: 8px 10px; }
/* 선택칸: 브라우저 화살표 대신 같은 꺾쇠를 왼쪽 여백(10px)과 같은 간격으로 오른쪽에 둔다 */
select:not(:where(.sun-editor *, .sun-editor-editable *)) {
  appearance: none; -webkit-appearance: none;
  padding-right: 32px;
  background: #fff var(--chevron) no-repeat right 10px center / 12px 12px;
}
:is(input, select, textarea):focus:not(:where(.sun-editor *, .sun-editor-editable *)) { outline: 2px solid var(--primary); outline-offset: -1px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }

button:not(:where(.sun-editor *, .sun-editor-editable *)) {
  font: inherit; height: var(--control-h); padding: 0 14px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--text); white-space: nowrap;
}
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.danger { color: var(--danger); }
button.small { height: 30px; padding: 0 10px; font-size: 13px; }
button.link { border: 0; background: none; padding: 0; height: auto; color: var(--muted); text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
.wide { width: 100%; }

.error { color: var(--danger); min-height: 1.2em; margin: 4px 0 0; }

/* 탭 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { flex: none; }
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); }
.tabs button.active { border-bottom-color: var(--primary); color: var(--text); font-weight: 600; }

/* 표 */
.table-wrap { overflow-x: auto; }
table:not(:where(.sun-editor *, .sun-editor-editable *)) { width: 100%; border-collapse: collapse; }
:is(th, td):not(:where(.sun-editor *, .sun-editor-editable *)) { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:not(:where(.sun-editor *, .sun-editor-editable *)) { color: var(--muted); font-weight: 600; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
td.break { overflow-wrap: anywhere; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--bg); }
.badge.on { background: #e7f6ee; color: var(--ok); }

/* 링크를 버튼처럼 */
a.button {
  display: inline-flex; align-items: center; height: var(--control-h); padding: 0 14px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--text); text-decoration: none; white-space: nowrap;
}
a.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
a.button { gap: 4px; }
.with-icon { display: inline-flex; align-items: center; gap: 4px; }
a.button.small { height: 30px; padding: 0 10px; font-size: 13px; }
button.icon { width: 30px; padding: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.help { color: var(--muted); font-size: 13px; }
.label { font-weight: 600; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1, .page-head h2 { margin: 0; }
.page-head .actions { margin-top: 0; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* 표 칸은 표 칸으로 둔다 — inline-flex 가 되면 밑줄·높이가 다른 칸과 어긋난다 */
td.row-actions { display: table-cell; text-align: right; }
td.row-actions > * + * { margin-left: 6px; }
/* 표 아래 추가 폼: 표와 붙지 않게 띄우고 옅은 상자로 구분 */
.table-wrap + form.inline { margin-top: 16px; padding: 12px; background: var(--bg); border-radius: var(--radius); flex-wrap: wrap; }
.table-wrap + form.inline input { min-width: 160px; }
/* 기본 그룹 이름 + 배지 */
.group-name { display: inline-flex; align-items: center; gap: 8px; min-height: var(--control-h); }
/* 표 안 개수 링크(멤버 n명 등): 파란 밑줄 대신 옅은 알약 */
a.count-link {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  background: var(--bg); color: var(--text); text-decoration: none; font-size: 13px; font-variant-numeric: tabular-nums;
}
a.count-link span { color: var(--muted); }
a.count-link:hover { background: #eef2fe; color: var(--primary); }
a.count-link:hover span { color: var(--primary); }
.narrow-form { max-width: 560px; }

/* 상태 표시 */
.badge.status { background: #eef2fe; color: var(--primary); white-space: nowrap; }
.badge.status.closed { background: var(--bg); color: var(--muted); }

/* 게시판 목록 */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.filters select { width: auto; min-width: 140px; }
.filters input { flex: 1; min-width: 160px; width: auto; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #fafbfc; }
.title-cell a { color: var(--text); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.title-cell a:hover { text-decoration: underline; }
.col-no { width: 64px; color: var(--muted); }
.board-table th { text-align: center; }
/* 칸 정렬: 목록 설정에서 열마다 정한다 */
.board-table td.al-left { text-align: left; }
.board-table td.al-center { text-align: center; }
.board-table td.al-right { text-align: right; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; }

/* 글 보기 */
.post-fields { margin: 16px 0; display: grid; gap: 0; }
.post-field { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.post-field dt { color: var(--muted); font-weight: 600; }
.post-field dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { max-width: 240px; max-height: 180px; border: 1px solid var(--line); border-radius: 6px; }
/* 첨부: 끌어 놓는 칸 + 가로 슬라이드(넘치면 ‹ › 단추) */
.file-drop {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; padding: 12px;
  border: 1.5px dashed var(--line); border-radius: var(--radius); background: #fafbfc; color: var(--muted);
  cursor: pointer; text-align: center; font-weight: 400;
}
.file-drop:hover, .file-drop:focus-within { border-color: var(--primary); color: var(--primary); }
.file-drop.dragover { border-color: var(--primary); background: #eef2fe; color: var(--primary); }
.file-drop u { text-underline-offset: 2px; }
.file-strip { position: relative; margin-top: 8px; }
.file-strip:has(.strip-track:empty) { display: none; }
.file-list.strip-track {
  list-style: none; margin: 0; padding: 2px; display: flex; gap: 8px; overflow-x: auto;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.file-card {
  position: relative; flex: 0 0 152px; scroll-snap-align: start; display: grid; gap: 6px;
  padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.file-card.pending { opacity: .6; }
.file-thumb {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: 104px; padding: 0; border: 0; border-radius: 6px; background: var(--bg); color: var(--muted);
  overflow: hidden; text-decoration: none; cursor: pointer;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-ext { font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.file-thumb { position: relative; }
.file-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; background: #111; pointer-events: none; }
.play-badge {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; padding-left: 3px;
  background: rgba(17, 17, 17, .65); color: #fff; font-size: 16px; line-height: 1;
}
.file-fallback { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); }
.file-meta { display: grid; gap: 1px; min-width: 0; font-size: 12px; }
.file-meta a, .file-meta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.file-remove {
  position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; background: rgba(31, 35, 40, .7); color: #fff;
}
.file-remove:hover { background: var(--danger); }
.strip-nav {
  position: absolute; top: 44px; z-index: 2; width: 32px; height: 32px; padding: 0; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18); border: 1px solid var(--line); color: var(--text);
}
.strip-nav[hidden] { display: none; }
.strip-nav:disabled { opacity: 0; pointer-events: none; }
.strip-nav.prev { left: -8px; }
.strip-nav.next { right: -8px; }
.file-count { margin: 0; font-size: 12px; }

/* 라디오·체크박스 묶음 */
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.field legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 16px; }
/* .field label 의 굵은 글씨를 선택지에는 쓰지 않는다 */
.choice-item, .check, .field .choice-item, .field .check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; cursor: pointer; }
.choice-item input, .check input { width: 16px; height: 16px; margin: 0; }

/* 사용자 검색 */
.user-search { position: relative; }
.search-results { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 6px; max-height: 240px; overflow-y: auto; }
.search-results:empty { display: none; }
.search-results li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search-results li:last-child { border-bottom: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: #eef2fe; }
.chip button { text-decoration: none; font-size: 16px; }

/* 끌어서 순서 바꾸는 목록 */
/* minmax(0, 1fr): 항목이 내용 최소폭만큼 늘어나 목록(편집 칸) 밖으로 나가지 않게 */
.sort-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.sort-item { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; flex-wrap: wrap; }
.sort-item input:not([type=checkbox]) { flex: 1; min-width: 140px; width: auto; }
.sort-item.dragging { opacity: .5; }
/* 끌기 손잡이: 글자(⋮⋮)는 두 개로 보여서 점 2×3 하나로 그린다 */
.handle {
  flex: none; width: 10px; height: 16px; margin: 0 2px; cursor: grab; user-select: none; opacity: .55;
  background: radial-gradient(circle, var(--muted) 1.4px, transparent 1.6px) 0 0 / 5px 5.33px;
}
.move { display: inline-flex; gap: 4px; }

/* 진행상태 › 중분류 */
.sort-item.status-item { display: block; }
.status-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-row input:not([type=checkbox]) { flex: 1; min-width: 140px; width: auto; }
/* 이름 칸 옆의 체크·버튼 묶음: 칸이 좁으면 묶음째 다음 줄로(오른쪽 끝에 버튼) */
.status-opts { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; flex: 0 1 auto; margin-left: auto; }
.status-opts .row-actions { flex-wrap: nowrap; }
.status-row > input[data-name], .sub-item > input[data-sub-name] { flex: 3 1 160px; }
.sub-box { margin: 8px 0 0 28px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.sort-item .sub-add input { min-width: 0; }
.sub-list { margin: 0; gap: 4px; }
.sub-item { padding: 4px 8px; background: #fafbfc; }
.sub-item.is-hidden input[data-sub-name] { color: var(--muted); text-decoration: line-through; }
.sub-mark { color: var(--muted); }
.sub-add input { height: 32px; }
.field[hidden] { display: none; }

/* 항목 편집기: 왼쪽 목록, 오른쪽 편집 */
.editor-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.field-item { flex-wrap: nowrap; }
.field-item.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.field-item.is-hidden .field-pick strong { color: var(--muted); text-decoration: line-through; }
.field-pick {
  flex: 1; min-width: 0; height: auto; border: 0; background: none; padding: 2px 0; text-align: left;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
}
.field-pick strong { overflow-wrap: anywhere; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; }
.editor-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.empty-panel { color: var(--muted); display: grid; gap: 12px; justify-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.checks { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.option-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.option-list li { display: flex; gap: 6px; align-items: center; }
.option-list input { flex: 1; width: auto; min-width: 0; }
.preview-box { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px; margin: 8px 0 12px; background: #fafbfc; }
.preview-box > .label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.preview-box.full { margin-top: 16px; background: #fff; }

/* 상세 설정: 기본 항목 / 입력 항목 */
.list-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.list-title .muted { font-weight: 400; font-size: 12px; }
.editor-list .list-title:not(:first-child) { margin-top: 16px; }
.builtin-list { gap: 4px; }
.builtin-item { flex-wrap: nowrap; padding: 6px 8px; background: #fafbfc; }
.builtin-item.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: #fff; }
.builtin-item .field-pick { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.builtin-item .field-pick strong { overflow-wrap: anywhere; }
.builtin-item:hover { border-color: #c4ccd8; }
.pick-arrow { color: var(--muted); font-size: 18px; padding: 0 4px; }
.status-editor { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.status-editor h3 { font-size: 15px; margin: 0 0 8px; }

/* 목록 설정: 왼쪽 열 목록(보이기·정렬·순서), 오른쪽 행 수·미리보기 */
.list-settings { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.col-item { flex-wrap: nowrap; }
/* 열 이름은 140px 아래로 줄이지 않는다 — 칸이 좁으면 정렬·순서 버튼이 다음 줄로 간다 */
.col-item .col-check { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.col-item .badges { flex: none; }
.align-seg { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.align-seg button { height: 28px; width: 32px; padding: 0; border: 0; border-radius: 0; font-size: 12px; color: var(--muted); }
.align-seg button + button { border-left: 1px solid var(--line); }
.align-seg button.active { background: #eef2fe; color: var(--primary); font-weight: 600; }
table.preview-head td { font-size: 12px; white-space: nowrap; color: var(--muted); }

/* ---------- 게시판 탭 ---------- */
.board-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 12px; }
.board-tabs a {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  text-decoration: none; font-size: 13px; white-space: nowrap;
}
.board-tabs a:hover { color: var(--text); }
.board-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.board-tabs a.off { border-style: dashed; }
.board-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.board-pick .board-tabs { margin: 0; }

/* ---------- 화면 머리·프로젝트 여러 개 고르기 ---------- */
.head-title { min-width: 0; }
.eyebrow { margin: 0 0 2px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.multi-pick { position: relative; }
/* 선택칸(select)과 같은 모양: 높이·여백·모서리·꺾쇠 */
.multi-pick > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; height: var(--control-h);
  padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; white-space: nowrap;
  max-width: 240px;
}
.multi-pick > summary::-webkit-details-marker { display: none; }
.multi-pick > summary::after {
  content: ''; flex: none; width: 12px; height: 12px; margin-left: auto; background: var(--chevron) no-repeat center / 12px 12px;
}
.multi-pick > summary [data-pick-label] { overflow: hidden; text-overflow: ellipsis; }
.multi-pick[open] > summary { border-color: var(--primary); }
.multi-pick-panel {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 220px; max-width: min(320px, 90vw);
  max-height: 320px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12); padding: 8px; display: flex; flex-direction: column; gap: 2px;
}
.multi-pick-panel .check { display: flex; justify-content: flex-start; padding: 6px 8px; border-radius: 6px; }
.multi-pick-panel input[type=checkbox] { flex: none; min-width: 0; width: auto; margin: 0; }
.multi-pick-panel .check:hover { background: var(--bg, #f4f5f7); }
.multi-pick-panel .pick-all { border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 4px; }
/* 진행상태 고르기: 중분류는 상태 아래에 들여 쓴다 */
.multi-pick-panel .check.pick-sub { padding-left: 30px; color: var(--muted); }
.multi-pick-actions { display: flex; justify-content: flex-end; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }

/* ---------- 게시판 권한 ---------- */
.perm-row { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0 0 12px; }
.perm-row legend { font-weight: 600; padding: 0 4px; }
.perm-row .help { margin: 0 0 8px; }
.perm-scopes, .perm-groups { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.perm-groups[hidden] { display: none; }
.perm-groups { margin-top: 8px; padding: 8px 10px; background: var(--bg, #f4f5f7); border-radius: 6px; }

/* ---------- 목록 정렬·열 ---------- */
.sort-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; font-size: 13px; }
.sort-chip { padding: 2px 8px; gap: 2px; }
.sort-chip button.link { color: var(--primary); text-decoration: none; font-size: 13px; }
.sort-chip.muted { background: var(--bg); }
/* 낮은 선택칸도 여백·꺾쇠는 다른 선택칸과 같다(왼쪽 10px, 꺾쇠 오른쪽 10px) */
select.sort-add { width: auto; height: 30px; font-size: 13px; padding: 0 32px 0 10px; }
button.sort-head {
  border: 0; background: none; padding: 0; height: auto; font: inherit; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
button.sort-head:hover, button.sort-head.on { color: var(--text); }
.sort-icon { font-size: 11px; color: var(--muted); }
button.sort-head.on .sort-icon { color: var(--primary); }
.sort-icon sub { font-size: 9px; }
th.col-thumb, td.col-thumb { width: 64px; }
.comment-count { font-size: 12px; margin-left: 4px; }
.col-check { flex: 1; font-weight: 600; }
.sort-item.is-hidden .col-check { color: var(--muted); font-weight: 400; }
table.preview-head th { white-space: nowrap; font-size: 12px; }

/* ---------- 답글·활동 ---------- */
.thread h2 { display: flex; gap: 6px; align-items: baseline; }
.timeline { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.timeline .activity { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 4px 0; }
.timeline .activity strong { color: var(--text); font-weight: 600; }
/* 진행 이력의 처리결과: 한 줄 아래 들여 쓴 칸(답글 상자처럼 무겁지 않게 왼쪽 선만) */
.timeline .activity .status-result-view { flex-basis: 100%; margin: 4px 0 2px 28px; padding: 6px 0 6px 12px;
  border-left: 2px solid var(--line); color: var(--text); font-size: 14px; }
.status-result-view .status-result-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.status-result-view .comment-files { margin-top: 6px; }
/* 진행상태 변경 창: 처리결과 칸 */
.status-dialog .status-result { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; }
.status-dialog .status-result[hidden] { display: none; }
.status-dialog textarea { width: 100%; }
/* 글쓰기·수정: 진행상태는 배지 + '진행상태 변경' 단추 */
.status-pick-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 36px; }
.status-pick [data-status-note]:empty { display: none; }
/* 상태관리: 상태마다 처리결과 사용·필수 */
.result-table-wrap { margin: 4px 0 8px; }
.result-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.result-table th, .result-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.result-table thead th { font-size: 12px; font-weight: 500; color: var(--muted); }
.result-table tbody th { text-align: left; font-weight: 400; }
.result-table input[type=checkbox] { width: 16px; height: 16px; min-width: 0; margin: 0; vertical-align: middle; }
/* 답글은 상자 없이 평평하게: 답글 사이 얇은 선, 답글의 답글은 들여쓰고 왼쪽 세로선만 */
.timeline .comment { display: flex; min-width: 0; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.timeline .comment.flash { background: #f5f8ff; box-shadow: 0 0 0 6px #f5f8ff; border-radius: 4px; }
.replies { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 0; }
.timeline .replies .comment { padding: 8px 0; border-top: 0; }
.reply-slot:not(:empty) { margin-top: 10px; }
.reply-form textarea { min-height: 60px; }
/* 답글·수정·삭제: 본문 아래 작은 회색 글자 */
.comment-actions { display: flex; gap: 14px; margin-top: 6px; }
.comment-actions button.link { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.comment-actions button.link:hover { color: var(--text); }
.comment-actions button.link[data-delete-comment]:hover { color: var(--danger); }
/* 멘션한 이름: 누르면 사용자 정보 카드 */
button.mention {
  display: inline; height: auto; padding: 0 2px; border: 0; border-radius: 4px; background: #eef2fe;
  color: var(--primary); font: inherit; font-weight: 600; white-space: normal; cursor: pointer;
}
button.mention:hover { background: #dfe7fd; text-decoration: underline; }
.thread h2 .icon { color: var(--muted); align-self: center; }

/* '@' 멘션 고르기 */
.mention-wrap { position: relative; }
/* 입력칸 아래 글자 기준선 여백이 생기지 않게 */
.mention-wrap > textarea { display: block; }
/* 위치(left·top)는 '@'를 친 글자 바로 아래로 thread.js 가 정한다 */
.mention-pop {
  position: absolute; left: 0; top: 100%; margin: 0; z-index: 30; min-width: 220px; max-width: min(320px, 100%);
  max-height: 240px; overflow: auto; list-style: none; padding: 4px; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}
.mention-pop[hidden] { display: none; }
.mention-pop li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.mention-pop li.active, .mention-pop li:hover { background: #eef2fe; }
.mention-pop .muted { font-size: 12px; margin-left: auto; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 2px; }
.comment-head time { font-size: 12px; }
.comment-body { overflow-wrap: anywhere; }
.comment-form textarea, .comment-edit textarea { min-height: 72px; }
button.link.small { font-size: 13px; }

/* ---------- 진행보드 ---------- */
.kanban-card { max-width: none; }
/* 열은 줄바꿈 그리드로 전부 보인다 — 가로 스크롤·열 안 세로 스크롤을 쓰지 않는다 */
.kanban { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.kcol { min-width: 0; background: var(--bg); border-radius: var(--radius); display: flex; flex-direction: column; }
.kcol.closed .kcol-head { color: var(--muted); }
.kcol.drop-target { outline: 2px dashed var(--primary); outline-offset: -2px; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-weight: 600; }
.kcount { background: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.kcol-body { padding: 0 8px 8px; display: grid; gap: 8px; }
.kempty { color: var(--muted); font-size: 13px; text-align: center; margin: 8px 0; }
/* position: relative — 카드 안 sr-only(절대 위치) 라벨이 카드 밖으로 나가 문서 전체를 넓히지 않게 */
.kcard { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: grid; gap: 6px; }
.kcard.movable { cursor: grab; }
.kcard.dragging { opacity: .5; }
.kcard-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; }
.kcard-title { color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.kcard-title:hover { text-decoration: underline; }
button.thumb.kthumb { width: 100%; height: 96px; }
.kcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; }
.kmove { width: auto; height: 28px; font-size: 12px; padding: 0 28px 0 8px; max-width: 120px; background-position: right 8px center; }

/* ---------- 요약 ---------- */
.summary h2 { font-size: 15px; }
.period-nav { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 2px; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.kpi-sub { color: var(--muted); font-size: 12px; }
.chart-box { position: relative; margin-bottom: 20px; }
.chart-wrap { width: 100%; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.sw.created, .trend .bar.created { background: #2a78d6; fill: #2a78d6; }
.sw.closed, .trend .bar.closed { background: #eb6834; fill: #eb6834; }
.trend .grid { stroke: var(--line); stroke-width: 1; }
.trend .axis { fill: var(--muted); font-size: 11px; }
.trend .hit { fill: transparent; }
.trend .bucket.on .hit { fill: rgba(31, 35, 40, .05); }
.chart-tip {
  position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; font-size: 12px; line-height: 1.6; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); white-space: nowrap;
}
.chart-tip[hidden] { display: none; }
.table-view { margin-top: 8px; }
.table-view summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.summary-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; }
.hbars { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.hbars li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.hbar-label { overflow-wrap: anywhere; font-size: 13px; }
.hbar-track { height: 14px; }
.hbar { display: block; height: 100%; min-width: 2px; background: #2a78d6; border-radius: 0 4px 4px 0; }
.hbar-value { text-align: right; font-variant-numeric: tabular-nums; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 시스템 관리 공통 */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.seg button { border: 0; border-radius: 0; height: 32px; background: #fff; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: #eef2fe; color: var(--primary); font-weight: 600; }
.editor-card { border: 1px solid var(--primary); border-radius: var(--radius); padding: 16px; margin: 12px 0; background: #fbfcff; }
.editor-card .page-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice { border: 1px solid #f5c26b; background: #fff8e6; border-radius: 6px; padding: 10px 12px; margin: 8px 0; }
code.temp { font-size: 16px; font-weight: 700; letter-spacing: 1px; background: #fff; padding: 2px 6px; border-radius: 4px; user-select: all; }
.code { font-family: Consolas, monospace; font-size: 12px; margin-top: 2px; }
tr.group-row th { background: var(--bg); text-align: left; font-size: 13px; }
tr.is-off input[data-name], tr.is-off .row-head { color: var(--muted); }
.pg-list { display: grid; gap: 0; }
/* 사용자그룹 상세: 권한그룹 체크 */
.pg-checks { display: grid; gap: 6px; margin: 4px 0 10px; }
.pg-check { align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.pg-check input { margin-top: 2px; }
.pg-check:has(input:checked) { border-color: var(--primary); background: #f5f8ff; }
.feature-section + .feature-section { margin-top: 8px; }
.feature-section .label { margin: 0 0 4px; }
.feature-checks { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.permission-feature-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.permission-feature-tools input[type=search] { flex: 1; min-width: 180px; }
.permission-feature-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0 8px; }
.permission-feature-toolbar .row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.permission-feature-group { border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.permission-feature-group > summary { display: flex; align-items: center; gap: 10px; padding: 12px; cursor: pointer; list-style: none; }
.permission-feature-group > summary::-webkit-details-marker { display: none; }
.permission-feature-group > summary::before { content: ''; width: 12px; height: 12px; flex: none; background: var(--chevron) center / 12px no-repeat; transform: rotate(-90deg); }
.permission-feature-group[open] > summary::before { transform: rotate(0); }
.permission-feature-group > summary strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.permission-feature-group > summary .badge { flex: none; }
.permission-feature-group > summary:hover { background: var(--bg); }
.permission-feature-group > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 6px; }
.permission-feature-group .feature-checks { padding: 0 12px 12px; margin: 0; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.permission-feature-group .pg-check span { min-width: 0; overflow-wrap: anywhere; }
.permission-feature-group .pg-check input { flex: none; }
.permission-feature-picker [hidden] { display: none; }
/* 기능·권한 목록은 요약을 먼저 보여 주고 편집 폼은 필요할 때 펼친다. */
#features-body [hidden], #perm-body [hidden] { display: none; }
.feature-detail h1, .feature-detail .code, .user-table td { overflow-wrap: anywhere; }
.authz-disclosure { min-width: 0; border: 1px solid var(--line); border-radius: 6px; }
.authz-disclosure + .authz-disclosure { margin-top: 6px; }
.authz-disclosure > summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; list-style: none; cursor: pointer; }
.authz-disclosure > summary::-webkit-details-marker { display: none; }
.authz-disclosure > summary::before { content: ''; width: 12px; height: 12px; flex: none; background: var(--chevron) center / 12px no-repeat; transform: rotate(-90deg); }
.authz-disclosure[open] > summary::before { transform: rotate(0); }
.authz-disclosure > summary:hover { background: var(--bg); }
.authz-disclosure > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 6px; }
.authz-summary-title { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.authz-summary-description { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.authz-disclosure > summary > .badge, .authz-disclosure > summary > .muted { flex: none; }
.authz-disclosure-body { border-top: 1px solid var(--line); padding: 12px; }
.authz-disclosure-body .code { margin-top: 0; overflow-wrap: anywhere; }
.authz-add { margin-top: 16px; }
.authz-add .inline { flex-wrap: wrap; }
.authz-add .inline input { flex-basis: 180px; }
.feature-preview { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.feature-preview .label { color: var(--text); margin-right: 6px; }
h1.group-name { display: flex; align-items: center; gap: 8px; }
.feature-list { text-align: left; color: var(--muted); font-size: 13px; min-width: 200px; }

/* 매핑 표: 행·열 교차 체크 */
table.matrix { width: auto; min-width: 100%; }
table.matrix th, table.matrix td { text-align: center; white-space: nowrap; }
table.matrix .row-head { text-align: left; }
table.matrix td.feature-list, table.matrix td.muted { white-space: normal; text-align: left; }
table.matrix input[type=checkbox] { width: 18px; height: 18px; }
table.matrix tbody tr:hover { background: #fafbfc; }

/* 시스템 관리: 머리말 아래 화면 폭 중메뉴 띠(밑줄 강조) + 본문 */
.admin-layout { display: block; }
.subnav {
  /* .page 의 위 여백·좌우 여백만큼 밖으로 꺼내 머리말에 붙인다 */
  margin: -24px -24px 20px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none; position: relative; /* 지금 메뉴 위치 계산(offsetLeft) 기준 */
}
.subnav::-webkit-scrollbar { display: none; }
.subnav-inner { display: flex; gap: 4px; min-width: max-content; }
.subnav a {
  display: inline-flex; align-items: center; gap: 7px; height: 48px; padding: 0 12px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; color: var(--muted); font-size: 15px; text-decoration: none; white-space: nowrap;
}
.subnav a .icon { color: currentColor; opacity: .8; }
.subnav a:hover { color: var(--text); border-bottom-color: var(--line); }
.subnav a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.subnav a.active .icon { opacity: 1; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #1f2328; color: #fff; padding: 10px 16px; border-radius: 6px;
}
.toast[hidden] { display: none; }

@media (max-width: 640px) {
  .page { margin: 12px auto; padding: 0 16px; }
  .narrow { margin: 16px auto; }
  .card { padding: 16px; }
  /* 머리말: 1줄 로고·사용자, 2줄 메뉴(가로) */
  .topbar {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand who" "project search" "menu menu";
    padding: 10px 12px; gap: 8px;
  }
  .brand { grid-area: brand; }
  .who { grid-area: who; }
  .top-project-box { grid-area: project; min-width: 0; }
  .top-project, .top-project select { width: 100%; max-width: none; }
  .top-search-box { grid-area: search; min-width: 0; }
  .top-search input { width: 150px; }
  .menu { grid-area: menu; flex-wrap: nowrap; overflow-x: auto; }
  .menu a { white-space: nowrap; }
  /* 알림 목록은 화면 너비에 맞춰 머리말 아래에 */
  .notif-panel { position: fixed; left: 8px; right: 8px; top: 52px; width: auto; max-height: calc(100vh - 64px); }

  /* 표 → 목록(Tabler 목록 참고): 제목 한 줄 + '작은 이름표 값'을 한 줄로 흘리고, 설명은 흐린 한 줄, 버튼은 오른쪽 아래.
     상자·카드 없이 행 사이 선 하나로만 나눈다. 누르면 이동하는 행(tr.clickable)에는 › */
  table.stack thead { display: none; }
  table.stack, table.stack tbody { display: block; width: 100%; }
  table.stack tr {
    position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
    width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line);
  }
  table.stack td, table.stack td.al-center, table.stack td.al-right {
    display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; padding: 0; border: 0;
    text-align: left; justify-content: flex-start; font-size: 13px; color: var(--muted);
  }
  table.stack td > * { min-width: 0; }
  table.stack td[data-label]::before { content: attr(data-label); flex: none; color: #98a2b3; font-size: 12px; }
  table.stack td[data-label]:empty { display: none; }
  /* 제목: 게시판은 제목 칸, 나머지 표는 첫 칸 */
  table.stack td.title-cell, table.stack tr:not(:has(td.title-cell)) > td:first-child {
    order: -1; flex-basis: 100%; font-size: 15px; font-weight: 600; color: var(--text);
  }
  table.stack td.title-cell::before, table.stack tr:not(:has(td.title-cell)) > td:first-child::before { content: none; }
  table.stack td.title-cell a { color: var(--text); }
  /* 제목 칸 안의 보조 글(사용자 메일 등)은 굵게 하지 않는다 */
  table.stack tr:not(:has(td.title-cell)) > td:first-child .muted { font-weight: 400; font-size: 13px; }
  /* 설명은 이름표 없이 흐린 한 줄 */
  table.stack td[data-label="설명"] { flex-basis: 100%; }
  table.stack td[data-label="설명"]::before { content: none; }
  /* 이미지는 요약 뒤에 작게 */
  table.stack td.col-thumb { order: 90; flex-basis: 100%; }
  table.stack td.col-thumb::before { content: none; }
  table.stack td.row-actions { order: 99; flex-basis: 100%; display: flex; justify-content: flex-end; gap: 6px; margin-top: 2px; }
  table.stack td.row-actions > * + * { margin-left: 0; }
  table.stack td.row-actions::before { content: none; }
  table.stack tr.clickable { padding-right: 22px; }
  table.stack tr.clickable::after {
    content: '›'; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-size: 20px; color: #98a2b3;
  }
  table.stack td.empty { flex-basis: 100%; display: block; text-align: center; padding: 16px 0; }
}

/* 좁은 화면: 하위 메뉴를 위쪽 가로 탭으로, 항목 편집기는 위아래로 */
@media (max-width: 768px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .list-settings { grid-template-columns: minmax(0, 1fr); }
  .col-item { flex-wrap: wrap; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: minmax(0, 1fr); }
  .hbars li { grid-template-columns: 90px minmax(0, 1fr) 32px; }
  .menu { scrollbar-width: none; }
  .menu::-webkit-scrollbar { display: none; }
  .viewer-img { max-width: 100%; }
  .viewer-stage { position: relative; padding: 0 0 16px; }
  .viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); }
  .viewer-prev { left: 4px; }
  .viewer-next { right: 4px; }
  .who-link .who-name { max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sub-box { margin-left: 12px; }
  /* 탭이 많으면 두 줄로(가려지지 않게) */
  .tabs { gap: 0; flex-wrap: wrap; overflow-x: visible; }
  .tabs button { padding: 0 9px; }
  .editor-panel { padding: 12px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .post-field { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .subnav { margin: -12px -16px 14px; padding: 0 8px; }
  .subnav a { height: 44px; padding: 0 10px; font-size: 14px; gap: 6px; }
}

/* 나의 홈(위젯) — 12칸 격자, 한 줄 56px(home.js 의 HOME_ROW_PX·HOME_GAP 과 맞춘다) */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.home-head h1 { margin: 0; }
.home-head .actions { margin-top: 0; }
.home-head button .icon { margin-right: 4px; }
.home-add { width: auto; }
.home-help { margin: 0 0 12px; }
.home-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 56px; gap: 12px; }
.home-grid > .card + .card { margin-top: 0; }
.home-empty { grid-column: 1 / -1; grid-row: span 2; color: var(--muted); }
.widget { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0; overflow: hidden; }
.widget-head { display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); }
.widget-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 15px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.widget-head h2 span, .widget-head h2 small { overflow: hidden; text-overflow: ellipsis; }
.widget-head h2 small { font-weight: 400; font-size: 12px; }
.widget-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.widget-tools [data-tools] { display: inline-flex; align-items: center; gap: 4px; margin-right: 4px; }
.widget-tools button.link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-size: 13px; }
.widget-body { flex: 1; min-height: 0; overflow: auto; padding: 4px; }
.widget-body .notif-list { padding: 0; }
.widget-empty { margin: 0; padding: 24px 12px; text-align: center; color: var(--muted); }
.widget-table th, .widget-table td { padding: 8px 6px; }
.widget-table tr.clickable { cursor: pointer; }
.widget-table tr.clickable:hover { background: var(--bg); }
.widget-move { display: none; }
/* 편집 중에는 위젯 보조 버튼(모두 읽음·게시판)과 건수를 숨겨 머리에 손잡이·설정·삭제 자리를 둔다 */
.home-grid.editing [data-tools], .home-grid.editing [data-sub] { display: none; }
.home-grid.editing .widget { outline: 2px dashed #c9d6fb; outline-offset: -2px; }
.home-grid.editing .widget-head { cursor: grab; background: #f8f9fb; touch-action: none; user-select: none; }
.home-grid.editing .widget-grip { cursor: grab; margin-left: -8px; }
.widget.dragging { z-index: 2; box-shadow: 0 10px 28px rgba(16, 24, 40, .18); opacity: .96; }
.widget.dragging .widget-head { cursor: grabbing; }
.widget-resize {
  position: absolute; right: 0; bottom: 0; width: 20px; height: 20px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 0 55%, var(--muted) 55% 62%, transparent 62% 72%, var(--muted) 72% 79%, transparent 79%);
}

/* 위젯 설정 대화상자 */
.dialog-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(16, 24, 40, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
/* 모바일 브라우저의 100vh 는 주소창·아래 도구 막대에 가린 곳까지라 창 아래(단추)가 가려진다 — 보이는 높이(dvh)로 */
@supports (height: 100dvh) { .dialog-backdrop { bottom: auto; height: 100dvh; } }
.dialog { background: var(--card); border-radius: var(--radius); width: min(520px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px; display: grid; gap: 4px; }
.dialog > .check { margin-bottom: 10px; }
.dialog-actions { justify-content: flex-end; margin-top: 4px; }
.col-pick { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin: 4px 0 0; min-width: 0; }
.col-pick legend { font-weight: 600; padding: 0 4px; }
.col-pick legend .help { font-weight: 400; }
.col-pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.col-pick-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px; border-radius: 6px; }
.col-pick-item:hover { background: var(--bg); }
.col-pick-item .check { flex: 1; min-width: 0; padding: 6px 0; }
.col-pick-move { display: inline-flex; flex: none; }
.col-pick-move .icon-btn { width: 30px; height: 30px; }

@media (max-width: 640px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .home-grid > .widget { grid-column: 1 !important; grid-row: auto !important; height: calc(var(--h) * 52px); }
  .widget-resize { display: none; }
  .widget-body table.stack tr { padding-left: 8px; padding-right: 8px; }
  .widget-body table.stack tr.clickable { padding-right: 30px; }
  .widget-body table.stack tr.clickable::after { right: 10px; }
  .widget-move { display: inline-flex; }
  .home-grid.editing .widget-head { cursor: default; touch-action: auto; }
  .home-grid.editing .widget-grip { display: none; }
}

/* 게시판 트리(게시판·진행보드·요약 왼쪽). 게시판이 하나면 그리지 않는다 */
.board-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.board-main { min-width: 0; }
.board-tree {
  position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 8px;
}
.tree-toggle { display: none; }
.tree-title { margin: 0 8px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tree-list, .tree-list ul { list-style: none; margin: 0; padding: 0; }
.tree-list ul { padding-left: 14px; }
.tree-board, .tree-folder > summary {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 6px;
  color: var(--text); text-decoration: none; cursor: pointer;
}
.tree-board span, .tree-folder > summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-board:hover, .tree-folder > summary:hover { background: var(--bg); }
.tree-board .icon, .tree-caret { color: var(--muted); }
.tree-board.active { background: #eef2fe; color: var(--primary); font-weight: 600; }
.tree-board.active .icon { color: var(--primary); }
.tree-board.off { color: var(--muted); }
.tree-folder > summary { list-style: none; font-weight: 600; }
.tree-folder > summary::-webkit-details-marker { display: none; }
.tree-caret { transition: transform .15s; }
.tree-folder[open] > summary .tree-caret { transform: rotate(90deg); }
@media (max-width: 900px) {
  .board-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .board-tree { position: static; max-height: none; padding: 0; }
  .tree-toggle { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; justify-content: flex-start; }
  .tree-toggle span { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; }
  .tree-nav { display: none; padding: 4px 8px 8px; border-top: 1px solid var(--line); }
  .board-tree.open .tree-nav { display: block; }
  .tree-title { display: none; }
}

/* 프로젝트 설정 → 게시판: 트리 편집 */
.tree-edit { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tree-edit .tree-edit { margin: 6px 0 0 12px; padding-left: 24px; border-left: 2px solid var(--line); }
.tree-root { margin-bottom: 12px; }
.tree-row.folder-row { background: #f8f9fb; }
.tree-row.folder-row input[data-name] { font-weight: 600; }
.tnode.dragging > .tree-row { opacity: .5; }
.tree-row.drop-before { box-shadow: 0 -3px 0 var(--primary); }
.tree-row.drop-after { box-shadow: 0 3px 0 var(--primary); }
.tree-row.drop-inside { outline: 2px solid var(--primary); background: #eef2fe; }
.tree-empty { padding: 8px 10px; border: 1px dashed var(--line); border-radius: 6px; font-size: 13px; }
.tree-add { display: grid; gap: 8px; }
/* 프로젝트 설정 → 메뉴 */
.menu-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.menu-item [data-label] { flex: 1 1 160px; min-width: 0; }
.menu-item > .muted { flex: 0 0 7.5em; }
.menu-item.is-hidden [data-label] { color: var(--muted); text-decoration: line-through; }
/* 프로젝트 멤버: 가입 승인 대기 */
input[aria-invalid=true], input[aria-invalid=true]:focus { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(217, 45, 32, .12); }
.signup-box { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #fedf89; border-radius: var(--radius); background: #fffcf5; }
.signup-box h2 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.signup-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.signup-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.signup-who { display: grid; gap: 2px; min-width: 0; }
.signup-who .muted { font-size: 12px; overflow-wrap: anywhere; }
/* 프로젝트 멤버: 연결된 사용자그룹 */
.member-groups { margin: 4px 0 16px; }
.member-groups h3 { margin: 0 0 8px; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.member-groups h3 .muted { font-size: 12px; font-weight: 400; }
.linked-groups { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.linked-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.linked-name { flex: 1 1 180px; min-width: 0; display: inline-flex; align-items: center; gap: 6px; }
.linked-group select { width: auto; }
#pm-group-role { flex: 0 0 auto; width: auto; }
.small-note { font-size: 12px; }
/* 프로젝트 멤버: 사용자그룹으로 추가 */
.group-add { flex-wrap: wrap; margin-top: 4px; }
.group-add select { width: auto; flex: 0 1 auto; min-width: 0; }
#pm-group { flex: 1 1 240px; }
/* 새 게시판: 이름 | 설정(기본·복사) | 추가. 좁은 화면은 이름이 한 줄을 다 쓴다 */
.tree-add #board-add { flex-wrap: wrap; }
.tree-add #board-add input { flex: 1 1 240px; }
.tree-add #board-add select { flex: 0 1 260px; width: auto; min-width: 0; }

/* 사용자 상태(온라인·자리비움·다른 용무 중·오프라인) — presence.js */
.presence { position: relative; }
.presence-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.p-online { background: #12b76a; }
.p-away { background: #f79009; }
.p-busy { background: #f04438; }
.p-offline { background: #fff; box-shadow: inset 0 0 0 2px #98a2b3, 0 0 0 2px #fff; }
.who-link .presence-dot.on-avatar { width: 10px; height: 10px; right: -1px; bottom: -1px; }
.presence-me { display: flex; align-items: center; gap: 10px; padding: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.presence-me .presence-text { display: grid; min-width: 0; }
.presence-me small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.presence-item { color: var(--text); text-decoration: none; }
/* 메뉴 구분선: 머리(이름·메일) 아래 선과 같은 곧은 선 */
.presence-sep { height: 1px; margin: 4px 0; background: var(--line); }
.presence-item .icon { color: var(--muted); }
.presence-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 240px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
}
.presence-panel[hidden] { display: none; }
.presence-item { display: flex; align-items: center; gap: 10px; width: 100%; height: auto; padding: 8px; border: 0; background: none; text-align: left; border-radius: 6px; white-space: normal; }
.presence-item:hover, .presence-item:focus { background: var(--bg); }
.presence-item .presence-text { flex: 1; display: grid; }
.presence-item small { font-size: 12px; }
.presence-item.on { font-weight: 600; }
.presence-label { display: inline-flex; align-items: center; gap: 6px; }
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.presence-dot.on-avatar { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; }
.me-presence { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.me-presence select { width: auto; }
/* 권한 수정: '사용자 카드 상세 보기' 아래 카드 항목 */
.card-fields {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  margin: 0 0 4px 28px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 6px; min-width: 0;
}
.card-fields legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.card-fields .help { flex-basis: 100%; margin: 0; }
.card-fields:disabled { opacity: .5; }
/* 기능 검색·'선택한 기능만'으로 '사용자 카드 상세 보기'가 가려지면 항목 칸도 함께 숨긴다 */
.pg-check[hidden] + .card-fields { display: none; }
@media (max-width: 640px) {
  .presence-panel { position: fixed; left: auto; right: 8px; top: 52px; }
  .card-fields { margin-left: 0; }
}

/* 기능 관리: 기능그룹별 묶음 */
.feature-group + .feature-group { margin-top: 16px; }
.feature-group-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; font-size: 15px; }
.feature-group-title .muted { font-size: 13px; font-weight: 400; }
.feature-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.feature-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.feature-row + .feature-row { border-top: 1px solid var(--line); }
.feature-row[hidden] { display: none; }
.feature-row-name { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.feature-row-name strong, .feature-row-name .muted { overflow-wrap: anywhere; }
.feature-row-name .muted { font-size: 13px; }
.feature-row .badge, .feature-row .button { flex: none; }
@media (max-width: 640px) {
  .feature-row { flex-wrap: wrap; gap: 6px 10px; }
  .feature-row-name { flex-basis: 100%; }
}

/* ---------- 모바일 앱 목록(Tabler list-group 참고) — app.js mobileListHtml ---------- */
.mobile-only { display: none !important; }
@media (max-width: 640px) {
  .mobile-only { display: block !important; }
  .desktop-only { display: none !important; }
}
.mlist { list-style: none; margin: 8px -16px 0; padding: 0; border-top: 1px solid var(--line); }
.widget-body .mlist { margin: 0 -4px; border-top: 0; }
.mlist > li[hidden] { display: none; }
.mlist > li { border-bottom: 1px solid var(--line); }
.mlist-item {
  display: flex; align-items: center; gap: 12px; width: 100%; height: auto; padding: 12px 16px;
  border: 0; border-radius: 0; background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.mlist-item:active, .mlist-item:hover { background: var(--bg); }
.mlist-media { flex: none; display: inline-flex; }
.mlist-icon {
  width: 36px; height: 36px; border-radius: 10px; background: #eef2fe; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.mlist-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; display: block; }
.mlist-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mlist-title { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 15px; font-weight: 600; }
.mlist-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlist-count { flex: none; color: var(--muted); font-size: 12px; font-weight: 400; }
.mlist-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.mlist-end { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.mlist-chev { color: #98a2b3; font-size: 20px; line-height: 1; }
.mlist-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 0 16px 10px; margin-top: -4px; }
.mlist-empty { margin: 8px 0; padding: 24px 0; text-align: center; color: var(--muted); }
.badge.warn { background: #fff4e5; color: #b54708; }
.badge.danger { background: #fef3f2; color: var(--danger); }

/* ---------- PC 표(Tabler 표 참고): 작은 회색 열 제목, 줄 강조, 표 안 단추는 글자 링크 ---------- */
@media (min-width: 641px) {
  table.stack thead th { font-size: 12px; font-weight: 600; color: var(--muted); background: #f9fafb; letter-spacing: .02em; }
  table.stack tbody tr:hover { background: #f9fafb; }
  table.stack td.row-actions .button.small:not(.primary),
  table.stack td.row-actions button.small:not(.primary) {
    border-color: transparent; background: none; color: var(--primary); padding: 0 6px; height: 28px;
  }
  table.stack td.row-actions button.small.danger { color: var(--danger); }
  table.stack td.row-actions .button.small:hover, table.stack td.row-actions button.small:not(.primary):hover { background: #eef2fe; }
}

/* 통합검색 */
.search-boards { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.search-boards .chip { text-decoration: none; color: var(--text); background: #fff; border: 1px solid var(--line); }
.search-boards .chip.active { border-color: var(--primary); color: var(--primary); background: #eef2fe; }
.search-results-list { list-style: none; margin: 0; padding: 0; }
.search-results-list li { border-bottom: 1px solid var(--line); }
.search-hit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 4px; color: var(--text); text-decoration: none; }
.search-hit:hover { background: var(--bg); }
.search-where { font-size: 12px; color: var(--muted); }
.search-title { font-size: 15px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.search-title-text { min-width: 0; }
.search-snippet { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.search-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.search-page mark { background: #fff1b8; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---------- 홈 위젯: 게시글 모아보기 · 요약 · 날씨 · 바로가기 ---------- */
.feed-project { display: block; font-weight: 600; }
.widget-table .col-title a { color: var(--text); font-weight: 600; text-decoration: none; }
.widget-table .col-title a:hover { text-decoration: underline; }
.widget-table .col-project small { display: block; font-size: 12px; }
.widget-table .col-author, .widget-table .col-created { white-space: nowrap; }
.mini-project { margin: 6px 8px 8px; display: flex; align-items: baseline; gap: 8px; }
.mini-project a { font-weight: 600; color: var(--text); }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; padding: 0 4px 4px; }
.mini-kpi { padding: 8px 10px; }
.mini-kpi .kpi-value { font-size: 22px; }
table.mini-summary th, table.mini-summary td { padding: 7px 8px; }
table.mini-summary td { text-align: right; font-variant-numeric: tabular-nums; }
table.mini-summary thead th:not(:first-child) { text-align: right; }
table.mini-summary tbody th { color: var(--text); font-weight: 600; white-space: normal; }
table.mini-summary tbody th a { color: var(--text); }
table.mini-summary tfoot th, table.mini-summary tfoot td { font-weight: 700; color: var(--text); border-bottom: 0; }
.mini-help { margin: 6px 8px; }
.weather { display: grid; gap: 8px; padding: 6px 8px; }
.weather-now { display: flex; align-items: center; gap: 12px; }
.weather-icon { color: #f79009; display: inline-flex; }
.weather-temp { font-size: 36px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.weather-desc { display: grid; gap: 2px; font-size: 13px; }
.weather-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; }
.weather-meta li { display: inline-flex; align-items: center; gap: 4px; }
.weather-days { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.weather-days li { display: grid; justify-items: center; gap: 2px; font-size: 12px; text-align: center; }
.weather-days li small { display: inline-flex; align-items: center; gap: 1px; }
.weather-day { font-weight: 600; }
.weather-credit { margin: 0; font-size: 11px; text-align: right; }
.weather-credit a { color: inherit; }
.weather-here { margin: -6px 0 12px; }
.shortcuts { list-style: none; margin: 0; padding: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.shortcut { display: grid; justify-items: center; gap: 6px; padding: 8px 4px; border-radius: 8px; color: var(--text); text-decoration: none; text-align: center; }
.shortcut:hover { background: var(--bg); }
.shortcut:focus-visible { outline: 2px solid var(--primary); }
.shortcut-img { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: #eef2fe; border: 1px solid var(--line); }
.shortcut-img img { width: 100%; height: 100%; object-fit: cover; }
.shortcut-initial { font-size: 20px; font-weight: 700; color: var(--primary); }
.shortcut-title { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-edit-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.sc-edit { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sc-edit-img { flex: none; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.sc-edit-img img { width: 100%; height: 100%; object-fit: cover; }
.sc-edit-fields { flex: 1; min-width: 0; display: grid; gap: 6px; }
.sc-edit-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sc-edit-actions label.button { height: 30px; padding: 0 10px; font-size: 13px; gap: 4px; }
.sc-edit .col-pick-move { flex-direction: column; }
.pick-group { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 4px 0; }
.pick-group-name { width: 100%; font-size: 13px; }
.pick-checks { margin: 4px 0 2px; }

/* ---------- 알림 전체 보기 · 알림 설정 ---------- */
.notif-head-tools { display: inline-flex; align-items: center; gap: 12px; }
.notif-head-tools a.link { color: var(--primary); font-size: 13px; text-decoration: none; }
.notif-foot { display: block; padding: 10px; text-align: center; font-size: 13px; color: var(--primary); text-decoration: none; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
.notif-foot:hover { background: var(--bg); }
.notif-page { max-width: 880px; margin-left: auto; margin-right: auto; }
.notif-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.notif-toolbar select { width: auto; height: 30px; font-size: 13px; }
.notif-toolbar-end { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notif-select-all { padding: 0 4px; }
.notif-page-list { padding: 0; }
.notif-row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.notif-row .notif-item { flex: 1; min-width: 0; }
.notif-check { display: inline-flex; align-items: center; justify-content: center; width: 36px; align-self: stretch; cursor: pointer; }
.notif-check input, .notif-select-all input { width: 16px; height: 16px; }
.rule-intro { margin: 0; flex: 1; min-width: 240px; }
.rule-list { list-style: none; margin: 0; padding: 0; }
.rule { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rule.off .rule-main { opacity: .6; }
.rule-main { flex: 1; min-width: 240px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rule-desc { width: 100%; font-size: 13px; color: var(--muted); }
.rule-desc strong { color: var(--text); }
.rule-actions { display: inline-flex; align-items: center; gap: 8px; }
.rule-people { max-height: 200px; overflow: auto; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 2px 2px; }
.rule-dialog { width: min(600px, 100%); }
.warn-text { color: #b54708; }
@media (max-width: 640px) {
  /* 날씨·요약은 내용 높이만큼(한 줄로 쌓는 모바일에서 줄 수 높이로 자르면 위젯 안에 스크롤이 생겼다).
     본문은 내용 높이라 세로 스크롤은 없고, 넓은 요약 표는 옆으로 민다 */
  .home-grid > .widget-weather, .home-grid > .widget-summary { height: auto; }
  .notif-toolbar-end { margin-left: 0; width: 100%; }
  .weather-temp { font-size: 30px; }
  .rule-actions { width: 100%; justify-content: flex-end; }
}

/* ---------- 갤러리 · 동영상 항목(글 보기), 멤버 알림(글쓰기) ---------- */
.post-field.post-field-wide { grid-template-columns: minmax(0, 1fr); gap: 8px; }
/* 에디터 항목: 글 보기 본문은 SunEditor 본문 서식(표·정렬·목록) 위에 앱 글꼴·여백을 맞추고, 사진은 칸 폭을 넘지 않게 */
.rich-view.sun-editor-editable { padding: 0; font-family: inherit; font-size: inherit; color: inherit; background: transparent; }
.rich-view img { max-width: 100%; height: auto; }
/* 에디터 본문: 넓은 표·코드는 본문 칸 안에서 옆으로 밀고(화면 밖으로 넘치지 않게), 칸 글자는 줄을 바꾼다 */
.post-field dd:has(> .rich-view) { min-width: 0; max-width: 100%; }
.rich-view { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rich-view table { max-width: none; }
.rich-view :is(td, th) { overflow-wrap: anywhere; min-width: 64px; }
.rich-view pre { max-width: 100%; overflow-x: auto; }
/* 테두리는 바깥 한 겹(앱 입력칸과 같은 선 색·모서리 6px). SunEditor 의 툴바 외곽선(outline)은 각져서 겹쳐 보였다 */
.rich-field .sun-editor { border-color: var(--line); border-radius: 6px; }
.rich-field .sun-editor .se-toolbar { outline: 0; border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; }
.rich-field .sun-editor .se-wrapper { border-radius: 0 0 6px 6px; }
/* 모바일: 툴바는 한 줄(board.js 의 %640 목록)이고 넘치는 단추는 옆으로 밀어 쓴다(네이버 글쓰기처럼, 스크롤바는 숨김).
   펼침 메뉴는 단추 줄(.se-btn-tray) 밖의 메뉴 칸에 뜨므로 줄의 가로 스크롤에 잘리지 않는다.
   터치에는 쓸모없는 말풍선은 숨긴다(화면 밖으로 삐져 가로 스크롤이 생겼다) */
@media (max-width: 640px) {
  .rich-field .se-toolbar .se-btn-tray { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .rich-field .se-toolbar .se-btn-tray::-webkit-scrollbar { display: none; }
  .rich-field .se-toolbar .se-btn-tray > .se-btn-module { flex: none; }
  .rich-field .se-toolbar .se-btn-tray > .se-btn-module > .se-menu-list { display: flex; flex-wrap: nowrap; }
  .rich-field .se-toolbar .se-btn-tray > .se-btn-module > .se-menu-list > li { flex: none; white-space: nowrap; }   /* 목록·코드 블록의 ⌄ 단추가 아래 줄로 떨어지지 않게 */
  .rich-field .se-toolbar .se-btn-tray > .se-btn-module > .se-menu-list::before,
  .rich-field .se-toolbar .se-btn-tray > .se-btn-module > .se-menu-list::after { display: none; }
}
@media (max-width: 640px), (hover: none) {
  .rich-field .sun-editor .se-tooltip .se-tooltip-inner { display: none; }   /* SunEditor 쪽 규칙(0,3,0)보다 하나 높게 */
}
/* 줄마다 높이를 맞춰 폭을 채우는 격자: 칸의 grow·basis 를 사진 비율(--r)로, 마지막 줄은 늘리지 않는다 */
.gallery { --row: 190px; display: flex; flex-wrap: wrap; gap: 6px; }
.gallery::after { content: ''; flex-grow: 999999; }
.gallery-item {
  position: relative; flex-grow: var(--r); flex-basis: calc(var(--r) * var(--row)); height: auto; padding: 0; border: 0;
  border-radius: 6px; overflow: hidden; background: var(--bg); cursor: zoom-in;
}
.gallery-item::before { content: ''; display: block; padding-bottom: calc(100% / var(--r)); }
.gallery-item img, .gallery-item .file-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gallery-item .file-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.gallery-item:hover img { filter: brightness(.92); }
.gallery-item:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.video-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.video-frame { background: #000; border-radius: 8px; overflow: hidden; }
.video-frame video { display: block; width: 100%; max-height: 70vh; background: #000; }
.video-frame .viewer-fail { color: #fff; margin: 0; padding: 28px 16px; text-align: center; }
.video-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.video-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-meta .small { display: inline-flex; align-items: center; gap: 4px; }
.notify-members { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #f8f9fb; }
.notify-members .check { font-weight: 600; }
@media (max-width: 640px) {
  .gallery { --row: 120px; gap: 4px; }
}

/* ---------- 프로젝트 설정 → 기본 정보 → 위험 구간 ---------- */
.danger-zone { margin-top: 28px; border: 1px solid #f4b4ae; border-radius: var(--radius); max-width: 720px; }
.danger-zone h2 { display: flex; align-items: center; gap: 6px; margin: 0; padding: 12px 16px; color: var(--danger); border-bottom: 1px solid #f4b4ae; background: #fef3f2; border-radius: var(--radius) var(--radius) 0 0; }
.danger-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 16px; }
.danger-row + .danger-row { border-top: 1px solid #f9d8d5; }
.danger-row > div { flex: 1; min-width: 0; }
.danger-row .help { margin: 4px 0 0; }
.danger-confirm { display: grid; gap: 6px; margin-top: 10px; font-size: 13px; }
.danger-confirm code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
button.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
@media (max-width: 640px) {
  .danger-row { flex-direction: column; align-items: stretch; }
}

/* ---------- 사용자 관리: 편집기의 계정 잠금·삭제, 로그인 관리 ---------- */
.user-danger { margin-top: 20px; max-width: none; background: var(--card); }
.lock-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lock-form select { width: auto; min-width: 110px; }
.lock-form input[type=date] { width: auto; }
.lock-form #ul-reason { flex: 1 1 220px; min-width: 0; }
.danger-row > .lock-buttons { display: flex; flex-direction: column; gap: 8px; flex: none; min-width: 112px; }
.login-delay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.login-delay button { margin-left: auto; }
.login-policy { max-width: 760px; }
.policy-section + .policy-section { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.policy-section h2 { font-size: 16px; margin: 4px 0; }
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit input { width: 120px; }
.input-unit span { color: var(--muted); }
@media (max-width: 640px) {
  .danger-row > .lock-buttons { flex-direction: row; }
  .lock-buttons button { flex: 1; }
  .lock-form select, .lock-form input[type=date] { flex: 1 1 140px; }
}

/* ---------- 좋아요·싫어요 · 스크랩(글 상세) ---------- */
.post-reactions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0 4px; }
button.reaction { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 0 16px; }
button.reaction.on { border-color: var(--primary); background: #eef2fe; color: var(--primary); font-weight: 600; }
button.reaction.down.on { border-color: var(--danger); background: #fef3f2; color: var(--danger); }
button.reaction.scrap.on { border-color: #f79009; background: #fffaeb; color: #b54708; }
button.reaction span { font-variant-numeric: tabular-nums; }

/* ---------- 내 스크랩 ---------- */
.scrap-page { max-width: 880px; margin-left: auto; margin-right: auto; }
.scrap-page h1 { display: flex; align-items: center; gap: 8px; }
.scrap-list { list-style: none; margin: 0; padding: 0; }
.scrap-row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.scrap-item { flex: 1; min-width: 0; display: grid; gap: 4px; padding: 12px 4px; color: var(--text); text-decoration: none; }
.scrap-item:hover { background: var(--bg); }
.scrap-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- 진행보드 필터 ---------- */
.kfilter { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 4px 0 12px; background: #f8f9fb; }
.kfilter[hidden] { display: none; }
.kfilter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kfilter-people { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px 8px; margin: 0; min-width: 0; background: #fff; }
.kfilter-people legend { font-weight: 600; padding: 0 4px; }
.kfilter-checks { display: grid; gap: 2px; max-height: 160px; overflow: auto; }
.kfilter-text .field { margin-bottom: 8px; }
.kfilter .help { margin: 8px 0 0; }
.kfilter-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.kanban-card .filters button .icon { margin-right: 2px; vertical-align: -3px; }

/* ---------- 기능 항목 설정(진행상태·담당자) · 담당자 지정 ---------- */
.be-settings { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 12px; margin: 0 0 12px; display: grid; gap: 6px; min-width: 0; }
.be-settings legend { font-weight: 600; padding: 0 4px; }
.be-settings label:not(.check) { font-weight: 600; margin-top: 6px; }
.be-settings .help { margin: 0; }
.assign-pick { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.assign-pick select { width: auto; height: 30px; font-size: 13px; }

/* ---------- 멤버 그룹 · 상태관리 대상 고르기 · 담당자 지정 창 ---------- */
.team-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.team { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.team-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.team-head input { flex: 1; min-width: 160px; width: auto; }
.team-members { border: 0; padding: 0; margin: 10px 0 0; min-width: 0; }
.team-members legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.team-members .checks { margin-bottom: 8px; }
.scope-radios { margin: 2px 0 4px; }
.scope-pick { border: 1px dashed var(--line); border-radius: var(--radius); padding: 8px 10px; background: #fafbfc; }
.scope-pick[hidden] { display: none; }
.scope-pick .checks { margin-bottom: 6px; }
.assign-dialog { width: min(480px, 100%); }
.assign-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 320px; overflow: auto; display: grid; gap: 2px; }
.assign-option { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; cursor: pointer; font-weight: 400; }
.assign-option:hover { background: var(--bg); }
.assign-option .assign-name { display: grid; gap: 2px; flex: 1; min-width: 0; text-align: left; }
.assign-option input:disabled ~ * { opacity: .6; }
#team-add { flex-wrap: wrap; }
#team-add .error { flex-basis: 100%; margin: 0; }
.assign-option input[type=radio] { width: 16px; height: 16px; flex: none; margin: 0; }
.be-body { display: grid; gap: 6px; }
.be-body[hidden] { display: none; }
.be-sub-body { padding-left: 24px; }
.be-settings > .label, .be-body > .label { margin-top: 10px; font-weight: 600; }
/* 상세 설정 편집 칸의 저장·닫기(·삭제)는 오른쪽 */
.editor-panel form > .actions { justify-content: flex-end; }
/* 상태관리: 진행상태 값 요약 · 값 관리 창(바로 저장) */
.status-summary { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fafbfc; }
.status-summary [data-status-summary] { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0; }
.status-summary small { margin-left: 6px; }
.status-values-dialog { width: min(760px, 100%); }
.status-values-dialog .notice { margin: 0 0 10px; padding: 8px 10px; border-color: #c9d6fb; background: #eef2fe; color: var(--primary); font-size: 13px; }
.status-values-dialog .dialog-actions { position: sticky; bottom: -20px; margin: 8px -20px -20px; padding: 10px 20px; background: var(--card); border-top: 1px solid var(--line); }

/* ---------- 시스템 관리: 통계 · 로그 · 기본정보(system.js) ---------- */
.stats .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats .page-head .seg { margin-bottom: 0; }
.stats .kpi-value { overflow-wrap: anywhere; }
.stats-period { margin: -8px 0 14px; font-size: 13px; }
.stats section + section, .stats .summary-grid { margin-top: 24px; }
.stats-boards td.stats-size { min-width: 140px; }
.stats-boards td.stats-size .hbar-track { display: block; margin-top: 4px; }
.stats-boards tr.is-off td { color: var(--muted); }
.stats .hbar-track { display: block; height: 8px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.stats .hbar-track .hbar { min-width: 0; border-radius: 4px; }
.stats-disk li { grid-template-columns: 100px minmax(0, 1fr) 72px; }
.stats-disk .hbar-value { text-align: right; white-space: nowrap; }
.stats .help { font-size: 13px; }
td.num, th.num { text-align: right; white-space: nowrap; }
.log-table td { vertical-align: top; }
.log-table .log-ua { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-alert { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; display: grid; gap: 6px; font-size: 14px; }
.log-alert.has { border-color: #f3c27a; background: #fff8ec; }
.log-alert .badge { margin: 2px 4px 2px 0; }
.dialog.wide { width: min(860px, 100%); }
.log-detail { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 6px 12px; margin: 8px 0 12px; font-size: 14px; }
.log-detail dt { color: var(--muted); }
.log-detail dd { margin: 0; }
.log-stack {
  margin: 0; max-height: 46vh; overflow: auto; padding: 12px; border-radius: 6px; background: #f6f7f9; border: 1px solid var(--line);
  font-size: 12px; line-height: 1.5; white-space: pre;
}
.site-form { max-width: 640px; }
.holiday-card { max-width: 820px; margin-top: 16px; }
.holiday-card .page-head .seg { margin-bottom: 0; }
.holiday-add input[type=date] { max-width: 170px; }
.holiday-add input[name=name] { max-width: 260px; }
.holiday-table td { vertical-align: middle; }
/* 간트: 평일 휴일 음영(주말과 같은 색), 날짜 칸은 붉게(weekend) */
.g-tick.holiday { font-weight: 600; }
@media (max-width: 768px) {
  .stats .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .page-head { flex-wrap: wrap; gap: 8px; }
  .stats .page-head .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .stats .page-head .seg::-webkit-scrollbar { display: none; }
  .stats .page-head .seg button { flex: none; }
  .log-detail { grid-template-columns: minmax(0, 1fr); }
}

/* 일정(간트차트, schedule.js): 한 스크롤 안에서 표 칸(.g-cells)은 왼쪽에 붙고 시간축(.g-track)만 옆으로 밀린다 */
.schedule-card { max-width: none; }
.sched-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sched-head h1 { margin-bottom: 8px; }
.sched-head p.muted { margin: 0 0 2px; font-size: 13px; }
.sched-head .actions { margin-top: 0; }
.sched-head .actions button .icon, .sched-toolbar .icon { vertical-align: -3px; }
.sched-toolbar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sched-toolbar .seg { margin-bottom: 0; }
.sched-counts { display: inline-flex; gap: 12px; flex-wrap: wrap; margin-left: auto; font-size: 13px; color: var(--muted); }
.sched-count { display: inline-flex; align-items: center; gap: 5px; }
.sched-count .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.s-planned { --c: #98a2b3; --t: #eaecf0; }
.s-active { --c: var(--primary); --t: #dbe4fd; }
.s-done { --c: var(--ok); --t: #d1f1e0; }
.s-late { --c: var(--danger); --t: #fde2df; }
.sched-filters select { min-width: 130px; }
.sched-filters input { max-width: 260px; }
.sched-help { margin: 10px 0 0; }
.sched-help .icon { vertical-align: -1px; }

.gantt { --grid-w: 560px; --row-h: 36px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gantt-scroll { overflow: auto; max-height: calc(100vh - 290px); max-height: calc(100dvh - 290px); min-height: 220px; overscroll-behavior-x: contain; }
.gantt-inner { width: max-content; min-width: 100%; }
.g-head { position: sticky; top: 0; z-index: 4; display: flex; background: #fafbfc; border-bottom: 1px solid var(--line); }
.g-body { position: relative; }
.g-row { display: flex; height: var(--row-h); border-bottom: 1px solid #eef0f3; }
.g-row:last-child { border-bottom: 0; }
.g-row:hover .g-cells { background-color: #f8f9fb; }
.g-cells {
  position: sticky; left: 0; z-index: 2; flex: none; width: var(--grid-w);
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 76px 46px 46px 42px 54px; align-items: center;
  background: #fff; border-right: 1px solid var(--line); font-size: 13px;
}
.g-head .g-cells { background: #fafbfc; color: var(--muted); font-weight: 600; z-index: 5; height: 48px; }
.g-cells > span { padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-no { color: var(--muted); font-variant-numeric: tabular-nums; }
.g-cells > .g-name { display: flex; align-items: center; gap: 2px; padding-left: calc(4px + var(--depth, 0) * 16px); }
.g-toggle.icon-btn { width: 22px; height: 22px; flex: none; color: var(--muted); }   /* 그룹 이름 오른쪽, 아이콘만 */
/* 작업명 머리 오른쪽: 전체 접기·펴기 단추 하나(아이콘만, 상태에 따라 바뀐다) */
.g-head .g-name-head { display: flex; align-items: center; justify-content: flex-start; gap: 4px; }   /* 아이콘은 글자 바로 오른쪽 */
.g-fold-all.icon-btn { width: 24px; height: 24px; flex: none; color: var(--muted); }
/* 잠금: 잠기면 회색 자물쇠, 풀리면 파란 열린 자물쇠 */
.g-lock.icon-btn { width: 24px; height: 24px; flex: none; color: var(--muted); }
.g-lock.icon-btn.open { color: var(--primary); background: #eef2fe; }
.g-lock.icon-btn:hover { color: var(--text); background: var(--bg); }
.g-fold-all.icon-btn:hover { color: var(--text); background: var(--bg); }
/* 순서 핸들(작업명 앞): 끌거나 초점 두고 ↑↓. 끄는 줄은 흐리게, 놓일 자리는 파란 선 */
.g-grip {
  flex: none; width: 18px; height: 24px; padding: 0; border: 0; background: none; color: #b0b7c3;
  cursor: grab; touch-action: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px;
}
.g-grip:hover, .g-grip:focus-visible { color: var(--text); background: var(--bg); }
.g-row.g-dragging { opacity: .45; }
.g-row.g-dragging .g-grip { cursor: grabbing; }
.g-row.drop-before .g-cells { box-shadow: inset 0 2px 0 var(--primary); }
.g-row.drop-after .g-cells { box-shadow: inset 0 -2px 0 var(--primary); }
.g-open { border: 0; background: none; padding: 0 2px; height: auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; color: var(--text); text-align: left; }
.g-open:hover { text-decoration: underline; }
.kind-group .g-open { font-weight: 600; }
.g-ms-mark { color: #7a5af8; font-size: 11px; flex: none; }
.g-late { background: #fde2df; color: var(--danger); font-size: 11px; padding: 0 6px; margin-left: 4px; flex: none; }
.g-date, .g-dur, .g-pct { text-align: right; font-variant-numeric: tabular-nums; }
.g-head .g-date, .g-head .g-dur, .g-head .g-pct { text-align: right; }
.g-manual { color: var(--primary); margin-left: 2px; }
.g-manual .icon { vertical-align: -1px; }

.g-scale { position: relative; flex: none; height: 48px; }
.g-scale.zoom-month { height: 48px; }
.g-months, .g-days { position: relative; height: 24px; }
.zoom-month .g-months { height: 48px; }
.g-months span, .g-tick { position: absolute; top: 0; height: 100%; display: flex; align-items: center; padding-left: 6px;
  border-left: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.g-months span { font-weight: 600; color: var(--text); }
.g-days { border-top: 1px solid var(--line); }
.zoom-day .g-tick { justify-content: center; padding-left: 0; font-size: 11px; }
.g-tick.weekend { color: #b42318; background: #fbf5f5; }
.g-tick.today { background: var(--primary); color: #fff; font-weight: 700; }

.g-overlay { position: absolute; top: 0; bottom: 0; left: var(--grid-w); pointer-events: none; z-index: 0; }
.g-weekend { position: absolute; top: 0; bottom: 0; background: rgba(16, 24, 40, .035); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--primary); opacity: .55; }
.g-track { position: relative; flex: none; z-index: 1; }
.g-bar {
  position: absolute; top: 8px; height: 20px; min-width: 4px; padding: 0; border: 1px solid var(--c, #98a2b3);
  border-radius: 4px; background: var(--t, #eaecf0); overflow: hidden; cursor: pointer;
}
.g-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c, #98a2b3); opacity: .85; pointer-events: none; }
.g-bar.g-drag { cursor: grab; touch-action: pan-x pan-y; }
.g-bar.dragging, .g-ms.dragging { cursor: grabbing; box-shadow: 0 2px 8px rgba(16, 24, 40, .25); z-index: 3; }
.g-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.g-handle.start { left: 0; }
.g-handle.end { right: 0; }
.g-bar:focus-visible, .g-ms:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.kind-group .g-bar { top: 13px; height: 10px; border-color: #475467; background: #d0d5dd; border-radius: 2px; cursor: pointer; }
.kind-group .g-fill { background: #475467; }
.g-ms {
  position: absolute; top: 10px; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 2px;
  background: #7a5af8; transform: rotate(45deg); cursor: pointer;
}
.g-ms.g-drag { cursor: grab; }
.s-done .g-ms { background: var(--ok); }
.s-late .g-ms { background: var(--danger); }
.g-bar-label { position: absolute; top: 0; line-height: var(--row-h); font-size: 12px; color: var(--muted); white-space: nowrap; pointer-events: none; }

/* 목록 보기 */
.sched-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sched-item-open {
  width: 100%; height: auto; padding: 10px 12px; display: grid; gap: 4px; text-align: left;
  border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); white-space: normal;
}
.sched-item-open:hover { background: #f8f9fb; }
.sched-item-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.sched-status { background: var(--t); color: var(--c); font-weight: 600; }
.sched-path { overflow: hidden; text-overflow: ellipsis; }
.sched-item-name { font-size: 15px; }
.sched-item-meta { color: var(--muted); font-size: 13px; }
.sched-progress { display: block; height: 6px; border-radius: 3px; background: var(--t); overflow: hidden; }
.sched-progress span { display: block; height: 100%; background: var(--c); }
.sched-item-pct { font-size: 12px; color: var(--muted); }

/* 편집 창 */
.sched-dialog { width: min(560px, 100%); }
/* 항목이 많아 창 안을 밀어도 취소·저장은 늘 창 아래에 보인다 */
.sched-dialog .dialog-actions { position: sticky; bottom: -20px; z-index: 1; margin: 8px -20px -20px; padding: 10px 20px; background: var(--card); border-top: 1px solid var(--line); }
.sched-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.sched-dates .field[hidden] { display: none; }
.sched-kind .checks, .sched-progress-field { margin-bottom: 10px; }
.sched-progress-field { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.sched-progress-field legend { width: 100%; }
.sched-manual { display: inline-flex; align-items: center; gap: 6px; }
.sched-manual[hidden] { display: none; }
.sched-manual input { width: 90px; }
.sched-post-list, .sched-post-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sched-post-list li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sched-post-list a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-post-list .icon-btn { width: 28px; height: 28px; }
.sched-posts input[type=search] { margin-top: 6px; }
.sched-post-results { margin-top: 4px; max-height: 180px; overflow: auto; }
.sched-post-results .link-row {
  width: 100%; height: auto; padding: 6px 8px; display: flex; align-items: center; gap: 6px; text-align: left;
  border: 0; background: none; white-space: normal;
}
.sched-post-results .link-row:hover { background: var(--bg); }
.sched-post-results .link-row span:nth-child(2) { flex: 1; min-width: 0; }
.sched-delete { margin-right: auto; }
.sched-delete .icon { vertical-align: -3px; }

@media (max-width: 640px) {
  /* 좁은 화면: 작업명·진척률만 남기고 시간축을 옆으로 민다, 끌기 대신 눌러서 편집 창 */
  .gantt, .gantt.can-move { --grid-w: 184px; }
  .g-cells, .gantt.can-move .g-cells { grid-template-columns: minmax(0, 1fr) 60px; }
  .g-cells > :is(.g-no, .g-who, .g-date, .g-dur) { display: none; }
  .g-cells .g-late { display: none; }   /* 지연은 막대·줄 색으로 */
  .gantt-scroll { max-height: calc(100vh - 250px); max-height: calc(100dvh - 250px); }
  .sched-counts { margin-left: 0; }
  .sched-filters input, .sched-filters select { max-width: none; flex: 1 1 140px; }
  .sched-dates { grid-template-columns: 1fr; }
}

/* 프로젝트(중메뉴 일정·요구사항·통계) 공통 */
.file-button { position: relative; cursor: pointer; }
.file-button input[type=file] { display: none; }
button.link-text { height: auto; padding: 0; border: 0; background: none; color: var(--text); text-align: left; white-space: normal; }
button.link-text:hover { text-decoration: underline; }
.settings-section + .settings-section { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.sched-req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sched-req-list a { color: var(--text); }
.sched-import-sum { display: flex; gap: 6px; flex-wrap: wrap; }
.sched-import-table td { font-size: 13px; }
.sched-import-table tr.is-error td { background: #fff8f7; }
.sched-import .dialog-actions { position: sticky; bottom: -20px; margin: 8px -20px -20px; padding: 10px 20px; background: var(--card); border-top: 1px solid var(--line); }

/* 요구사항 */
.req-summary { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.req-summary strong { color: var(--text); }
.req-notice { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.req-notice .icon { color: #b54708; }
.req-notice[hidden] { display: none; }
.req-missing { white-space: nowrap; }
.req-missing .icon { vertical-align: -2px; }
.req-table tr.is-missing td { background: #fffaf0; }
.req-tasks { font-size: 13px; max-width: 280px; }
.req-status { white-space: nowrap; }
.req-status.st-confirmed { background: #e7f6ee; color: var(--ok); }
.req-status.st-changed { background: #eef2fe; color: var(--primary); }
.req-status.st-hold { background: #fff4e5; color: #b54708; }
.req-status.st-dropped { color: var(--muted); text-decoration: line-through; }
.req-task-pick { list-style: none; margin: 6px 0 0; padding: 4px 8px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; display: grid; gap: 2px; }
.req-task-pick li { padding-left: calc(var(--depth, 0) * 16px); }
.req-task-pick li[hidden] { display: none; }
.req-task-pick .check { padding: 4px 0; }
.req-history { margin: 4px 0 8px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.req-history summary { cursor: pointer; font-weight: 600; }
.req-history-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 13px; }
.req-history-list li { border-left: 2px solid var(--line); padding-left: 10px; display: grid; gap: 2px; }
.req-reason { color: var(--text); }
.req-type-list { display: grid; gap: 6px; margin: 8px 0; }
.req-type { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.req-type [data-name] { flex: 1 1 160px; width: auto; min-width: 0; }
.req-prefix { width: 110px; flex: none; text-transform: uppercase; }
.req-type-add { flex-wrap: wrap; align-items: center; }
.req-type-add .error { flex-basis: 100%; margin: 0; }
/* 하위 분류: 단계마다 들여쓰기(모바일은 좁게) */
.req-type { margin-left: calc(var(--depth, 0) * 24px); }
.req-type .rt-branch { color: var(--muted); flex: none; }
.req-type select.rt-required { flex: none; width: auto; min-width: 0; }
.req-types-section { position: relative; }
.req-type-add input[name=name] { flex: 1 1 200px; }
/* '+ 하위' 로 연 입력 줄: 그 분류 바로 밑, 한 단계 들여서 */
.req-type-new { border-style: dashed; background: #f8faff; }
.rt-new-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.rt-new-form input[name=name] { flex: 1 1 200px; min-width: 0; }
.rt-new-form select { flex: none; width: auto; max-width: 100%; }
.rt-new-form .error { flex-basis: 100%; margin: 0; }
.rt-new-form .error:empty { display: none; }

/* 프로젝트 통계: 표 안 막대(한 가지 색), 월별 칸은 숫자 + 같은 색의 진하기 */
.project-stats section + section { margin-top: 28px; }
.project-stats .kpi-value small { font-size: 14px; font-weight: 600; color: var(--muted); }
.ps-table td, .ps-table th { font-size: 13px; }
.ps-bar-col { min-width: 180px; }
.ps-bar { display: grid; grid-template-columns: minmax(80px, 1fr) 52px; align-items: center; gap: 8px; }
.ps-bar .num { text-align: right; }
.ps-month td.ps-heat { background: rgba(42, 120, 214, var(--heat, 0)); }
.ps-month tfoot th, .ps-month tfoot td { border-top: 2px solid var(--line); }
.badge .icon { vertical-align: -2px; }
@media (max-width: 640px) {
  .ps-bar-col { min-width: 140px; }
  .req-type [data-name] { flex-basis: 100%; }
  .req-type { margin-left: calc(var(--depth, 0) * 12px); }
  /* 모바일: 새 분류 이름은 한 줄을 다 쓰고, 접두어·일정 연결·단추는 다음 줄 */
  .req-type-add input[name=name], .rt-new-form input[name=name] { flex-basis: 100%; }
  .rt-new-form .rt-branch { display: none; }
  .req-type-add input[name=prefix], .rt-new-form input[name=prefix] { flex: 1 1 120px; width: auto; }
}
/* 필터 줄의 체크칸은 글자 칸처럼 늘이지 않는다 */
.filters .check input[type=checkbox] { flex: none; min-width: 0; width: auto; }

/* 게시판: 담당자 여러 명·멤버 그룹, 기능 항목 위치·날짜 */
.assignee-value { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.assignee-chip { padding: 2px 8px; font-size: 13px; }
.assignee-chip .icon { vertical-align: -2px; margin-right: 2px; }
.assignee-chip button.link { font-size: 15px; margin-left: 2px; color: var(--muted); }
.assign-section { padding: 8px 8px 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.assign-team { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: #eef2fe; color: var(--primary); }
.assign-option input[type=checkbox] { width: 16px; height: 16px; flex: none; margin: 0; }
.assign-picked { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0 0; min-height: 26px; }
.pf-date-row, .pf-location-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-date-row input { width: auto; flex: 1 1 180px; }
.pf-location-row input { flex: 1 1 220px; width: auto; }
.post-location { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-location .icon, .post-field dd > .icon { vertical-align: -2px; }

/* 프로젝트 화면 머리 단추: 엑셀 메뉴 · 나눔 단추(+ 작업 | ▾ 그룹·마일스톤), 좁은 화면 필터 단추, 접는 사용 방법 */
.sched-head { flex-wrap: nowrap; align-items: center; }
.sched-head > div:first-child { min-width: 0; }
.sched-head > div:first-child p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-actions { flex: none; flex-wrap: nowrap; gap: 6px; }
.head-actions .icon { vertical-align: -3px; }
.pop-wrap { position: relative; display: inline-flex; }
.menu-button { display: inline-flex; align-items: center; gap: 4px; }
.pop-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 250px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
}
.pop-menu[hidden] { display: none; }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: auto; padding: 8px; border: 0; border-radius: 6px;
  background: none; color: var(--text); text-align: left; text-decoration: none; white-space: normal; font: inherit; cursor: pointer;
}
.pop-item:hover, .pop-item:focus { background: var(--bg); outline: none; }
.pop-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.pop-item > .icon { color: var(--muted); flex: none; }
.pop-text { display: grid; gap: 1px; }
.pop-text small { font-size: 12px; }
.pop-ms { width: 18px; text-align: center; color: #7a5af8; font-size: 12px; flex: none; }
.split-button { display: inline-flex; }
.split-button > button.primary { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-button .pop-wrap > button.split-caret { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 8px;
  border-left: 1px solid rgba(255, 255, 255, .35); }
.list-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.list-meta .sched-counts, .list-meta .req-summary { margin: 0; }
.list-meta .filter-toggle { display: none; }
.sched-meta-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.sched-meta-actions .menu-button .icon { vertical-align: -2px; }
.sort-item[aria-checked="false"] > .icon { visibility: hidden; }
.sort-item[aria-checked="true"] { color: var(--primary); font-weight: 600; }
.pop-sep { height: 1px; background: var(--line); margin: 6px 2px; }
.pop-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border-radius: 6px; cursor: pointer; }
.pop-switch:hover { background: var(--bg); }
/* 켬·끔 스위치(체크박스 role=switch) */
.pop-switch input, input.switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 34px; height: 20px; margin: 0; padding: 0;
  border: 0; border-radius: 10px; background: #d0d5dd; cursor: pointer; transition: background .15s;
}
.pop-switch input::before, input.switch::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .25); transition: transform .15s;
}
.pop-switch input:checked, input.switch:checked { background: var(--primary); }
.pop-switch input:checked::before, input.switch:checked::before { transform: translateX(14px); }
.pop-switch input:focus-visible, input.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pop-switch:has(input:disabled) { opacity: .5; cursor: default; }
.filter-toggle .icon { vertical-align: -2px; }
.help-details { margin-top: 12px; }
.help-details summary { cursor: pointer; color: var(--muted); font-size: 13px; width: fit-content; }
.help-details summary .icon { vertical-align: -2px; }
.help-details p { margin: 6px 0 0; }
@media (max-width: 640px) {
  .head-actions > button, .head-actions .pop-wrap > button, .split-button > button { height: 36px; padding: 0 10px; }
  .split-button .pop-wrap > button.split-caret { padding: 0 6px; }
  .list-meta .filter-toggle { display: inline-flex; align-items: center; gap: 4px; flex: none; }
  .sched-filters:not(.open), .req-filters:not(.open) { display: none; }
  .pop-menu { width: min(250px, calc(100vw - 48px)); }
}

/* 오늘선은 막대 위(왼쪽 표 칸보다는 아래) */
.g-overlay-front { z-index: 2; }
.g-body .g-cells { z-index: 3; }
.g-today { opacity: .8; }

/* 담당자 지정: 고른 칩 + 빠른 찾기(사람 단추 = 전체 목록) */
.assign-search { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.assign-search input { flex: 1; min-width: 0; }
.assign-all.icon-btn { width: var(--control-h); height: var(--control-h); border: 1px solid var(--line); flex: none; color: var(--primary); }
.assign-suggest { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 6px; max-height: 260px; overflow: auto;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .1); }
.assign-suggest[hidden] { display: none; }
.assign-suggest .assign-option { cursor: pointer; }
.assign-suggest .assign-option.active { background: #eef2fe; }
.assign-none { padding: 8px; }
.assign-picker .dialog-actions { justify-content: space-between; }
.assign-count { font-size: 13px; }

/* 제목 뒤 (?) 사용 방법 */
.schedule-card, .requirements-card { position: relative; }
/* 동그라미는 옆 글자보다 작게(글자 크기의 약 0.75배), 글자 가운데 높이에 맞춘다. 누르는 자리는 ::before 로 넓힌다 */
.help-q {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  font-size: max(9px, .6em); width: max(12px, 1.25em); height: max(12px, 1.25em); min-width: 0; min-height: 0;
  padding: 0; margin: 0 0 0 .35em; border: 1.5px solid var(--muted); border-radius: 50%; background: none;
  color: var(--muted); font-weight: 700; line-height: 1; vertical-align: middle; top: -.12em; cursor: pointer;
}
.help-q::before { content: ""; position: absolute; inset: -10px; }
.help-q:hover, .help-q[aria-expanded=true] { border-color: var(--primary); color: var(--primary); background: #eef2fe; }
.help-pop {
  position: absolute; z-index: 40; max-width: 560px; padding: 12px 14px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(16, 24, 40, .14);
  font-size: 13px; font-weight: 400; color: var(--text); line-height: 1.6; white-space: normal;
}
.help-pop[hidden] { display: none; }
.help-pop p { margin: 0; }
.help-pop .icon { vertical-align: -1px; }

/* 위젯 추가 창: 묶음별 카드 */
.widget-picker { width: min(760px, 100%); }
.wp-group + .wp-group { margin-top: 14px; }
.wp-group h3 { font-size: 13px; color: var(--muted); margin: 6px 0 8px; }
.wp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.wp-card {
  position: relative; display: flex; align-items: flex-start; gap: 10px; height: auto; padding: 12px; text-align: left; white-space: normal;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.wp-card:hover, .wp-card:focus-visible { border-color: var(--primary); background: #f6f8ff; }
.wp-icon { flex: none; width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: #eef2fe; color: var(--primary); }
.wp-text { display: grid; gap: 3px; min-width: 0; }
.wp-text small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.wp-used { position: absolute; top: 8px; right: 8px; font-size: 11px; }
.widget-picker .dialog-actions { position: sticky; bottom: -20px; margin: 8px -20px -20px; padding: 10px 20px; background: var(--card); border-top: 1px solid var(--line); }

/* 프로젝트 위젯 목록 */
.home-tasks, .home-milestones, .home-reqs, .home-posts { list-style: none; margin: 0; padding: 0; display: grid; }
.home-tasks li a, .home-milestones li a, .home-posts li a { display: flex; align-items: center; gap: 8px; padding: 7px 2px; color: var(--text); text-decoration: none; border-bottom: 1px solid #eef0f3; }
.home-tasks li:last-child a, .home-milestones li:last-child a, .home-posts li:last-child a { border-bottom: 0; }
.home-tasks a:hover strong, .home-milestones a:hover strong, .home-posts a:hover strong, .home-reqs a:hover { text-decoration: underline; }
.home-task .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.home-task-main, .home-ms-name, .home-post-main { display: grid; gap: 1px; flex: 1; min-width: 0; }
.home-task-main strong, .home-ms-name strong, .home-post-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.home-task-main small, .home-ms-name small, .home-post-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-task-end { display: grid; justify-items: end; gap: 3px; flex: none; font-size: 12px; }
.home-task-bar { width: 64px; height: 5px; border-radius: 3px; background: var(--t); overflow: hidden; }
.home-task-bar span { display: block; height: 100%; background: var(--c); }
.home-milestones li { display: flex; justify-content: space-between; gap: 8px; }
.home-milestones li > span { padding: 7px 2px; }
.home-dday { flex: none; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.home-dday.soon { color: #b54708; }
.home-dday.late { color: var(--danger); }
.home-reqs li a { display: block; padding: 4px 2px; color: var(--text); text-decoration: none; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-kpi .kpi-value small { font-size: 12px; color: var(--muted); font-weight: 600; }

/* 간트 막대의 담당자 이름 */
.g-bar-who { position: absolute; top: 0; line-height: var(--row-h); transform: translateX(-100%); font-size: 12px; color: var(--text); white-space: nowrap; pointer-events: none; }
.g-who-after { color: var(--text); }
.gantt-who-preview { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 6px; font-size: 12px; width: fit-content; }
.gp-bar { width: 120px; height: 16px; border: 1px solid var(--primary); border-radius: 4px; background: #dbe4fd; overflow: hidden; display: inline-block; }
.gp-bar span { display: block; height: 100%; background: var(--primary); opacity: .85; }
.gp-label { color: var(--muted); }
.gp-who { color: var(--text); }
.gp-req { color: var(--primary); }
.gp-bar { position: relative; }
.gp-bar .gp-in { position: absolute; inset: 0; display: block; line-height: 14px; padding: 0 4px; font-style: normal; font-size: 10px; color: var(--text); white-space: nowrap; overflow: hidden; }
.gp-bar .gp-in .gp-req { display: inline; height: auto; opacity: 1; background: rgba(255, 255, 255, .85); border-radius: 2px; padding: 0 2px; color: var(--text); }
/* 간트 막대 뒤 요구사항 번호(누르면 상세 창) — 막대 글은 누를 수 없지만 번호는 누른다 */
.g-reqs { pointer-events: auto; }
.g-bar-label .g-reqs { margin-left: 4px; }
/* 막대 안: 막대 위에 겹친 칸(막대 높이 20px), 넘치면 잘라 '…' — 번호는 흰 바탕 글로 채움 색 위에서도 읽힌다 */
.g-bar-in {
  position: absolute; top: 8px; height: 20px; z-index: 2; display: block; line-height: 20px; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; pointer-events: none; font-size: 11px; color: var(--text);
}
.g-bar-in .g-reqs { overflow: hidden; text-overflow: ellipsis; }
/* 칩은 막대(20px)보다 낮게(14px) 가운데 — 위아래 3px 띄워 막대 테두리와 겹치지 않게 */
.g-bar-in .g-req {
  display: inline-block; height: 14px; line-height: 14px; vertical-align: top; position: relative; top: 3px; font-size: 10px; padding: 0 3px;
  background: rgba(255, 255, 255, .85); color: var(--text); text-decoration: none; border-radius: 3px;
}
.g-bar-in .g-req:hover, .g-bar-in .g-req:focus-visible { background: #fff; color: var(--primary); }
.g-req {
  height: auto; padding: 0 1px; border: 0; border-radius: 3px; background: none; font: inherit; font-size: 12px;
  color: var(--primary); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; cursor: pointer;
}
.g-req:hover, .g-req:focus-visible { background: #eef2fe; text-decoration-style: solid; }
.g-req.more { text-decoration: none; font-weight: 600; }
/* 요구사항 상세 창(보기만) */
.req-detail { width: min(560px, 100%); }
.req-detail h2 { margin: 2px 0 10px; overflow-wrap: anywhere; }
.req-detail h3 { font-size: 14px; margin: 14px 0 6px; }
.req-detail-code { margin: 0; }
.req-detail-meta { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 14px; }
.req-detail-meta dt { color: var(--muted); }
.req-detail-meta dd { margin: 0; overflow-wrap: anywhere; }
.req-detail-desc { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.req-detail-tasks { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 2px; }
.req-detail-by { margin: 14px 0 0; font-size: 12px; }
.req-pick-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.req-pick-list .pop-item .badge { flex: none; }
/* 작업 상세 창(보기)·연결 게시글 상세 창 */
.link-btn {
  height: auto; padding: 2px 0; border: 0; background: none; font: inherit; color: var(--text); text-align: left; white-space: normal;
  cursor: pointer; overflow-wrap: anywhere;
}
.link-btn:hover, .link-btn:focus-visible { color: var(--primary); text-decoration: underline; }
.link-btn .badge { text-decoration: none; }
.sched-view-meta { grid-template-columns: 72px minmax(0, 1fr); }
.sched-view-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.sched-req-list .link-btn { font-size: 14px; }
.post-peek-by { margin: 0 0 10px; font-size: 13px; }
/* 게시글 상세: 항목 이름 위·값 아래(값이 폭을 다 쓴다), 내용 칸만 스크롤 — 단추는 늘 보인다 */
.post-peek-body { max-height: min(55vh, 520px); overflow: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); padding-top: 4px; }
.post-peek-fields { margin: 0; font-size: 14px; }
.post-peek-fields dt { margin-top: 10px; font-size: 12px; color: var(--muted); }
.post-peek-fields dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.post-peek-fields dd.pre { white-space: pre-wrap; }
.post-peek-fields .rich-view img { max-width: 100%; height: auto; }
.post-peek-fields .rich-view { overflow-x: auto; }   /* 넓은 표는 그 칸에서 옆으로 */
.peek-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 4px; }
.peek-thumbs a { display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.peek-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.peek-files { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.peek-files a { color: var(--text); overflow-wrap: anywhere; }
.peek-files a:hover { color: var(--primary); }
.peek-files .icon { vertical-align: -2px; color: var(--muted); }
.home-milestones li > a { flex: 1; min-width: 0; }
/* 프로젝트 설정 → 프로젝트 휴무일 */
[data-project-holidays] .page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
[data-project-holidays] .page-head .help { margin: 0; flex: 1 1 300px; }
.ph-system { margin-top: 10px; font-size: 13px; }
.ph-system summary { cursor: pointer; color: var(--muted); }
.ph-system ul { margin: 6px 0 0; padding-left: 18px; columns: 2; color: var(--muted); }
@media (max-width: 640px) { .ph-system ul { columns: 1; } }

/* 통계 표: 업무명·담당자는 한 줄로(좁은 화면에서는 표가 옆으로 밀린다) */
.ps-table .ps-name, .ps-table td:first-child { white-space: nowrap; }
.req-view .req-detail-code { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* 일정: 상태 개수 줄 + 필터 줄. 넓은 화면은 정렬 단추를 필터 줄 오른쪽 끝에(한 묶음), 좁은 화면은 '필터' 단추 옆 */
@media (min-width: 641px) {
  .sched-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
  .sched-controls > .list-meta, .sched-controls .sched-meta-actions { display: contents; }
  .sched-controls .sched-counts { grid-column: 1 / -1; grid-row: 1; }
  .sched-controls .sched-filters { grid-column: 1; grid-row: 2; margin: 0; }
  .sched-controls .sched-meta-actions > .pop-wrap { grid-column: 2; grid-row: 2; justify-self: end; }
  .sched-controls .sched-meta-actions > .pop-wrap > .menu-button { height: var(--control-h); }
}
.filter-reset .icon { vertical-align: -2px; }
.filter-reset:disabled { opacity: .45; }
