/* 사용자 제보로 바로 고친 것 (2026-10-16). 다른 CSS 와 동시에 손대지 않도록 따로 둔 파일 — 정리 때 제자리로 옮겨도 된다. */

/* ---- KPI 카드 (대시보드 2×2 · 프로젝트 개요) ----
   모바일에서 카드 좌우 여백(12px)과 하단 띠의 음수 여백(-14px)이 어긋나 띠가 좌우로 삐져나오고,
   모바일 규칙이 카드 아래 여백 14px 을 되살려 띠가 바닥에 붙지 않았다. 옆 카드 높이에 맞춰
   늘어난 공간도 띠 아래에 남았다. → 여백을 변수 하나로 맞추고, 본문이 남는 높이를 차지해 띠를 바닥에 붙인다. */
.card.kpi { --kpi-px: 20px; display: flex; flex-direction: column; padding-left: var(--kpi-px) !important; padding-right: var(--kpi-px) !important; padding-bottom: 0 !important; }
.card.kpi .kpi-body { flex: 1 1 auto; align-items: flex-start; }   /* 옆 카드가 키가 커져도 숫자는 같은 높이에 */
.card.kpi .kpi-foot { margin-left: calc(-1 * var(--kpi-px)); margin-right: calc(-1 * var(--kpi-px)); padding-left: var(--kpi-px); padding-right: var(--kpi-px); }
@media (max-width: 760px) { .card.kpi { --kpi-px: 14px; } }   /* 카드 좌우 여백과 띠의 음수 여백을 같은 변수로 묶어 어느 폭에서도 맞게 */
@media (max-width: 700px) { #dashBody .card.kpi, .project-overview-kpis .card.kpi { --kpi-px: 12px; } }
/* 숫자에 준 음수 자간(em)이 큰 글씨 기준 길이로 계산돼 작은 단위 글씨까지 물려받아 '건진행중'처럼 띄어쓰기가 사라졌다 */
.kpi-value small { letter-spacing: normal; }
/* 하단 띠 안의 배지가 줄바꿈될 때 위아래가 붙지 않게 */
.kpi-foot { row-gap: 6px; }
.kpi-foot .delta { letter-spacing: 0; white-space: nowrap; }

/* ---- 칸반 터치 끌기 (web/kanban-touch.js) ---- */
.kcard-ghost { position: fixed; z-index: 1000; margin: 0; pointer-events: none; opacity: .95; box-shadow: 0 12px 28px rgba(0,0,0,.28); transition: none; will-change: transform; }
.kcard.touch-dragging { opacity: .35; outline: 2px dashed var(--accent); outline-offset: -2px; }
.kanban-touch-dragging, .kanban-touch-dragging * { user-select: none; -webkit-user-select: none; }
@media (pointer: coarse) {
  .kanban .kcard { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
}
/* KPI 하단 문구는 한 줄 고정(넘치면 말줄임) — 배지가 줄바꿈되며 카드 높이가 제각각이던 문제. 지연은 배지 대신 같은 줄 빨간 글자 */
.card.kpi .kpi-foot { flex-wrap: nowrap; }
.card.kpi .kpi-foot > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.kpi .kpi-foot > :not(:first-child) { flex: none; }
.kpi-late { font-weight: 600; color: var(--red); }

/* ---- 툴팁 가독성 (차트 막대 등) ----
   한 줄 문장을 좁은 상자에 억지로 줄바꿈하던 것을 '제목 + 색 점·이름·값' 표로. 화면 끝에서 잘리지 않게 위치는 app.js 가 보정 */
.tooltip { max-width: min(280px, calc(100vw - 16px)); padding: 10px 12px; font-size: 12.5px; line-height: 1.45; }
.tooltip.plain { max-width: min(260px, calc(100vw - 16px)); white-space: normal; word-break: keep-all; overflow-wrap: anywhere; padding: 7px 10px; }
.tooltip .tt-title { font-family: inherit; font-size: 12.5px; font-weight: 600; opacity: 1; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); white-space: nowrap; }
.tooltip .tt-row { gap: 8px; padding: 3px 0; font-size: 12.5px; }
.tooltip .tt-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tooltip .tt-row span { opacity: .85; }
.tooltip .tt-row b { font-family: inherit; font-variant-numeric: tabular-nums; padding-left: 16px; }
.tooltip.below { transform: translate(-50%, 10px) scale(.96); }
.tooltip.below.show { transform: translate(-50%, 10px); }
/* 툴팁 값이 길 때(프로젝트 이름·참석자) 상자를 넘지 않고 오른쪽 정렬로 줄바꿈 */
.tooltip .tt-row { white-space: normal; align-items: flex-start; }
.tooltip .tt-row span { flex: none; }
.tooltip .tt-row b { text-align: right; min-width: 0; word-break: keep-all; overflow-wrap: break-word; }
.tooltip .tt-row i { margin-top: 5px; }
/* 아이폰에서 '6/7/건'처럼 한 글자씩 쪼개지던 문제: 모바일 규칙(min-width:0)과 위치 계산 때문에 상자가
   글자 하나 폭으로 줄어들었다. 내용만큼 넓게(max-content) 잡고 화면 폭에서만 멈춘다. 숫자·단위는 붙여 둔다 */
.tooltip { width: max-content !important; }
.tooltip:not(.plain) { min-width: 120px !important; }
.tooltip .tt-title { white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }   /* 띄어쓰기 없는 긴 제목은 넘칠 때만 끊는다 */
@media (hover: none) { .progress-row, [data-ev][data-tip] { -webkit-tap-highlight-color: transparent; } .progress-row.tip-on { background: var(--bg-sunken); border-radius: 8px; } li[data-ev].tip-on { outline: 2px solid var(--c, var(--accent)); outline-offset: -2px; } }

/* ===== 작업 보드 모바일 사용성 (2026-10-16) ===== */
/* PC: 필터는 지금처럼 툴바에 한 줄로 (묶음 상자는 투명), 접기 버튼·정렬 메뉴·칸반 칩·+ 버튼은 숨김 */
.task-filters { display: contents; }
.task-filter-btn, .task-fab, .kanban-jump { display: none; }
.task-toolbar .task-sort-select { display: none; }
/* 작업 폼: 하나의 격자 — PC 3열 */
.tf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tf-grid > label { min-width: 0; }
.tf-labels { grid-column: span 2; }

@media (max-width: 640px) {
  /* 머리말 설명 숨김 */
  .page-title-row:has(+ #tbHost) .page-sub { display: none; }
  /* 툴바: [검색][필터][보기] 한 줄 → (펼치면) 필터 묶음 → 건수 */
  .toolbar.task-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
  .task-toolbar .search { grid-column: 1; grid-row: 1; width: auto; min-width: 0; margin: 0; }
  .task-toolbar .task-filter-btn { display: inline-flex; grid-column: 2; grid-row: 1; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; }
  .task-toolbar .task-filter-btn svg { width: 16px; height: 16px; }
  .task-toolbar .task-filter-btn b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; display: inline-grid; place-items: center; }
  .task-toolbar .task-view { grid-column: 3; grid-row: 1; width: auto !important; }
  .task-toolbar .task-view button { min-height: 40px; padding: 0 10px; flex: none; }
  .task-toolbar .task-filters { display: none; grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-sunken); }
  .task-toolbar.filters-open .task-filters { display: grid; }
  .task-toolbar .task-filters .select { width: 100%; max-width: none; min-height: 44px; height: 44px; font-size: 16px; }
  .task-toolbar .task-sort-select { display: block; grid-column: 1 / -1; }
  .task-toolbar .task-count { grid-column: 1 / -1; grid-row: 3; }
  .task-toolbar #newTask { display: none; }
  /* + 버튼 */
  .task-fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); box-shadow: 0 8px 22px rgba(0,0,0,.32); cursor: pointer; }
  .task-fab svg { width: 24px; height: 24px; }
  /* 칸반: 한 화면에 한 열, 위 칩으로 열 이동 */
  .kanban-jump { display: flex; gap: 6px; margin: 0 0 10px; overflow-x: auto; scrollbar-width: none; }
  .kanban-jump::-webkit-scrollbar { display: none; }
  .kanban-jump button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
  .kanban-jump button b { font-size: 11px; font-weight: 600; color: var(--text-3); }
  .kanban-jump button.active { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
  .kanban-jump button.active b { color: inherit; opacity: .75; }
  #tb .board-scroll-hint { display: none; }
  #tb .kanban { grid-template-columns: repeat(5, calc(100% - 28px)); gap: 10px; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
  #tb .kcol { min-width: 0; padding: 10px; scroll-snap-align: start; }
  #tb .kcol-head { display: none; }   /* 위 칩이 상태·건수를 보여준다 */
  #tb .kcard { padding: 11px 12px; }
  #tb .kcard .kcard-title { margin: 4px 0 6px; }
  /* 작업 폼: 전체 화면 시트, 짧은 항목은 두 개씩 */
  .modal-wrap:has(.sheet-m) { padding: 0; place-items: stretch; }
  .modal.sheet-m { width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; display: flex; flex-direction: column; }
  .modal.sheet-m .modal-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
  .modal.sheet-m .modal-foot { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .modal.sheet-m .input, .modal.sheet-m .select, .modal.sheet-m .textarea { min-height: 44px; font-size: 16px; }
  .tf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tf-project, .tf-labels { grid-column: 1 / -1; }
  .tf-project { order: 1; } .tf-assignee { order: 2; } .tf-status { order: 3; } .tf-priority { order: 4; } .tf-due { order: 5; } .tf-start { order: 6; } .tf-est { order: 7; } .tf-labels { order: 8; }
}
/* 끄는 중 상태 칩 위에 올리면 강조 — 놓으면 그 상태로 */
.kanban-touch-dragging .kanban-jump button { border-style: dashed; }
.kanban-jump button.drop { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; transform: scale(1.06); }

/* ===== 터치 기기 툴팁·호버 점검 (2026-10-16) ===== */
@media (hover: none) {
  /* 댓글 수정·삭제 버튼이 마우스를 올려야만 보였다 → 터치에선 항상 보이게 */
  .comment-meta .acts { opacity: 1; }
  /* 인프라 상태 점(9px)·서비스 점(7px)은 손가락으로 누를 수 없었다 → 눌리는 영역을 넓힌다 */
  .svc-status { position: relative; }
  .svc-status::after { content: ''; position: absolute; inset: -14px; }
  .ib-dots { gap: 5px; }
  .ib-dots .d { width: 12px; height: 12px; border-radius: 3px; }
  /* 탭으로 툴팁을 띄운 아바타·점 표시 */
  .avatar-sm.tip-on, .member-stack.tip-on, .ib-dots .d.tip-on { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 999px; }
  .ib-dots .d.tip-on { border-radius: 3px; }
}

/* 키보드 포커스·PC 에서도 넘치지 않게 — 긴 평문 툴팁 */
.tooltip.plain { overflow-wrap: anywhere; }
/* 노트 고정 버튼 상태가 보이게 */
.icon-btn[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
/* 댓글 버튼: 키보드로 들어가도 보이게 */
.comment:focus-within .comment-meta .acts { opacity: 1; }
/* 막대 차트: 막대 사이 틈도 그 막대의 영역으로(마우스·손가락 모두 잡기 쉽게) */
.bar-chart { gap: 0 !important; }
.bar-chart .bc { padding: 0 3px; }
@media (hover: none) {
  .bar-chart { touch-action: pan-y; }   /* 좌우로 훑는 동작은 차트가, 위아래는 페이지 스크롤이 */
  .bar-chart .bc.tip-on .bars { filter: brightness(1.25); }
  /* 실시간 연결 점(8px) — 누를 수 있는 영역 넓히기 */
  .live-dot { position: relative; }
  .live-dot::after { content: ''; position: absolute; inset: -14px; }
  /* 피드 '3시간 전' — 누르면 정확한 시각 */
  .feed .ftime { padding-block: 8px; margin-block: -8px; }
  /* 태블릿 월 달력 일정 막대 — 손가락 높이 */
  @media (min-width: 641px) { .cal-ev { padding-top: 5px; padding-bottom: 5px; } }
  /* 아이콘 버튼 첫 탭(이름 표시) 강조 */
  .icon-btn.tip-on { outline: 2px solid var(--accent); outline-offset: 1px; }
}

/* ===== 대시보드 카드 배치 (2026-10-16) =====
   카드는 두 묶음(.dash-col-a: 내 작업·최근 활동 / .dash-col-b: 일정·활동량·진행률)에 들어 있고, 641px 이상에선
   두 묶음을 왼쪽·오른쪽 열로 각자 위에서부터 쌓는다. 최근 활동이 '남는 높이를 채우는 칸'이라 두 열 바닥이 맞는다.
   - 1281px 이상: 오른쪽 열 = [다가오는 일정] 아래 [활동량 | 진행률] (활동량은 진행률 높이를 따라감)
   - 641~1280px: 오른쪽 열 = 일정 → 활동량 → 진행률 세로로
   - 640px 이하: 한 줄, 원래 순서(내 작업 → 일정 → 최근 활동 → 활동량 → 진행률) */
#dashBody .dash-col { display: contents; }
@media (max-width: 640px) {
  #dashBody .dash-mytasks { order: 1; } #dashBody .dash-upcoming { order: 2; } #dashBody .dash-feed { order: 3; } #dashBody .dash-activity { order: 4; } #dashBody .dash-progress { order: 5; }
  #dashFeed > li:nth-child(n+13) { display: none; }   /* 모바일은 예전처럼 12개만 */
}
@media (min-width: 641px) {
  #dashBody .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  #dashBody .dash-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
  #dashBody .dash-col > .card { margin: 0; min-width: 0; }
  #dashBody .dash-col-a > .dash-feed { flex: 1 1 0; }
  /* 최근 활동: 자기 내용으로 높이를 키우지 않고(contain:size) 넘치면 안에서 스크롤. 서버는 40개를 보낸다 */
  #dashBody .dash-feed { contain: size; min-height: 420px; display: flex; flex-direction: column; }
  #dashBody .dash-feed > .card-head { flex: none; }
  #dashBody .dash-feed .feed { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 8px; }
  #dashBody .dash-feed .feed li { align-items: center; }
  #dashBody .dash-feed .feed .fav { margin-top: 0; }
  #dashBody .dash-feed .feed .ftext { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* 전체 문장은 마우스를 올리면 */
  #dashBody .dash-feed .feed .ftime { flex: none; white-space: nowrap; }
  /* 내 작업이 비었을 때 안내 문구 */
  #dashBody .dash-mytasks > .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; }
}
@media (min-width: 641px) and (max-width: 700px) { #dashBody .dash-col { gap: 14px; } }
@media (min-width: 1281px) {
  #dashBody .dash-col-b { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 1fr; grid-template-areas: "up up" "act prog"; gap: 20px; }
  #dashBody .dash-upcoming { grid-area: up; } #dashBody .dash-activity { grid-area: act; } #dashBody .dash-progress { grid-area: prog; }
  /* 활동량은 진행률 높이를 따라간다(마감 임박이 비어도 휑하지 않게, 많으면 스크롤) */
  #dashBody .dash-activity { contain: size; min-height: 300px; overflow-y: auto; scrollbar-width: thin; }
  #dashBody .dash-activity { display: flex; flex-direction: column; }
  #dashBody .dash-activity > * { flex-shrink: 0; }   /* 높이가 줄어도 막대 차트가 납작해지지 않게 */
  #dashBody .dash-activity > .bar-chart { flex-grow: 1; min-height: 120px; }   /* 마감 임박이 짧으면 남는 높이만큼 차트가 커진다 */
  #dashBody .dash-progress .co { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #dashBody .dash-progress .row.between { gap: 8px; }
  #dashBody .dash-progress .row.between .small { flex: none; }
  /* 좁은 카드 머리: 제목은 한 줄, 범례는 자리가 모자라면 아래 줄로 */
  #dashBody .dash-activity > .card-head:first-child, #dashBody .dash-progress > .card-head { flex-wrap: wrap; row-gap: 6px; }
  #dashBody .dash-activity .card-title, #dashBody .dash-progress .card-title { white-space: nowrap; }
  #dashBody .act-legend { flex-wrap: wrap; row-gap: 4px; white-space: nowrap; }
  /* 좁은 활동량 카드에서 날짜 라벨 14개가 카드 밖으로 밀리지 않게 */
  #dashBody .dash-activity .bar-chart { padding: 0; }
  #dashBody .dash-activity .bar-chart .bc { min-width: 0; padding: 0 1px; }
  #dashBody .dash-activity .bar-chart .bc > span { font-size: 10px; letter-spacing: -.02em; }
}

/* 푸시 알림 켜기 실패 안내(브라우저별 해결 방법) */
.push-hint { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--orange) 12%, transparent); color: var(--text); line-height: 1.6; }
