/* ============================================================
 * tasks-shared.css — 總覽頁 + team 頁共用（modal / 登入 / 表單 / toast）
 * token 值對齊 index-light.html（Jessie 已核 mockup）
 * ============================================================ */
:root {
  --brand-orange:#FF7200; --brand-red:#E84000; --brand-yellow:#FFD600;
  --brand-gradient: linear-gradient(135deg, #FFD600, #FF7200, #E84000);
  --gold:#C9A84C; --green:#34D399; --yellow:#EAB308; --teal:#14B8A6; --pink:#EC4899; --indigo:#6366F1;
  --ai-blue:#2563EB; --ai-blue-soft:#3B82F6;
  --bg:#F6F7F9; --card:#FFFFFF; --border:#E6E8EC; --border-hover:#FFD9BE;
  --text-dark:#1A1A2E; --text-muted:#6B6B80;
  --font-display:'Inter','Noto Sans TC',sans-serif;
  --font-heading:'Inter','Noto Sans TC','PingFang TC',sans-serif;
  --font-mono:'Space Mono','Courier New',monospace;
  --font-tc:'Noto Sans TC','PingFang TC','Microsoft JhengHei',sans-serif;
  --radius-xs:4px; --radius-sm:8px; --radius-md:12px; --radius-lg:20px; --radius-pill:999px;
  --tr-base:0.2s ease;
}
    /* ══ 卡片 detail 面板（Asana/Notion/Trello/ClickUp 式文件感詳情，沿用 v0.6）══
       參考：Asana 右側 pane（屬性→描述→留言縱向流）/ Notion page（屬性列橫排）
             / Trello card back（描述 + 附件 + 留言活動）。輕量、留白、可讀。*/
    .modal-overlay {
      position: fixed; inset: 0; z-index: 100;
      background: rgba(20,20,43,0.45); backdrop-filter: blur(3px);
      display: none; align-items: flex-start; justify-content: center;
      padding: 40px 20px; overflow-y: auto; }
    .modal-overlay.open { display: flex; }
    .modal {
      background: #FFFFFF; border-radius: 16px; width: 100%; max-width: 600px;
      box-shadow: rgba(20,20,43,0.20) 0px 24px 64px; overflow: hidden;
      animation: modalIn 0.18s ease; }
    @keyframes modalIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

    /* 頂列：域 badge + 關閉（細，不搶標題）*/
    .modal-bar { display: flex; align-items: center; justify-content: space-between;
      padding: 14px 22px; border-bottom: 1px solid var(--border); }
    .modal-domain { display: inline-flex; align-items: center; gap: 6px;
      font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.5px; }
    .modal-domain .dm-dot { width: 8px; height: 8px; border-radius: 50%; }
    .modal-close { width: 30px; height: 30px; border-radius: 8px; border: none;
      background: none; color: var(--text-muted); font-size: 17px; cursor: pointer; line-height: 1;
      display: flex; align-items: center; justify-content: center; transition: all var(--tr-base); }
    .modal-close:hover { background: #F0F0F5; color: var(--text-dark); }

    .modal-body { padding: 22px 26px 26px; }
    /* 大標題（文件感，大字留白，非表單 label）*/
    .modal-title { font-family: var(--font-heading); font-weight: 800; font-size: 23px;
      color: var(--text-dark); line-height: 1.3; margin: 0 0 20px; }

    /* 屬性列：輕量橫排無框（Notion properties 式）*/
    .modal-props { display: flex; flex-direction: column; gap: 2px; margin-bottom: 26px; }
    .prop-row { display: grid; grid-template-columns: 84px 1fr; align-items: center;
      gap: 12px; padding: 7px 0; }
    .prop-key { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); letter-spacing: 0.3px; }
    .prop-val { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text-dark);
      font-family: var(--font-tc); flex-wrap: wrap; }
    /* 可點編輯感（hover 才出淡底，平時無框 — 文件感非表單）*/
    .prop-editable { display: inline-flex; align-items: center; gap: 6px;
      padding: 3px 8px; border-radius: 6px; cursor: pointer; transition: background var(--tr-base); margin: -3px -8px; }
    .prop-editable:hover { background: #F0F0F5; }
    .pv-avatar { width: 20px; height: 20px; border-radius: 50%; display: inline-flex;
      align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff;
      background: linear-gradient(135deg, #FF9640, #E84000); }
    .pv-avatar.ai { background: linear-gradient(135deg, #3B82F6, #2563EB); }
    .pv-dot { width: 7px; height: 7px; border-radius: 50%; }

    /* 區塊標題（清楚階層）*/
    .modal-sec { font-family: var(--font-heading); font-weight: 700; font-size: 14px;
      color: var(--text-dark); margin: 24px 0 12px; display: flex; align-items: center; gap: 7px; }
    .modal-sec:first-of-type { margin-top: 0; }

    /* 描述（文件感內文，無框，只有上分隔）*/
    .modal-desc { font-family: var(--font-tc); font-size: 14px; line-height: 1.75;
      color: #33333F; margin: 0; }

    /* 附件 / 連動 */
    .modal-attach { display: flex; flex-direction: column; gap: 8px; }
    .attach-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
      background: #F8F8FB; border-radius: 8px; font-size: 14px; color: var(--text-dark); }
    .attach-ic { font-size: 15px; }
    .attach-type { font-family: var(--font-mono); font-size: 10px; font-weight: 700;
      padding: 2px 7px; border-radius: 999px; border: 1px solid; }
    .at-crm    { color: #C24E00; border-color: #FFD3B0; background: #FFF3E8; }
    .at-vault  { color: #8A6D1E; border-color: #EBDBA8; background: #FBF4E2; }
    .attach-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
      padding: 6px 10px; border: none; background: none; cursor: pointer;
      font-family: var(--font-tc); font-size: 13px; color: var(--text-muted); border-radius: 6px; transition: all var(--tr-base); }
    .attach-add:hover { background: #F0F0F5; color: var(--brand-orange); }

    /* Checklist / 子任務（Trello card back + ClickUp subtask 核心）*/
    .checklist { display: flex; flex-direction: column; gap: 2px; }
    .check-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
    .check-bar { flex: 1; height: 6px; border-radius: 999px; background: #ECECF2; overflow: hidden; }
    .check-bar-fill { height: 100%; background: var(--green); border-radius: 999px; }
    .check-pct { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text-muted); }
    .check-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px;
      transition: background var(--tr-base); }
    .check-item:hover { background: #F8F8FB; }
    .check-box { width: 18px; height: 18px; border-radius: 5px; border: 2px solid #C7C7D6; flex-shrink: 0; cursor: pointer; }
    .check-box.done { background: var(--green); border-color: transparent;
      display: flex; align-items: center; justify-content: center; }
    .check-box.done::after { content: '✓'; color: #fff; font-size: 11px; font-weight: 700; }
    .check-text { font-family: var(--font-tc); font-size: 14px; color: var(--text-dark); }
    .check-item.done .check-text { color: var(--text-muted); text-decoration: line-through; }
    .check-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
      padding: 6px 10px; border: none; background: none; cursor: pointer; margin-top: 4px;
      font-family: var(--font-tc); font-size: 13px; color: var(--text-muted); border-radius: 6px; }
    .check-add:hover { background: #F0F0F5; color: var(--brand-orange); }

    /* 留言 / 活動（Asana/Trello detail 核心）*/
    .comment { display: flex; gap: 10px; margin-bottom: 14px; }
    .comment-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff;
      background: linear-gradient(135deg, #FF9640, #E84000); }
    .comment-avatar.ai { background: linear-gradient(135deg, #3B82F6, #2563EB); }
    .comment-body { flex: 1; }
    .comment-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
    .comment-who { font-family: var(--font-heading); font-weight: 700; font-size: 13px; color: var(--text-dark); }
    .comment-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
    .comment-text { font-family: var(--font-tc); font-size: 14px; line-height: 1.6; color: #33333F; }
    /* @mention 派工：留言即指令（Slack/Asana @assign 式）*/
    .comment.dispatch { background: rgba(37,99,235,0.05); border: 1px solid rgba(37,99,235,0.18);
      border-radius: 10px; padding: 10px 12px; margin-left: -12px; margin-right: -12px; }
    .mention { display: inline-flex; align-items: center; gap: 4px; font-weight: 700;
      color: var(--ai-blue); background: rgba(37,99,235,0.10); padding: 1px 6px; border-radius: 5px; }
    .dispatch-tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono);
      font-size: 10px; font-weight: 700; color: var(--ai-blue); background: rgba(37,99,235,0.10);
      border: 1px solid rgba(37,99,235,0.25); padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
    /* agent 回覆帶 report 連結 */
    .agent-reply-report { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
      font-family: var(--font-mono); font-size: 11px; color: var(--ai-blue); text-decoration: none; }
    .agent-reply-report:hover { text-decoration: underline; }
    .agent-reply-need { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
      font-family: var(--font-mono); font-size: 11px; color: #C24E00;
      background: #FFF3E8; padding: 3px 8px; border-radius: 6px; }

    .comment-input { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; position: relative; }
    .comment-input-row { display: flex; gap: 10px; align-items: center; }
    .comment-input input { flex: 1; background: #F8F8FB; border: 1px solid var(--border);
      border-radius: 999px; padding: 11px 16px; font-family: var(--font-tc); font-size: 14px; color: var(--text-dark); }
    .comment-input input:focus { outline: none; border-color: var(--border-hover); background: #fff; }
    .comment-input-hint { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); padding-left: 4px; }
    .comment-input-hint b { color: var(--ai-blue); }
    /* 委派 AI 入口（原 @ 標註）：只走 dispatch 留言，不改負責人 */
    .mention-menu { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 2px; }
    .mention-opt { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono);
      font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
      background: #fff; cursor: pointer; transition: all var(--tr-base); }
    .mention-opt:hover { border-color: var(--ai-blue); background: rgba(37,99,235,0.06); }
    .mention-opt .mo-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ai-blue); }
    .mention-opt.human .mo-dot { background: var(--brand-orange); }

    /* modal 底部動作區（委派 AI / 儲存）*/
    .modal-actions { display: flex; gap: 10px; align-items: center; margin-top: 22px;
      padding-top: 18px; border-top: 1px solid var(--border); }
    .btn-assign-ai { display: inline-flex; align-items: center; gap: 6px;
      background: linear-gradient(135deg, #3B82F6, #2563EB); color: #fff; border: none;
      border-radius: var(--radius-pill); padding: 10px 20px; font-family: var(--font-heading);
      font-weight: 700; font-size: 14px; cursor: pointer; }
    .btn-save { background: #fff; border: 1px solid var(--border); color: var(--text-dark);
      border-radius: var(--radius-pill); padding: 10px 20px; font-family: var(--font-heading);
      font-weight: 700; font-size: 14px; cursor: pointer; }
    .btn-save:hover { border-color: var(--border-hover); }
    .modal-actions .spacer { flex: 1; }

    .modal-note { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
      text-align: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ══ live 版共用（登入 / 表單控制 / toast / 提示）══ */
.gradient-text { background: var(--brand-gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text; }
.th-logout { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 6px 14px; cursor: pointer; transition: all var(--tr-base); }
.th-logout:hover { color: var(--brand-orange); border-color: var(--border-hover); }

.login-overlay { position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: none; align-items: center; justify-content: center; padding: 20px; }
.login-overlay.open { display: flex; }
.login-card { background: #fff; border: 1px solid var(--border); border-radius: 20px;
  padding: 36px 32px; width: 100%; max-width: 380px;
  box-shadow: rgba(20,20,43,.06) 0 4px 12px, rgba(20,20,43,.10) 0 10px 28px; }
.login-title { font-family: var(--font-heading); font-weight: 800; font-size: 22px; margin: 0 0 6px; }
.login-sub { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-bottom: 22px; }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 6px; letter-spacing: 1px; }
.login-field input { width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; font-size: 15px; font-family: var(--font-tc); }
.login-field input:focus { outline: none; border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(255,114,0,.12); }
.login-err { color: #C22B2B; font-size: 13px; min-height: 20px; margin: 4px 0 10px; }
.login-btn { width: 100%; }

.cfg-banner { background: #FFF6E5; border-bottom: 1.5px solid #FFD98A; color: #8A5B00;
  font-size: 14px; padding: 12px 20px; text-align: center; font-family: var(--font-tc); }

.inbox-list { margin-top: 12px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.inbox-list .task { margin-bottom: 0; }
.inbox-empty { font-family: var(--font-mono); font-size: 12px; color: #A3A3B4; padding: 4px 2px; }

.tk-input, .tk-select, .tk-textarea { font-family: var(--font-tc); font-size: 14px;
  color: var(--text-dark); background: #F8F8FB; border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; }
.tk-input:focus, .tk-select:focus, .tk-textarea:focus { outline: none;
  border-color: var(--brand-orange); box-shadow: 0 0 0 3px rgba(255,114,0,.12); background: #fff; }
.tk-textarea { width: 100%; min-height: 96px; line-height: 1.7; resize: vertical; }
.mtitle-input { width: 100%; font-family: var(--font-heading); font-weight: 800; font-size: 23px;
  line-height: 1.3; border: none; border-bottom: 2px solid transparent; background: transparent;
  color: var(--text-dark); margin: 0 0 20px; padding: 0 0 4px; }
.mtitle-input:focus { outline: none; border-bottom-color: var(--brand-orange); }
.btn-archive { background: #fff; border: 1px solid var(--border); color: #C22B2B;
  border-radius: var(--radius-pill); padding: 10px 18px; font-family: var(--font-heading);
  font-weight: 700; font-size: 14px; cursor: pointer; transition: all var(--tr-base); }
.btn-archive:hover { border-color: #F5B5B5; background: #FDF3F3; }
.btn-assign-ai[disabled] { opacity: .45; cursor: not-allowed; }
.btn-mini { border-radius: var(--radius-pill); padding: 7px 14px; font-size: 13px;
  cursor: pointer; border: 1px solid var(--border); background: #fff; font-family: var(--font-tc); }
.btn-mini.primary { background: var(--brand-gradient); color: #fff; border: none; font-weight: 700; }
.goal-editor { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.goal-editor .tk-textarea { min-height: 72px; }
.goal-editor-row { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 300;
  background: #1A1A2E; color: #fff; font-size: 14px; font-family: var(--font-tc);
  padding: 10px 20px; border-radius: var(--radius-pill);
  box-shadow: rgba(20,20,43,.3) 0 8px 24px; opacity: 0; transition: opacity .2s;
  pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; }
.toast.err { background: #C22B2B; }

/* ===== v0.7.2 §5.1b 七項修訂（2026-07-03）===== */
/* 一鍵完成 ✓（核心操作常駐可見；hover 只做增強） */
.task { position: relative; }
.card-check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #D1D5DB; color: #9CA3AF; font-size: 13px; line-height: 18px; text-align: center; cursor: pointer; background: #fff; transition: border-color .15s, background .15s, color .15s, transform .15s; opacity: 1; z-index: 2; }
.task:hover .card-check { transform: scale(1.04); }
.card-check:hover { border-color: #34D399; color: #34D399; }
.card-check.done { opacity: 1; background: #34D399; border-color: #34D399; color: #fff; }
.task.is-done .task-title { text-decoration: line-through; color: #9CA3AF; }
.task.is-done { opacity: .75; }
.task-restore {
  margin-top: 8px; border: 1px solid #D1FAE5; background: #ECFDF5; color: #047857;
  border-radius: 999px; padding: 4px 10px; font-family: var(--font-tc); font-size: 12px;
  font-weight: 700; cursor: pointer;
}
.task-restore:hover { border-color: #34D399; background: #D1FAE5; }
/* 拖拉 */
.task[draggable="true"] { cursor: grab; }
.task.dragging { opacity: .4; }
.col.drop-over { outline: 2px dashed #FF7200; outline-offset: -4px; border-radius: 12px; background: rgba(255,114,0,.04); }
/* chips */
.chip-proj { background: #EEF2FF; color: #4F46E5; }
.chip-dispatch { background: #DBEAFE; color: #2563EB; }
.chip-reply { background: #D1FAE5; color: #059669; }
/* 📁 專案列 */
.proj-sec { background: #fff; border-radius: 14px; padding: 16px 18px; margin: 14px 0; box-shadow: 0 1px 3px rgba(17,24,39,.06); }
.proj-head { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.proj-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.proj-chip { border: 1.5px solid #E5E7EB; background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; font-family: inherit; }
.proj-chip:hover { border-color: #FF7200; }
.proj-chip.active { background: #FF7200; border-color: #FF7200; color: #fff; }
.proj-chip .pc-c { opacity: .65; font-size: 12px; }
.proj-view { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
/* ✅ 已完成集中 view */
.done-sec { margin: 14px 0 20px; }
.done-head { width: 100%; text-align: left; background: #fff; border: none; border-radius: 14px; padding: 14px 18px; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 1px 3px rgba(17,24,39,.06); font-family: inherit; }
.done-caret { float: right; color: #9CA3AF; }
.done-body { background: #fff; border-radius: 0 0 14px 14px; margin-top: 2px; padding: 14px 18px; }
.done-sub { font-size: 13px; font-weight: 700; color: #6B7280; margin: 10px 0 8px; }
.done-goal { font-size: 14px; padding: 8px 12px; background: #FFFBEB; border-radius: 8px; margin-bottom: 6px; }
.done-restore { border: 1px solid #D6C487; background: #fff; color: #8A6D1E; border-radius: 999px; padding: 3px 9px; font-family: var(--font-tc); font-size: 12px; cursor: pointer; }
.done-restore:hover { background: #FBF4E2; border-color: #C9A84C; }
.done-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
/* 完成鼓勵 */
.toast.celebrate { font-size: 17px; font-weight: 700; background: linear-gradient(135deg, #FFD600, #FF7200); color: #1A1A2E; }
.celebrate-ov { position: fixed; inset: 0; background: rgba(8,8,20,.45); display: flex; align-items: center; justify-content: center; z-index: 9999; animation: cel-fade .2s; }
.celebrate-box { background: #fff; border-radius: 20px; padding: 36px 44px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: cel-pop .25s; max-width: 86vw; }
.celebrate-emoji { font-size: 52px; margin-bottom: 10px; }
.celebrate-title { font-size: 22px; font-weight: 800; color: #1A1A2E; }
.celebrate-sub { font-size: 15px; color: #6B7280; margin-top: 8px; line-height: 1.6; }
@keyframes cel-pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes cel-fade { from { opacity: 0; } to { opacity: 1; } }
/* modal：標完成 + 派工面板 */
.btn-done { background: #34D399; color: #fff; border: none; border-radius: 8px; padding: 10px 18px; font-weight: 700; cursor: pointer; font-family: inherit; font-size: 14px; }
.btn-done:hover { background: #10B981; }
.dispatch-panel { margin-top: 10px; }
/* 目標 ✓（核心操作常駐可見，在 ✎ 編輯左側） */
.goal { position: relative; }
.goal-done-btn { position: absolute; top: 10px; right: 66px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.75); color: rgba(255,255,255,.95); font-size: 11px; line-height: 17px; text-align: center; cursor: pointer; opacity: 1; transition: background .15s, border-color .15s, color .15s; }
.goal-done-btn:hover { background: rgba(255,255,255,.25); }

/* ===== v0.7.3：goal tile 樣式進 shared（team 頁目標階梯用；index-light 內聯同款共存無害）===== */
.goals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 14px 0 4px; }
@media (max-width: 900px) { .goals { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .goals { grid-template-columns: 1fr; gap: 12px; } }
.goal { position: relative; overflow: hidden; background: #FFFFFF;
  border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.goal:hover { border-color: var(--border-hover); box-shadow: rgba(20,20,43,.06) 0 2px 8px; }
.goal:hover .goal-edit { opacity: 1; }
.goal-edit { position: absolute; top: 12px; right: 12px; font-size: 13px;
  color: var(--text-muted); opacity: 0; transition: opacity .15s; }
.goal-empty { color: var(--text-muted); font-style: italic; }
.goal::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.goal.tier-y::before { background: var(--brand-red); }
.goal.tier-q::before { background: var(--brand-orange); }
.goal.tier-m::before { background: var(--gold); }
.goal.tier-w::before { background: var(--green); }
.goal-label { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.goal.tier-y .goal-label { color: var(--brand-red); }
.goal.tier-q .goal-label { color: var(--brand-orange); }
.goal.tier-m .goal-label { color: #A6812E; }
.goal.tier-w .goal-label { color: #1E9E76; }
.goal-scope { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 700; }
.goal-text { font-size: 14px; font-weight: 700; line-height: 1.5; color: var(--text-dark); }
/* v0.7.3：goal-done-btn 在淺色 tile 上（team 頁）用灰綠而非白 */
.goal .goal-done-btn { border-color: #C7CBD1; color: #9CA3AF; }
.goal .goal-done-btn:hover { border-color: #34D399; color: #34D399; background: rgba(52,211,153,.08); }

/* ===== v0.7.4 §5.1d：目標 = 迷你 Task ===== */
.goal { cursor: default; }
.goal-row { display: flex; align-items: center; gap: 7px; padding: 6px 0; border-bottom: 1px dashed #EEF0F3; }
.goal-row:last-of-type { border-bottom: none; }
.goal-badge { flex-shrink: 0; font-size: 11px; font-weight: 700; border: 1px solid; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.goal-row-text { flex: 1; font-size: 13.5px; font-weight: 700; line-height: 1.45; color: var(--text-dark); cursor: pointer; }
.goal-row-text:hover { color: var(--brand-orange); }
.goal-row-edit { flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border); color: var(--text-muted); background: #fff; cursor: pointer; line-height: 20px; font-size: 13px; }
.goal-row-edit:hover { border-color: var(--border-hover); color: var(--brand-orange); background: #FFF7F0; }
.goal-row-check { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #D1D5DB; color: #9CA3AF; background: #fff; font-size: 12px; line-height: 19px; text-align: center; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.goal-row-check:hover { border-color: #34D399; color: #34D399 !important; }
.goal-add { width: 100%; border: none; background: transparent; font-family: inherit; font-size: 13px; color: var(--text-muted); padding: 8px 0 2px; }
.goal-add:focus { outline: none; color: var(--text-dark); }
.goal-add::placeholder { color: #B9BDC7; font-style: italic; }
.goal-modal { max-width: 520px; }
.review-hz { font-size: 12px; font-weight: 800; color: #9CA3AF; letter-spacing: 1px; margin: 10px 0 6px; }
.done-goal { display: flex; align-items: center; gap: 8px; }
.dg-period { font-size: 12px; font-weight: 700; color: #A6812E; flex-shrink: 0; }
.dg-text { flex: 1; font-size: 14px; }
.dg-date { font-size: 12px; color: #9CA3AF; flex-shrink: 0; }
.focus-col.drop-over, .team.drop-over { outline: 2px dashed #FF7200; outline-offset: -3px; background: rgba(255,114,0,.05); border-radius: 12px; }

/* ===== v0.7.5：自訂 assignee picker / project dropdown ===== */
.picker-wrap { display: inline-flex; min-width: 0; }
.assignee-trigger, .project-switcher {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  border: 1px solid var(--border); background: #fff; color: var(--text-dark);
  border-radius: 8px; padding: 6px 9px; cursor: pointer; font-family: var(--font-tc); font-size: 14px;
}
.assignee-trigger:hover, .project-switcher:hover { border-color: var(--border-hover); background: #FFF7F0; }
.picker-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-chevron { color: var(--text-muted); font-size: 12px; }
.avatar-pick, .avatar-empty {
  position: relative; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800;
  color: #fff; background: linear-gradient(135deg, #FF9640, #E84000);
}
.avatar-pick.ai { border-radius: 5px; background: #2563EB; }
.avatar-empty { color: var(--text-muted); background: #F3F4F6; border: 1px dashed #C7CBD1; }
.ai-badge {
  position: absolute; right: -5px; bottom: -5px; min-width: 14px; height: 14px; border-radius: 999px;
  background: #2563EB; color: #fff; border: 1px solid #fff; font-size: 7px; line-height: 12px; text-align: center;
}
.picker-popover {
  position: fixed; z-index: 500; max-height: min(360px, calc(100vh - 24px)); overflow: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: rgba(20,20,43,.16) 0 14px 36px; padding: 8px;
}
.picker-search {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  font-family: var(--font-tc); font-size: 14px; margin-bottom: 6px; background: #F8F8FB;
}
.picker-search:focus { outline: none; border-color: var(--brand-orange); background: #fff; }
.picker-list { display: flex; flex-direction: column; gap: 2px; }
.picker-group { padding: 8px 8px 3px; color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.picker-option {
  width: 100%; display: flex; align-items: center; gap: 8px; min-height: 36px;
  border: none; background: #fff; border-radius: 8px; padding: 7px 8px; cursor: pointer;
  font-family: var(--font-tc); font-size: 14px; color: var(--text-dark); text-align: left;
}
.picker-option:hover, .picker-option.selected { background: #F5F5F5; }
.picker-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-check { color: var(--brand-orange); font-weight: 800; }
.picker-empty { padding: 14px 8px; color: var(--text-muted); font-size: 13px; }
.project-picker-wrap { width: min(100%, 320px); }
.project-picker-wrap .project-switcher { width: 100%; justify-content: flex-start; }
.project-swatch {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 5px; display: inline-flex;
  align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 12px;
}
.project-swatch.empty { background: #F3F4F6; border: 1px dashed #C7CBD1; }
.project-swatch.new { background: var(--brand-gradient); }
.project-count { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.mention-picker-host { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-left: 4px; }
.delegate-note, .prop-hint, .dispatch-help { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.dispatch-help { margin: -2px 0 10px; }
.dispatch-assignee-row { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 12px; margin-bottom: 10px; }

@media (max-width: 480px) {
  .modal-overlay { padding: 18px 10px; }
  .modal-body { padding: 18px 16px 20px; }
  .prop-row, .dispatch-assignee-row { grid-template-columns: 1fr; gap: 5px; }
  .assignee-trigger, .project-switcher { min-height: 38px; }
  .mention-picker-host { align-items: stretch; }
  .mention-picker-host .picker-wrap { width: 100%; }
  .mention-picker-host .assignee-trigger { width: 100%; justify-content: flex-start; }
  .card-check { top: 8px; right: 8px; width: 28px; height: 28px; line-height: 24px; font-size: 14px; }
  .task-title { padding-right: 32px; }
  .task-restore { min-height: 32px; padding: 5px 12px; }
  .goal-row { align-items: flex-start; }
  .goal-row-check, .goal-row-edit { width: 28px; height: 28px; line-height: 24px; }
}
