/* ✅ 할 일 A안 (2026-11-29) — D안 토큰만 이 화면 안에서 쓴다(바탕 #F6F7F9 · 강조 #2563EB · 경고 #C2410C). 관리자만(todo-a.js) */
#global-todo.ta-on > :not(#todoA):not(#todoMsgrNotice) { display: none !important; }
#global-todo:not(.ta-on) > #todoA { display: none; }
#todoA {
  --ta-bg: #F6F7F9; --ta-surface: #fff; --ta-text: #14161B; --ta-sub: #6B7280; --ta-line: #E5E7EB;
  --ta-soft: #F0F1F4; --ta-accent: #2563EB; --ta-accent-soft: #EEF3FF; --ta-warn: #C2410C;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; color: var(--ta-text);
  background: var(--ta-bg); border-radius: 12px; min-height: 70vh; font-variant-numeric: tabular-nums;
}
#todoA.has-detail { grid-template-columns: minmax(0, 1fr) 400px; }
#todoA button, #todoA input, #todoA select, #todoA textarea { font-family: inherit; }
#todoA input, #todoA select, #todoA textarea { color: var(--ta-text); }
.ta-main { padding: 24px 28px 40px; min-width: 0; }
.ta-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ta-h1 { font-size: calc(var(--fs-title) * 1.375); font-weight: 750; letter-spacing: -.01em; margin: 0; }
.ta-plus { display: none; }
.ta-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ta-chiprow { display: flex; gap: 8px; }
.ta-cchip { border: 1px solid var(--ta-line); background: #fff; border-radius: 999px; padding: 6px 13px; font-size: var(--fs-base); font-weight: 600; color: #374151; white-space: nowrap; cursor: pointer; min-height: 34px; }
.ta-cchip b { font-weight: 700; margin-left: 5px; }
.ta-cchip.is-on { background: var(--ta-text); border-color: var(--ta-text); color: #fff; }
.ta-barr { display: flex; align-items: center; gap: 16px; font-size: var(--fs-base); color: var(--ta-sub); }
.ta-tg, .ta-groupby { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #374151; cursor: pointer; }
.ta-gsel { border: 1px solid var(--ta-line); border-radius: 8px; padding: 5px 8px; background: #fff; font-weight: 600; }
.ta-sw { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: #D1D5DB; position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.ta-sw::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.ta-sw:checked { background: var(--ta-accent); }
.ta-sw:checked::after { left: 16px; }
.ta-sw:focus-visible { outline: 2px solid var(--ta-accent); outline-offset: 2px; }

/* 빠른 입력 */
.ta-dim { display: none; }
.ta-qa { background: #fff; border: 1px solid var(--ta-line); border-radius: 10px; padding: 0 14px; }
.ta-qa:focus-within { border-color: var(--ta-accent); box-shadow: 0 0 0 3px #DBE6FE; }
.ta-qain { display: flex; align-items: center; gap: 10px; height: 46px; }
.ta-qaplus { color: var(--ta-accent); font-size: calc(var(--fs-title) * 1.125); font-weight: 600; width: 18px; text-align: center; }
.ta-qainput { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: var(--fs-base); }
#todoA .ta-qainput:focus, #todoA .ta-qainput:focus-visible { outline: 0; box-shadow: none; border: 0; }
.ta-send { display: none; }
.ta-parsed { display: none; align-items: center; gap: 6px; border-top: 1px solid var(--ta-soft); min-height: 36px; font-size: var(--fs-meta); flex-wrap: wrap; padding: 4px 0; }
.ta-qa:focus-within .ta-parsed { display: flex; }
.ta-tok { display: inline-flex; align-items: center; background: var(--ta-soft); border-radius: 6px; padding: 3px 8px; color: #374151; font-weight: 600; }
.ta-tok.is-hit { background: var(--ta-accent-soft); color: var(--ta-accent); }
.ta-tok.is-miss { color: var(--ta-warn); background: #FFF4ED; }
.ta-hint { margin-left: auto; color: var(--ta-sub); }

/* 목록 */
.ta-list { margin-top: 18px; }
.ta-gh { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: var(--fs-base); font-weight: 700; }
.ta-gc { color: var(--ta-sub); font-weight: 600; }
.ta-gh.is-warn { color: var(--ta-warn); }
.ta-gh.is-new { color: var(--ta-accent); }
.ta-gh .ta-mini { margin-left: auto; margin-bottom: 8px; }
.ta-shared { font-size: var(--fs-meta); color: var(--ta-sub); margin: -4px 0 10px; }
.ta-row.is-sel .ta-pill { background: #fff; }
.ta-mini { border: 1px solid var(--ta-line); background: #fff; border-radius: 8px; padding: 5px 10px; font-size: var(--fs-meta); font-weight: 600; color: #374151; cursor: pointer; }
.ta-panel { background: #fff; border: 1px solid var(--ta-line); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.ta-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 14px; border-top: 1px solid var(--ta-soft); cursor: pointer; outline: none; }
.ta-row:first-child { border-top: 0; }
.ta-row:hover { background: #FAFBFC; }
.ta-row:focus-visible { box-shadow: inset 0 0 0 2px var(--ta-accent); }
.ta-row.is-sel { background: var(--ta-accent-soft); }
.ta-newdot { position: absolute; left: 5px; top: 50%; margin-top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--ta-accent); }
.ta-ck { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #C4C9D2; background: #fff; flex: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-meta); color: #fff; padding: 0; position: relative; }
.ta-ck::before { content: ''; position: absolute; inset: -10px; }
.ta-ck:hover { border-color: var(--ta-accent); }
.ta-ck.is-on { background: var(--ta-accent); border-color: var(--ta-accent); }
.ta-rb { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.ta-t { font-size: var(--fs-base); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ta-row.is-done .ta-t { color: var(--ta-sub); text-decoration: line-through; font-weight: 500; }
.ta-meta { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: var(--fs-meta); color: var(--ta-sub); white-space: nowrap; flex: none; }
.ta-row-fields { display: contents; }
.ta-pj { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.ta-due.is-warn { color: var(--ta-warn); font-weight: 600; }
.ta-pill { font-size: var(--fs-meta); font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--ta-soft); color: #374151; }
.ta-pill.is-doing { background: var(--ta-accent-soft); color: var(--ta-accent); }
.ta-flag { color: var(--ta-warn); font-weight: 700; font-size: var(--fs-meta); }
.ta-by { color: var(--ta-accent); font-weight: 600; }
.ta-avs { display: inline-flex; gap: 2px; align-items: center; }
.ta-av { width: 22px; height: 22px; border-radius: 50%; background: #E0E7FF; color: #3730A3; font-size: var(--fs-meta); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ta-empty { padding: 28px 0; text-align: center; color: var(--ta-sub); font-size: var(--fs-base); }
.ta-foldwrap { margin-bottom: 10px; }
.ta-fold { width: 100%; display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--ta-line); border-radius: 10px; min-height: 42px; padding: 0 14px; font-weight: 600; font-size: var(--fs-base); cursor: pointer; text-align: left; }
.ta-foldr { color: var(--ta-sub); font-weight: 500; font-size: var(--fs-meta); }
.ta-foldr .ta-gc { margin-right: 10px; }
.ta-foldwrap .ta-panel { margin-top: 6px; }

/* 팀 전체 판 */
.ta-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#todoA.has-detail .ta-people { grid-template-columns: minmax(0, 1fr); }
.ta-pp { background: #fff; border: 1px solid var(--ta-line); border-radius: 10px; overflow: hidden; align-self: start; }
.ta-pph { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; font-weight: 700; font-size: var(--fs-base); border: 0; border-bottom: 1px solid var(--ta-soft); background: #fff; text-align: left; }
.ta-pp.is-closed .ta-pph { border-bottom: 0; }
.ta-ppn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ta-odn { color: var(--ta-warn); font-weight: 700; font-size: var(--fs-base); white-space: nowrap; }
.ta-ppc { margin-left: auto; font-size: var(--fs-meta); font-weight: 600; color: var(--ta-sub); white-space: nowrap; }
.ta-pp .ta-row { min-height: 38px; }
.ta-pp .ta-t { font-size: var(--fs-base); }
.ta-more { display: block; width: 100%; text-align: left; min-height: 34px; padding: 0 14px; border: 0; border-top: 1px solid var(--ta-soft); background: #fff; font-size: var(--fs-meta); font-weight: 600; color: var(--ta-accent); cursor: pointer; }

/* 상세 패널 */
.ta-detail { display: none; background: #fff; border-left: 1px solid var(--ta-line); padding: 18px 24px 24px; min-width: 0; position: sticky; top: 0; align-self: start; max-height: calc(100vh - 80px); overflow-y: auto; border-radius: 0 12px 12px 0; }
#todoA.has-detail .ta-detail { display: block; }
.ta-dtop { display: none; }
.ta-title-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.ta-back { display: none; }
.ta-x { border: 0; background: none; font-size: var(--fs-title); color: var(--ta-sub); cursor: pointer; padding: 6px; margin-left: auto; }
.ta-dtitle { flex: 1; min-width: 0; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin: 0 0 0 -6px; font-size: calc(var(--fs-title) * 1.25) !important; font-weight: 700; line-height: 1.35; resize: none; field-sizing: content; background: transparent; }
.ta-dtitle:hover { border-color: var(--ta-line); }
.ta-dtitle:focus { border-color: var(--ta-accent); outline: 0; }
.ta-stseg { display: flex; background: var(--ta-soft); border-radius: 8px; padding: 3px; margin-bottom: 14px; }
.ta-st { flex: 1; border: 0; background: none; padding: 7px 0; border-radius: 6px; font-size: var(--fs-base); font-weight: 600; color: var(--ta-sub); cursor: pointer; }
.ta-st.is-on { background: #fff; color: var(--ta-accent); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ta-legacy { font-size: var(--fs-meta); color: var(--ta-warn); margin: -8px 0 12px; }
.ta-f { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center; min-height: 40px; font-size: var(--fs-base); border-bottom: 1px solid var(--ta-soft); gap: 8px; }
.ta-fk { color: var(--ta-sub); }
.ta-fv { min-width: 0; display: flex; align-items: center; }
.ta-in { border: 1px solid transparent; border-radius: 6px; padding: 5px 6px; background: transparent; font-size: var(--fs-base); max-width: 100%; }
.ta-fv .ta-in { padding-inline-start: 0; border-inline-start-width: 0; text-align: start; }
.ta-fv .ta-in::-webkit-date-and-time-value { text-align: start; }
.ta-in:hover { border-color: var(--ta-line); }
.ta-in:focus { border-color: var(--ta-accent); outline: 0; background: #fff; }
.ta-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ta-link { border: 0; background: none; color: var(--ta-sub); font-size: var(--fs-meta); cursor: pointer; text-decoration: underline; }
.ta-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 0; }
.ta-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--ta-soft); border-radius: 999px; padding: 2px 4px 2px 2px; font-size: var(--fs-base); font-weight: 600; }
.ta-chipx { border: 0; background: none; color: var(--ta-sub); cursor: pointer; font-size: var(--fs-base); padding: 0 4px; }
.ta-add { border: 0; background: none; color: var(--ta-accent); font-weight: 600; font-size: var(--fs-base); cursor: pointer; max-width: 110px; }
.ta-sec { margin-top: 18px; margin-bottom: 6px; font-size: var(--fs-base); font-weight: 700; }
.ta-note { width: 100%; border: 1px solid var(--ta-line); border-radius: 8px; padding: 8px 10px; font-size: var(--fs-base); line-height: 1.55; resize: vertical; }
.ta-note:focus { border-color: var(--ta-accent); outline: 0; }
.ta-stk { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: var(--fs-base); cursor: pointer; }
.ta-stk input { width: 16px; height: 16px; accent-color: var(--ta-accent); }
.ta-stk.is-done span { color: var(--ta-sub); text-decoration: line-through; }
.ta-subin, .ta-cin { width: 100%; border-color: var(--ta-line); padding: 8px 10px; margin-top: 4px; }
.ta-cm { display: flex; gap: 10px; margin-top: 10px; font-size: var(--fs-base); line-height: 1.5; }
.ta-cmw { color: var(--ta-sub); font-size: var(--fs-meta); }
.ta-cmt { white-space: pre-wrap; word-break: break-word; }
.ta-dfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; font-size: var(--fs-meta); color: var(--ta-sub); }
.ta-del { border: 0; background: none; color: var(--ta-sub); font-size: var(--fs-meta); cursor: pointer; }
.ta-del:hover { color: #DC2626; }

/* 되돌리기 */
.ta-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #14161B; color: #fff; border-radius: 10px; padding: 10px 16px; font-size: var(--fs-base); display: flex; gap: 16px; align-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.18); z-index: 9000; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.ta-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ta-toastm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-undo { border: 0; background: none; color: #93B4FF; font-weight: 700; cursor: pointer; padding: 4px 0; font-size: var(--fs-base); }

@media (min-width: 769px) {
  .ta-date-list, #todoA.is-datelist .ta-qa { max-width: 960px; }
  .ta-date-list .ta-meta .ta-pj { width: min(16vw, 260px); }
  .ta-rb { flex-wrap: wrap; gap: 4px 12px; }
  .ta-t { flex: 1 1 8ch; }
  .ta-meta { max-width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .ta-row-fields { display: inline-flex; gap: 10px; align-items: center; max-width: 100%; }
  .ta-meta .ta-pj { width: min(9vw, 140px); }
  .ta-meta .ta-due { width: 7em; min-width: 72px; text-align: right; }
  .ta-meta .ta-avs { flex: 0 0 24px; justify-content: center; }
  .ta-meta .ta-avs > :nth-child(n+2) { display: none; }
}

/* ── 폰 ── */
@media (max-width: 768px) {
  #todoA, #todoA.has-detail { grid-template-columns: minmax(0, 1fr); border-radius: 0; margin: 0 -12px; }
  .ta-main { padding: 12px 16px 32px; }
  .ta-head { margin-bottom: 8px; }
  .ta-plus { display: flex; width: 44px; height: 44px; border: 1.5px solid var(--ta-accent); color: var(--ta-accent); background: #fff; border-radius: 8px; align-items: center; justify-content: center; font-size: calc(var(--fs-title) * 1.375); cursor: pointer; }
  .ta-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  #todoA .ta-chiprow { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .ta-chiprow::-webkit-scrollbar { display: none; }
  .ta-cchip { flex: none; min-height: 44px; padding: 8px 14px; }
  .ta-barr { justify-content: space-between; }
  .ta-gsel { min-height: 36px; font-size: var(--fs-title); }
  .ta-qa { display: none; }
  #todoA.sheet-open .ta-dim { display: block; position: fixed; inset: 0; background: rgba(20,22,27,.35); border: 0; z-index: 940; }
  #todoA.sheet-open .ta-qa { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 941; border-radius: 16px 16px 0 0; border: 0; padding: 14px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(0,0,0,.12); }
  .ta-qainput { font-size: var(--fs-title); }
  .ta-send { display: inline-flex; background: var(--ta-accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 18px; font-weight: 700; font-size: var(--fs-base); cursor: pointer; }
  .ta-parsed { display: flex; }
  .ta-hint { margin-left: 0; width: 100%; }
  .ta-hint-enter { display: none; }
  .ta-list { margin-top: 8px; }
  .ta-gh { min-height: 46px; }
  .ta-row { align-items: flex-start; min-height: 56px; padding: 10px 14px; }
  #todoA .ta-ck { width: 22px; height: 22px; min-height: 0; min-width: 0; margin-top: 1px; }
  .ta-ck::before { inset: auto; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
  .ta-meta .ta-due:empty, .ta-meta .ta-avs:empty { display: none; }
  .ta-rb { flex-direction: column; align-items: stretch; gap: 3px; }
  .ta-t { white-space: normal; word-break: keep-all; line-height: 1.35; font-size: var(--fs-body); }
  .ta-meta { margin-left: 0; flex-wrap: wrap; gap: 8px; white-space: normal; }
  .ta-newdot { top: 21px; margin-top: 0; }
  .ta-people { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ta-pph { min-height: 48px; cursor: pointer; }
  .ta-more { min-height: 44px; }
  .ta-fold { min-height: 48px; }
  .ta-mini { min-height: 44px; padding: 9px 12px; }
  /* 상세 = 화면 이동 */
  .ta-detail { position: fixed; inset: 0; z-index: 930; max-height: none; border: 0; border-radius: 0; padding: 0 18px calc(24px + env(safe-area-inset-bottom)); }
  .ta-dtop { display: flex; position: sticky; top: 0; background: #fff; z-index: 1; margin: 0 -18px 8px; padding: calc(6px + env(safe-area-inset-top)) 10px 6px; border-bottom: 1px solid var(--ta-line); }
  .ta-back { display: inline-flex; border: 0; background: none; font-size: var(--fs-title); font-weight: 600; color: var(--ta-accent); padding: 10px 8px; cursor: pointer; }
  .ta-x { display: none; }
  .ta-in, .ta-note, .ta-gsel, .ta-add, .ta-dtitle { font-size: var(--fs-title); }
  .ta-f { min-height: 48px; }
  .ta-st { padding: 10px 0; }
}
