/* ---------------------------------------------------------------- 업무/일정 행 */
.item {
  display: grid; grid-template-columns: var(--touch) minmax(0, 1fr) auto;
  align-items: center; gap: 0; padding: 7px 0 7px 0;
  border-bottom: 1px solid var(--line-2);
}
.item:last-child { border-bottom: 0; padding-bottom: 2px; }
.item:first-child { padding-top: 2px; }
.item-body { min-width: 0; padding-right: 8px; }
.item-title { font-size: var(--fs-body); word-break: break-word; line-height: 1.45; }
.item.done .item-title { text-decoration: line-through; color: var(--ink-3); }
/* 보조 정보는 한 줄, 가운뎃점 구분. 배지는 꼭 필요한 것만. */
.item-meta {
  font-size: var(--fs-meta); color: var(--ink-3); display: flex; flex-wrap: wrap;
  gap: 0 6px; align-items: center; margin-top: 1px;
}
.item-meta .sep { color: var(--gray); }
.item-actions { display: flex; gap: 2px; align-items: center; }
.item-open {
  background: transparent; border: 0; color: var(--ink-3); min-height: var(--touch); min-width: var(--touch); padding: 0;
  border-radius: var(--r-sm);
}
.item-open:hover { background: var(--surface-2); color: var(--ink); }
.item.problem { box-shadow: inset 2px 0 0 var(--alert); padding-left: 10px; }

/* 소제목 (지연 / 오늘 처리 / 미배정) */
.group-head {
  display: flex; align-items: baseline; gap: 6px; margin: 14px 0 2px;
  font-size: var(--fs-meta); color: var(--ink-3); font-weight: var(--w-medium);
}
.group-head:first-child { margin-top: 4px; }
.group-head .n { font-variant-numeric: tabular-nums; }
.group-head.alert-text { color: var(--alert); }

/* ---------------------------------------------------------------- 타임라인 */
.timeline { display: flex; flex-direction: column; gap: 2px; }
.tl-row { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.tl-time {
  font-size: var(--fs-meta); color: var(--ink-3); padding-top: 10px;
  font-variant-numeric: tabular-nums; text-align: right;
}
.tl-block {
  background: var(--surface-2); border-radius: var(--r-md); padding: 7px 11px; min-height: var(--touch);
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  text-align: left; align-items: flex-start; border: 0; width: 100%;
  box-shadow: inset 2px 0 0 var(--gray);
}
.tl-block:hover { background: var(--mauve-soft); }
.tl-block b { font-weight: var(--w-medium); }
.tl-block.event { box-shadow: inset 2px 0 0 var(--pink); }
.tl-block.alert { background: var(--alert-bg); box-shadow: inset 2px 0 0 var(--alert); }
.tl-gap {
  grid-column: 2; font-size: 11.5px; color: var(--ink-3); padding: 2px 0 2px 12px;
}
.tl-now { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--mauve); font-size: 11.5px; font-weight: var(--w-semibold); margin: 2px 0; }
.tl-now::after { content: ''; flex: 1; height: 1px; background: var(--pink); }

/* ---------------------------------------------------------------- 미터 */
.meter { height: 6px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--mauve); border-radius: var(--r-pill); }
.meter.over > i { background: var(--alert); }

/* ---------------------------------------------------------------- 리스크 */
.risk { border-radius: var(--r-md); padding: 11px 13px; background: var(--surface-2); }
.risk + .risk { margin-top: 6px; }
.risk.high { background: var(--alert-bg); box-shadow: inset 2px 0 0 var(--alert); }
.risk.medium { box-shadow: inset 2px 0 0 var(--mauve); }
.risk.low { box-shadow: inset 2px 0 0 var(--gray); }
.risk-problem { font-weight: var(--w-medium); }
.risk.high .risk-problem { color: var(--alert); font-weight: var(--w-semibold); }
.risk-detail {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 3px 10px;
  margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line-2); font-size: var(--fs-meta);
}
.risk-detail dt { color: var(--ink-3); }
.risk-detail dd { margin: 0; color: var(--ink-2); }
.risk-compact > summary { list-style: none; min-height: 34px; display: flex; align-items: center; gap: 8px; }
.risk-compact > summary::-webkit-details-marker { display: none; }
.risk-compact > summary .row-tight { flex: 1; min-width: 0; }
.risk-compact > summary::after {
  content: '자세히'; font-size: 11.5px; color: var(--ink-3); white-space: nowrap;
}
.risk-compact[open] > summary::after { content: '접기'; }

