/* 회의록 할 일 추적 (접두어 .mt-) — 라이트/다크는 styles.css의 CSS 변수를 따른다 */

:root {
  --mt-red-fg: #b3243a;   --mt-red-bg: rgba(224, 73, 94, .12);   --mt-red-bd: rgba(224, 73, 94, .45);
  --mt-amber-fg: #8a5a00; --mt-amber-bg: rgba(240, 180, 41, .2); --mt-amber-bd: rgba(240, 180, 41, .6);
  --mt-green-fg: #1f7a54; --mt-green-bg: rgba(16, 185, 129, .12); --mt-green-bd: rgba(16, 185, 129, .45);
  --mt-link: var(--rose-dark);
  --mt-ai-bg: rgba(199, 104, 126, .09);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mt-red-fg: #ff8d9c;   --mt-amber-fg: #f5c451; --mt-green-fg: #5fd6a3;
    --mt-link: var(--accent);
    --mt-ai-bg: rgba(199, 104, 126, .16);
  }
}
:root[data-theme="dark"] {
  --mt-red-fg: #ff8d9c;   --mt-amber-fg: #f5c451; --mt-green-fg: #5fd6a3;
  --mt-link: var(--accent);
  --mt-ai-bg: rgba(199, 104, 126, .16);
}

/* ── 목록 화면: 진행 중인 할 일 패널 ───────────────────────────── */
#mt-panel { margin-bottom: 18px; }
.mt-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.mt-panel > summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-height: 48px; padding: 8px 16px; cursor: pointer; list-style: none;
  color: var(--text); border-radius: var(--radius);
}
.mt-panel > summary::-webkit-details-marker { display: none; }
.mt-panel > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mt-panel-title { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mt-panel-sub { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.mt-panel-chev { margin-left: auto; color: var(--text-muted); transition: transform .15s; }
.mt-panel:not([open]) .mt-panel-chev { transform: rotate(-90deg); }
.mt-panel-body { border-top: 1px solid var(--border); padding: 8px 12px 12px; }
.mt-panel-tools { display: flex; gap: 8px; margin: 2px 0 4px; }

.mt-pill {
  min-height: 40px; padding: 6px 16px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.mt-pill:hover { border-color: var(--rose); }
.mt-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-pill[aria-pressed="true"] { background: var(--rose-dark); border-color: var(--rose-dark); color: #fff; font-weight: 600; }

.mt-more {
  display: block; width: 100%; min-height: 40px; margin-top: 6px;
  border: 0; border-radius: 8px; background: transparent; color: var(--mt-link);
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.mt-more:hover { background: var(--bg-hover); }
.mt-more:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mt-empty { margin: 10px 4px; font-size: 13px; color: var(--text-muted); }
.mt-empty-err { color: var(--mt-red-fg); }

/* ── 할 일 한 줄 (패널·상세 공용) ─────────────────────────────── */
.mt-list { list-style: none; margin: 0; padding: 0; }
.mt-item {
  display: flex; align-items: flex-start; gap: 2px;
  border-bottom: 1px solid var(--border);
}
.mt-item:last-child { border-bottom: 0; }
.mt-check {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; cursor: pointer;
}
.mt-cb { width: 20px; height: 20px; margin: 0; cursor: pointer; accent-color: var(--rose-dark); }
.mt-cb:disabled { cursor: progress; opacity: .6; }
.mt-cb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-item-body { flex: 1; min-width: 0; padding: 9px 4px 9px 0; }
.mt-item-content { font-size: 14px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.mt-item-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px;
  margin-top: 3px; font-size: 12px; color: var(--text-muted);
}
.mt-assignee { white-space: nowrap; }
.mt-unassigned { opacity: .8; }
.mt-due-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt-due {
  display: inline-block; padding: 1px 8px; border-radius: 10px; white-space: nowrap;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--bg-hover); color: var(--text-muted); border: 1px solid var(--border);
}
.mt-due-over { background: var(--mt-red-bg);   color: var(--mt-red-fg);   border-color: var(--mt-red-bd); }
.mt-due-soon { background: var(--mt-amber-bg); color: var(--mt-amber-fg); border-color: var(--mt-amber-bd); }
.mt-doneinfo { color: var(--mt-green-fg); font-weight: 600; white-space: nowrap; }

.mt-item-done .mt-item-content { color: var(--text-muted); text-decoration: line-through; }
.mt-item-done .mt-assignee, .mt-item-done .mt-due-date { opacity: .75; }

.mt-meeting-link {
  display: inline-flex; align-items: center; min-height: 32px; max-width: 100%;
  padding: 0 4px; margin: -4px 0 -4px -4px; border: 0; border-radius: 6px; background: none;
  font: inherit; font-size: 12px; color: var(--mt-link); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mt-meeting-link:hover { background: var(--bg-hover); }
.mt-meeting-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── 목록 행의 "할 일 2/5" 칩 ────────────────────────────────── */
.mt-chip {
  flex-shrink: 0; display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--bg-hover); color: var(--text-muted); border: 1px solid var(--border);
}
.mt-chip-over { background: var(--mt-red-bg);   color: var(--mt-red-fg);   border-color: var(--mt-red-bd); }
.mt-chip-done { background: var(--mt-green-bg); color: var(--mt-green-fg); border-color: var(--mt-green-bd); }

/* ── 회의록 상세 보기 안의 할 일 ─────────────────────────────── */
.mt-detail {
  margin-top: 16px; padding: 8px 14px 6px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.mt-detail[hidden] { display: none; }
.mt-detail-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 0 2px; font-size: 14px; font-weight: 700; color: var(--text);
}
.mt-detail-count { font-size: 12px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ── 작성/수정 폼 ─────────────────────────────────────────── */
.mt-form { gap: 6px; }
.mt-form-hint { margin: 0 0 2px; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.mt-rows { display: flex; flex-direction: column; gap: 8px; }
.mt-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 6px;
  padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
}
.mt-row .mt-in-content { grid-column: 1 / -1; }
.mt-row input[type="text"] { min-height: 40px; }
.mt-row-err { border-color: var(--red); box-shadow: 0 0 0 2px var(--mt-red-bg); }
.mt-row-ai { background: var(--mt-ai-bg); border-left: 3px solid var(--accent); }
.mt-row-done { background: var(--surface-2); }
.mt-row-done .mt-in-content { color: var(--text-muted); text-decoration: line-through; }
.mt-row-tag {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; line-height: 1.4;
}
.mt-row-aitag { color: var(--text); }
.mt-row-donetag { color: var(--mt-green-fg); font-weight: 600; }
.mt-ai-ok {
  flex-shrink: 0; min-height: 32px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 12px; cursor: pointer;
}
.mt-ai-ok:hover { border-color: var(--rose); }

.mt-form label.mt-date {
  display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 40px; padding: 0 8px 0 11px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: none; letter-spacing: 0;
}
.mt-form label.mt-date:focus-within { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(232, 160, 168, .15); }
.mt-form label.mt-date input {
  flex: 1; align-self: stretch; min-width: 0; width: auto; padding: 0; border: 0; background: transparent;
  box-shadow: none; font-size: 13px; color: var(--text);
}
.mt-form label.mt-date input:focus { box-shadow: none; }
.mt-remove {
  width: 40px; min-height: 40px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--text-muted); font-size: 15px; line-height: 1; cursor: pointer;
}
.mt-remove:hover { color: var(--red); border-color: var(--red); }
.mt-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mt-rows:empty::before { content: '등록된 할 일이 없습니다.'; font-size: 13px; color: var(--text-muted); padding: 4px 2px; }

.mt-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.mt-form-actions .btn-secondary { min-height: 40px; padding: 6px 14px; font-size: 13px; }
.mt-form-actions .btn-secondary:disabled { opacity: .55; cursor: default; }

@media (max-width: 420px) {
  .mt-row { grid-template-columns: minmax(0, 1fr) 40px; }
  .mt-row .mt-in-assignee { grid-column: 1 / -1; }
  .mt-row .mt-date { grid-column: 1; }
  .mt-panel-body { padding: 6px 6px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .mt-panel-chev { transition: none; }
}