/* ---------------------------------------------------------------- 채팅 */
.chat-log { display: flex; flex-direction: column; gap: 12px; max-height: 44dvh; overflow-y: auto; padding-right: 2px; }
.msg { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.msg.user { align-items: flex-end; }
.msg-role { font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }
.msg-text {
  white-space: pre-wrap; word-break: break-word; background: var(--surface-2);
  border-radius: 14px; padding: 10px 13px; max-width: 86%;
}
.msg.user .msg-text { background: var(--mauve); color: #fff; border-bottom-right-radius: 5px; }
.msg:not(.user) .msg-text { border-bottom-left-radius: 5px; }
.msg.error .msg-text { background: var(--alert-bg); box-shadow: inset 2px 0 0 var(--alert); color: var(--ink); }
.msg-foot { font-size: 11.5px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; }
.proposal { border-radius: var(--r-md); padding: 11px 13px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); max-width: 86%; }
.proposal + .proposal { margin-top: 6px; }
.spinner {
  width: 13px; height: 13px; border: 2px solid var(--line); border-top-color: var(--mauve);
  border-radius: 50%; display: inline-block; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* ---------------------------------------------------------------- 표 */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table thead th { font-size: 11.5px; color: var(--ink-3); font-weight: var(--w-medium); letter-spacing: 0.03em; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 캘린더 */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: 11.5px; color: var(--ink-3); text-align: center; padding: 2px 0 4px; }
.cal-cell {
  min-height: 72px; background: var(--surface-2); border: 0; border-radius: var(--r-md);
  padding: 6px; display: flex; flex-direction: column; gap: 2px; text-align: left; align-items: stretch;
}
.cal-cell:hover { background: var(--mauve-soft); }
.cal-cell.other { opacity: 0.4; }
.cal-cell.today { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--mauve); }
.cal-cell[aria-pressed='true'] { background: var(--beige); }
.cal-date { font-size: 11.5px; font-weight: var(--w-semibold); color: var(--ink-2); }
.cal-cell.today .cal-date { color: var(--mauve); }
.cal-pill {
  font-size: 10.5px; line-height: 1.4; background: var(--card); border-radius: 5px; padding: 1px 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2);
}
.cal-pill.event { background: var(--pink); color: var(--ink); }
.cal-pill.alert { background: var(--alert-bg); color: var(--alert); font-weight: var(--w-semibold); }

/* ---------------------------------------------------------------- 인터뷰 */
.stage-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.stage-chip { font-size: 11.5px; padding: 3px 9px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-3); }
.stage-chip.done { background: var(--beige); color: var(--ink-2); }
.stage-chip.current { background: var(--mauve); color: #fff; font-weight: var(--w-semibold); }
.qa { border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 10px; }
.qa dt { font-size: 11.5px; color: var(--mauve); font-weight: var(--w-semibold); letter-spacing: 0.03em; }
.qa dd { margin: 3px 0 0; white-space: pre-wrap; color: var(--ink-2); }

/* ---------------------------------------------------------------- 승인센터 */
.approval { border-radius: var(--r-md); padding: 13px; background: var(--surface-2); }
.approval + .approval { margin-top: 8px; }
.diff {
  font-size: var(--fs-meta); display: grid; grid-template-columns: auto 1fr; gap: 3px 10px;
  margin: 9px 0; padding: 9px 11px; background: var(--card); border-radius: var(--r-sm);
}
.diff .before { color: var(--ink-3); text-decoration: line-through; }
.diff .after { font-weight: var(--w-semibold); }

/* ---------------------------------------------------------------- 상세 토글 */
details.plain > summary { list-style: none; font-size: var(--fs-meta); color: var(--ink-2); padding: 7px 0; }
details.plain > summary::-webkit-details-marker { display: none; }
details.plain > summary::before { content: '› '; color: var(--ink-3); display: inline-block; transition: transform 0.15s; }
details.plain[open] > summary::before { content: '⌄ '; }

/* ---------------------------------------------------------------- 리스크 배너 (Today) */
.risk-banner { padding: 14px 16px; }
.banner-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.banner-row .meta { flex: 1; min-width: 0; }
.banner-list { margin-top: 4px; }
.risk.risk-flat { background: transparent; box-shadow: none; padding: 5px 0; }
.risk-flat + .risk-flat { margin-top: 0; border-top: 1px solid var(--line-2); }
.risk.risk-flat .risk-problem { color: var(--ink); font-weight: var(--w-regular); }
.risk.risk-flat.high .risk-problem { color: var(--alert); font-weight: var(--w-semibold); }
.risk-flat .risk-detail { border-top: 0; padding-top: 4px; }

