/* 介面照 homepage-mockup.png(第十四稿「視覺重量版」)。
   D64 四條視覺重量紀律:
   1. 號碼大圈退役 → 8px 細色點 + 灰色細數字(第1位珊瑚點,其餘灰點)
   2. 人名圈/牌全部除色(灰底灰字),全 app 一律
   3. 狀態 chip(等咗N日/逾期N日)全灰,唔用色
   4. 大面積色只准四處:第1位卡邊框、收件箱緊急橙卡、綠加號、進度條 */

:root {
  --p1: #D85A30;          /* 珊瑚紅 — 第 1 位焦點邊框專屬(B3 修訂,D71) */
  --dot: #B9BEC6;         /* 冇象限資料時嘅預設灰點 */
  --capture: #25D366;     /* WhatsApp 綠 — 專屬加任務掣(D64-4) */
  --urgent: #E8873A;      /* 收件箱緊急橙卡(D64-4) */

  /* D71 四格身份色:卡上色點永遠 display 呢四色,同「第1位」焦點邊框分工 */
  --quad-red: #D85A30;    /* 紅:緊急重要 */
  --quad-yellow: #E3A73B; /* 黃:緊急不重要 */
  --quad-grey: #8B929C;   /* 灰:重要不緊急 */
  --quad-none: #C7CBD1;   /* 無色:普通 */

  --page: #F6F6F8;
  --card: #FFFFFF;
  --line: #ECECEF;
  --ink: #1F2124;
  --muted: #8A8F98;
  --grip: #C9CDD4;

  --band-bg: #C9DBF7;     /* 公司行程藍帶 */
  --band-ink: #35569E;

  --tick-line: #C9CDD4;
  --tick-ghost: #D5D8DE;
  --tick-done: #2F9E68;
  --tick-part: #9BDCB9;
  --tick-part-bg: #F1FAF5;

  /* D64-2/3:人名牌同狀態 chip 一律灰 */
  --tag-bg: #F0F1F3;
  --tag-ink: #7B818A;

  --prog-bg: #E4F2E9;
  --prog-track: #BFE0CE;
  --prog-fill: #2F7D57;
  --prog-ink: #1F4D38;

  --radius: 12px;
  --step: 160ms;
}

* { box-sizing: border-box; }

/* [hidden] 要贏過任何 display 設定。呢個 bug 犯過三次(capture/shell/cap-more),
   一次過根治:凡帶 hidden 屬性一律唔顯示,唔使逐個元素寫規則。 */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang HK", "PingFang TC",
               "Microsoft JhengHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── 首頁三區佈局(D49-D51 擺法B)────────────────── */
.shell {
  display: grid;
  /* D98(修正 D95 嘅代價):第四欄係接駁柱(D53)嘅位,平時 0px、拖緊嘢先變 116px。
     左欄同時由 168px 縮做 52px——「左欄慳返嘅 116px」同「接駁柱要嘅 116px」
     啱啱好互相抵消,所以今日欄(minmax(0,1fr))嘅實際闊度,拖唔拖都算出嚟一樣,
     版面唔跳;但又唔使好似 D95 咁日日都罰咗今日欄 116px——嗰個先係老闆話
     「唔開全螢幕就被壓縮得好犀利」嘅真正成因。四欄由頭到尾都存在(淨係數值變),
     所以間隔(gap)數目都唔變,唔會撞返 D87 舊版嗰個「3欄變4欄多咗條gap」嘅暗病。 */
  grid-template-columns: 168px minmax(0, 640px) 280px 0px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;  /* 日期列 / 全員動態帶 / 三區 */
  gap: 1rem;
  align-items: start;
  padding: 1.25rem;
  max-width: 1300px;
  margin: 0 auto;
  transition: grid-template-columns 180ms ease;
}
/* 明確排位:左欄跨晒兩行,唔係今日欄會跌落左欄格仔度 */
.sidebar   { grid-column: 1; grid-row: 1 / -1; }
.topline   { grid-column: 2 / -1; grid-row: 1; }
/* D70:鎖最大闊度,唔准跟視窗無限拉闊(醫「剔圈離個名成條河」)。
   鎖闊後右邊自然留白;拖動任務嗰刻,接駁柱(D53,3b先做)喺嗰忽現身。 */
#todaypanel { grid-column: 2; grid-row: 2; max-width: 640px; }
.rightcol  { grid-column: 3; grid-row: 2; }

/* D113:接駁柱開嗰陣,116px 由**最右邊嗰條後備欄**俾,唔郁左欄、唔郁今日欄、唔郁收件箱。
   真.零位移——之前 D98 靠「左欄縮 116 = 接駁柱長 116」互相抵消,闊度係啱嘅,
   但成個版由左邊起計會**整體向左移 116px**,即係都係會跳,只係我當時淨係量闊度冇量位置。 */
.shell.dock-open { grid-template-columns: 168px minmax(0, 640px) 280px 116px minmax(0, 1fr); }

/* 兩區都藏晒 → 右柱消失(D68)。第三欄收成 0,接駁柱照樣企第四欄,唔使搬位。 */
.shell.no-right { grid-template-columns: 168px minmax(0, 640px) 0px 0px minmax(0, 1fr); }
.shell.no-right.dock-open { grid-template-columns: 168px minmax(0, 640px) 0px 116px minmax(0, 1fr); }
.shell.no-right .rightcol { display: none; }

.dock { grid-column: 4; grid-row: 3; position: sticky; top: 1.25rem; }

/* D113:左欄唔再喺拖動時收埋。佢原本嘅唯一用途係騰 116px 俾接駁柱,
   而家最右邊條後備欄已經騰咗,再收埋反而會令成個版向左移。 */


/* ── 左欄殼(D24)───────────────────────────────── */
.sidebar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  position: sticky;
  top: 1.25rem;
}
.navlink {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .625rem;
  border-radius: 9px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink) !important; /* macOS 原生 button 外觀會偷走靜止狀態嘅顏色,撳落先變返 color:一齊鎖死 */
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.navlink:hover { background: var(--page); }
.navlink.active { background: #E8EFFA; color: #2B4E8C; font-weight: 600; }
.navlink.sub { padding-left: 1.1rem; font-size: 13.5px; }
.ico { width: 16px; height: 16px; flex: none; opacity: .75; }

/* 左欄計數:個欄可以消失,件數永遠見到(D68 鐵規)。灰色細,唔搶戲(D64) */
.navcount {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--tag-ink);
  background: var(--tag-bg);
  border-radius: 999px;
  padding: .02rem .4rem;
  font-variant-numeric: tabular-nums;
}
.navlink.sub.is-hidden { color: #B4B9C1; }

/* ── 系統識別 wordmark(D69)────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .625rem .85rem;
  margin-bottom: .15rem;
  border-bottom: 1px solid var(--line);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 13.5px; font-weight: 700; letter-spacing: .01em; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: .08em; }

.nav-heading {
  font-size: 11.5px;
  color: var(--muted);
  padding: .75rem .625rem .25rem;
}

/* 「更多」摺疊(左欄重整):平時收埋,撳開先見 */
.nav-more-chev { width: 13px; height: 13px; margin-left: auto; opacity: .6; transition: transform 160ms ease; }
#navMoreBtn[aria-expanded="true"] .nav-more-chev { transform: rotate(180deg); }
.nav-more { display: flex; flex-direction: column; gap: .1rem; }
/* 未開發項目一律淺灰——睇落就知未開得,唔好扮有得用。
   要 !important 係因為上面 .navlink 為咗醫 macOS button bug 用咗 !important。 */
.navlink.later { color: #B4B9C1 !important; cursor: default; }
.navlink.later .ico { opacity: .45; }
.navlink.later:hover { background: none; }

.sidebar-foot { margin-top: auto; padding-top: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.report-btn {
  display: flex; align-items: center; gap: .5rem;
  width: 100%;
  padding: .5rem .625rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  font: inherit; font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.report-btn:hover { background: var(--page); }

.me { display: flex; align-items: center; gap: .5rem; padding: .25rem .625rem; font-size: 13px; color: var(--muted); }

/* ── 人名牌:全 app 一律灰底灰字(D64-2)──────────── */
.person {
  flex: none;
  min-width: 20px; height: 20px;
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 11px;
  font-weight: 600;
  display: inline-grid; place-items: center;
}

/* ── 頂部日期列 ───────────────────────────────── */
/* D154:日期企最左,打卡 + 月曆掣孖住企最右。
   唔用 space-between——打卡係 hidden 嗰陣三件變兩件,月曆掣會走位。
   日期食晒中間空位(margin-right:auto),右邊嗰兩件永遠貼實右上角。 */
.topline {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: -.25rem;
}
.topline .datetitle { margin-right: auto; }
/* 視覺執法 1:日期收細轉灰,唔要粗體——背景唔係主角 */
.datetitle { font-size: 15px; font-weight: 400; margin: 0; color: var(--muted); }
.weekbtn {
  display: flex; align-items: center; gap: .4rem;
  padding: .35rem .7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  font: inherit; font-size: 12.5px;
  color: var(--muted);
  cursor: pointer; /* 4d:由「即將推出」變咗真月曆入口,唔再係死掣 */
}
.weekbtn:hover { background: var(--page); color: var(--ink); }
.weekbtn .soon { font-size: 11px; color: #B4B9C1; }

/* ── 全員動態帶(D55):一條窄帶,一次顯示一個人 ──────────────
   號碼圈無色(D55 原文)、人名牌無色(D64)——優先色專屬任務卡,
   呢度係協調用嘅一覽,唔搶戲。 */
.teamband {
  grid-column: 2 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .45rem .7rem;
  margin-bottom: -.35rem;
  font-size: 13px;
}
.teamband-label { flex: none; color: var(--muted); font-size: 12px; }
.teamband-nav {
  flex: none;
  width: 20px; height: 20px;
  border: 0; background: none; padding: 0;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  display: grid; place-items: center;
}
.teamband-nav svg { width: 14px; height: 14px; }
.teamband-nav:hover { color: var(--ink); background: var(--page); }
.teamband-person {
  flex: none;
  min-width: 20px; height: 20px;
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--tag-bg);   /* 人名牌無色(D64) */
  color: var(--tag-ink);
  font-size: 11px; font-weight: 600;
  display: inline-grid; place-items: center;
}
.teamband-tasks {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  overflow: hidden;
}
.teamband-task {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-width: 0;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.teamband-rank {   /* 號碼圈無色(D55 原文) */
  flex: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 10.5px; font-weight: 600;
  display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.teamband-empty { color: var(--muted); font-size: 12.5px; }
.teamband-index {
  flex: none;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* 動態帶入咗第二行,原本第二行嘅嘢順延落第三行 */
#todaypanel { grid-row: 3; }
.rightcol { grid-row: 3; }

/* ── 區塊外框(今日/收件箱/持續跟進共用)──────────── */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(16, 18, 22, .04);
  position: relative;
}
.rightcol { display: flex; flex-direction: column; gap: 1rem; }

/* 視覺執法 5:「任務收件箱」「持續跟進」同「今日」平級,深色唔准灰 */
.panel-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 .875rem;
}
.panel-head svg { flex: none; }
/* 視覺執法 5 補強:結構性隔離,唔靠 inherit——同「今日」#count 一模一樣色同粗度,
   唔准畀圖示嘅 opacity 或者任何嘢連累個標題睇落灰咗。 */
.zone-title, #count { color: var(--ink) !important; font-weight: 700 !important; }
.count-badge {  /* H3:未讀數用灰 badge,唔准用紅 */
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: .05rem .45rem;
  font-variant-numeric: tabular-nums;
}

/* ── 三區顯示制:展開/摺疊/隱藏(D68)──────────────── */
.zone-tools { margin-left: auto; display: flex; gap: .1rem; }
.zone-btn {
  width: 22px; height: 22px;
  border: 0; background: none; padding: 0;
  border-radius: 5px;
  color: var(--muted);      /* 箭嘴灰色細,唔搶戲(D64) */
  cursor: pointer;
  display: grid; place-items: center;
}
.zone-btn svg { width: 14px; height: 14px; }
.zone-btn:hover { color: var(--ink); background: var(--page); }

.zone-body { overflow: hidden; transition: max-height 200ms ease, opacity 160ms ease; }
.zone.collapsed .zone-body { max-height: 0; opacity: 0; margin-top: -.875rem; }
.zone.collapsed .panel-head { margin-bottom: 0; }
.zone.collapsed [data-act="collapse"] svg { transform: rotate(-90deg); }

/* ── 公司行程藍帶(D21;4d 先駁 Google)────────────── */
.daystrip {
  background: var(--band-bg);
  color: var(--band-ink);
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: 13.5px;
  margin-bottom: .75rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.daystrip b { font-weight: 600; }
.daystrip.placeholder { opacity: .55; }

/* ── 任務卡 ───────────────────────────────────── */
.tasks { display: flex; flex-direction: column; gap: .5rem; }
.scroller { max-height: 21rem; overflow-y: auto; }  /* D56:超出用真滾動條 */

.task {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .7rem .8rem;
  transition: border-color var(--step) ease, box-shadow var(--step) ease;
}
.task:hover { border-color: #DADCE1; box-shadow: 0 1px 3px rgba(16, 18, 22, .06); }
.task.is-first { border-color: var(--p1); }        /* D64-4:准用色嘅四處之一 */
.task.urgent { border-color: var(--urgent); }      /* 收件箱緊急橙卡 */

.grip { flex: none; width: 10px; height: 16px; color: var(--grip); cursor: grab; }
.task.dragging { opacity: .4; }

/* ── 優先級:8px 細點 + 灰色細數字(D64-1)─────────── */
.rank { flex: none; display: inline-flex; align-items: center; gap: .3rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.rank .num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* D73:色點本身係掣,撳落彈四色揀 */
.dot-wrap {
  border: 0; background: none; padding: 4px;
  margin: -4px;
  cursor: pointer;
  display: grid; place-items: center;
  border-radius: 50%;
}
.dot-wrap:hover { background: var(--page); }
/* 四行制:用返表格同詳情面板嗰套藥丸樣式(D88),三處一致 */
.quad-picker {
  top: calc(100% + 4px);
  left: -8px;
  width: 10.5rem;
  padding: .3rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
/* 要夠specific 先贏得過上面 .menu button 嗰條(佢設咗 border-radius:6px) */
.menu.quad-picker .quad-choice {
  width: 100%;
  justify-content: flex-start;
  white-space: nowrap;
  border-radius: 999px;
  font-size: 12px;
  padding: .38rem .55rem;
}
.swatch-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.swatch-dot.q-red { background: var(--quad-red); }
.swatch-dot.q-yellow { background: var(--quad-yellow); }
.swatch-dot.q-grey { background: var(--quad-grey); }
.swatch-dot.q-none { background: none; border: 1.5px solid var(--quad-none); } /* 不緊急不重要 = 空圈 */

/* D92 未設定:留返個位對齊,但唔畫嘢——卡上真係冇點,同「非緊急次要」嘅空心圈分得開 */
.swatch-dot.q-unset { background: none; border: 0; }
.dot.q-unset { background: none; border: 0; }

/* D71:色點永遠 display 四格身份色,同「第1位」焦點邊框(is-first)分開,一卡兩訊號 */
.dot.q-red    { background: var(--quad-red); }
.dot.q-yellow { background: var(--quad-yellow); }
.dot.q-grey   { background: var(--quad-grey); }
.dot.q-none   { background: var(--quad-none); }

/* 任務名基本樣式(收件箱/持續跟進用呢個——正常字重,唔搶今日欄嘅戲) */
.title { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 400; color: var(--ink); }

/* 三層字級階梯:今日第 1 位最大(焦點)→ 今日第 2 位打後中等 → 右柱最細 */
#tasks .title { font-size: 15.5px; font-weight: 600; }
#tasks .task.is-first .title { font-size: 19px; }
/* 持續跟進嘅「等待邊個」要另起一行,唔好貼喺標題後面(照 mockup) */
.substat { display: block; }

/* 跨格拖轉象限嘅提示字(D69) */
.quad-flash {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  animation: flashfade 1.6s ease forwards;
}
@keyframes flashfade { 0%,70% { opacity: 1; } 100% { opacity: 0; } }

/* ── 狀態 chip:一律灰(D64-3)─────────────────────── */
/* 配角壓細壓灰(視覺執法 2 加碼):主角要着燈,配角要熄燈,對比先出得嚟 */
.chip {
  flex: none;
  font-size: 10.5px;
  padding: .1rem .4rem;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--tag-bg);
  color: #9198A1;
}
/* 4a:等待到期係「要你即刻理」嘅訊號,唔可以同其餘灰 chip 一樣咁靜。
   D64-4 准用色嘅位置有限,呢粒借用逾期橙卡同一套橙,唔開新色。 */
.chip.chip-due { background: #FBEADF; color: #A8541C; font-weight: 600; }
.substat { font-size: 11.5px; color: var(--muted); margin-top: .1rem; }

/* 4a 詳情面板嘅「等待設定」一組:同其餘欄位分開,一睇就知係一組嘢 */
.wait-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .6rem .7rem .3rem;
  margin-bottom: .7rem;
  background: var(--page);
}
.wait-head { font-size: 12px; color: var(--muted); margin-bottom: .5rem; }
.wait-hint { font-size: 11.5px; color: var(--muted); margin: .1rem 0 .5rem; line-height: 1.5; }

/* ── 剔圈三步戲(D23/D36)───────────────────────── */
/* 視覺執法 3:最易撳嘅嘢要最就手,26px 加大到 34px */
.tick {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--tick-line);
  background: none;
  display: grid; place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background-color var(--step) ease, border-color var(--step) ease;
}
.tick svg { width: 18px; height: 18px; }
.tick path {
  stroke: var(--tick-ghost);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: stroke var(--step) ease;
}
.tick:hover { border-color: var(--tick-done); }
.tick:hover path { stroke: #A8B0B8; }
.tick:focus-visible { outline: 2px solid var(--tick-done); outline-offset: 2px; }
.task.is-first .tick { border-color: var(--p1); }

.task.ticking .tick {
  background: var(--tick-done);
  border-color: var(--tick-done);
  animation: bounce var(--step) ease;
}
.task.ticking .tick path { stroke: #fff; }
@keyframes bounce {
  0% { transform: scale(1); }
  55% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* 完成今日部分:淺綠外圈包住灰色剔——整件事未完,今日嗰份完咗 */
.task.ticking-part .tick {
  background: var(--tick-part-bg);
  border-color: var(--tick-part);
  border-width: 2px;
  animation: bounce var(--step) ease;
}
.task.ticking-part .tick path { stroke: var(--tick-ghost); }

.task.leaving {
  transform: translateX(115%);
  opacity: 0;
  transition: transform 240ms cubic-bezier(.4, 0, .6, 1), opacity 200ms ease;
}
.task-slot { display: block; }
.task-slot.collapsing {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 160ms ease, opacity 100ms ease;
}

/* ── 剔圈箭嘴下拉(D47,只留「完成今日部分」一式)──── */
.chev-wrap { position: relative; flex: none; }
.chev {
  width: 18px; height: 18px;
  border: 0; background: none; padding: 2px;
  color: var(--muted);
  cursor: pointer;
  display: grid; place-items: center;
  border-radius: 4px;
}
.chev:hover, .chev[aria-expanded="true"] { color: var(--ink); background: var(--page); }

.menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  width: 15.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(16, 18, 22, .12);
  padding: .4rem;
}
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: .5rem .6rem;
  border: 0; background: none;
  border-radius: 6px;
  font: inherit; font-size: 13.5px;
  cursor: pointer;
  color: var(--ink);
}
.menu button:hover { background: var(--page); }
.menu button .sub { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
/* D97:刪除保留安全網(可喺「已刪除」翻查),但都係破壞性動作,hover 用淡紅色提醒 */
.menu button[data-act="delete"]:hover { background: #FBECEF; color: #B3384E; }
.menu .part-row { display: flex; align-items: center; gap: .75rem; }
.menu .part-text { flex: 1 1 auto; }
.menu .part-tick {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--tick-part);
  background: var(--tick-part-bg);
  display: grid; place-items: center;
}
.menu .part-tick svg { width: 14px; height: 14px; }
.menu .part-tick path {
  stroke: var(--tick-ghost);
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; fill: none;
}
.menu textarea {
  width: 100%;
  margin-top: .4rem;
  padding: .4rem .5rem;
  font: inherit; font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
  min-height: 2.6em;
}
.menu .confirm {
  margin-top: .4rem;
  background: var(--prog-fill);
  color: #fff;
  text-align: center;
  font-weight: 600;
}

/* D75:雙擊任務名變輸入框 */
.title-edit {
  width: 100%;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  border: 1px solid var(--band-bg);
  border-radius: 5px;
  padding: .1rem .3rem;
  background: var(--card);
}

/* D74:詳情面板 */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(16, 18, 22, .35);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--card);
  border-radius: 14px;
  padding: 1.25rem;
  width: 22rem;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(16, 18, 22, .25);
}
.modal h3 { margin: 0 0 .875rem; font-size: 16px; color: var(--ink); }
.modal label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: .7rem;
}
.modal label input, .modal label select, .modal label textarea {
  display: block;
  width: 100%;
  margin-top: .25rem;
  padding: .45rem .55rem;
  font: inherit; font-size: 13.5px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
}
.modal label textarea { min-height: 3.5em; resize: vertical; }
.modal-actions { display: flex; gap: .5rem; margin-top: .25rem; }
.modal-actions button {
  flex: 1;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
}
.modal-actions .confirm { background: var(--prog-fill); color: #fff; border-color: var(--prog-fill); }

/* 今日欄設定下拉(D69):一行過,左文字右藥丸開關 */
.menu .toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .5rem .6rem;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink);
}
.menu .toggle-row:hover { background: var(--page); border-radius: 6px; }
.pill-switch {
  flex: none;
  position: relative;
  width: 34px; height: 20px;
  border-radius: 999px;
  background: #D3D7DD;
  transition: background 160ms ease;
}
.pill-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16,18,22,.2);
  transition: transform 160ms ease;
}
.toggle-row input:checked + .pill-switch { background: var(--prog-fill); }
.toggle-row input:checked + .pill-switch::after { transform: translateX(14px); }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }

/* 「預設加入位置」開關:向左定向右揀兩個對等選項,唔係開/關,
   所以特登唔用返上面嗰條綠色規矩——兩邊永遠灰色 */
.toggle-row input:checked + .pill-switch.neutral { background: #D3D7DD; }
.place-toggle-row { justify-content: center; gap: .5rem; }
.place-toggle-label { font-size: 12px; color: var(--muted); }
.place-toggle-row:has(input:checked) .place-toggle-label:first-of-type,
.place-toggle-row:not(:has(input:checked)) .place-toggle-label:last-of-type { color: var(--muted); font-weight: 400; }
.place-toggle-row:has(input:checked) .place-toggle-label:last-of-type,
.place-toggle-row:not(:has(input:checked)) .place-toggle-label:first-of-type { color: var(--ink); font-weight: 700; }

/* D92 加入位置藥丸:一行過、全灰色系——呢排掣講「去邊度」,
   唔准借用四格身份嗰套顏色,兩條軸唔可以撞訊號。 */
.cap-places { display: flex; flex-wrap: nowrap; gap: .3rem; }
.place-choice {
  flex: 0 1 auto;
  white-space: nowrap;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 11.5px;
  padding: .3rem .5rem;
  cursor: pointer;
}
.place-choice:hover { background: var(--page); }
.place-choice.picked {
  background: #DFE3E8;
  border-color: var(--quad-grey);
  color: var(--ink);
  font-weight: 700;
}
.cap-place-row { align-items: center; }
.cap-place-date input[type="date"] { margin-left: auto; }

/* 今日欄設定下拉入面嗰個「預設加入位置」 */
.menu .menu-sep { height: 1px; background: var(--line); margin: .35rem 0; }
.menu .setting-row {
  display: flex; flex-direction: column; gap: .35rem;
  padding: .3rem .4rem; font-size: 12.5px; color: var(--ink);
}
/* 要夠 specific 先贏得過上面 .menu button(設咗 border-radius:6px/width:100%),
   同 D73 色點選單嗰個 .menu.quad-picker .quad-choice 係同一個成因 */
.menu .setting-row .place-choice {
  display: inline-block;
  width: auto;
  border-radius: 999px;
}

/* D77 新增任務表格 */
.capture { flex-direction: column; align-items: stretch; gap: .6rem; border-radius: 14px; padding: .9rem; }
/* 任務名稱係主角:大字、清楚邊框、focus 有明顯反應。
   其餘欄位一律細細哋,唔准同佢爭。 */
.cap-title {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  outline: 0;
  font: inherit; font-size: 17px; font-weight: 600;
  color: var(--ink);
  background: var(--card);
  padding: .55rem .7rem;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.cap-title::placeholder { color: #B4B9C1; font-weight: 500; }
.cap-title:focus {
  border-color: var(--capture);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, .12);
}

/* 重要性下拉:睇落同「分派給」個 select 一樣,但保留色點 */
.quad-select { flex: 1; position: relative; }
.quad-select-btn {
  width: 100%;
  display: flex; align-items: center; gap: .4rem;
  padding: .35rem .45rem;
  font: inherit; font-size: 12.5px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  cursor: pointer;
  text-align: left;
}
.quad-select-btn svg { width: 13px; height: 13px; margin-left: auto; opacity: .6; flex: none; }
.quad-select-btn:hover { background: var(--page); }
.quad-select-label { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.quad-select .menu { top: calc(100% + 4px); left: 0; right: auto; width: 100%; }

.cap-quads { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
/* D88 藥丸式:每粒掣自己有淺色底,揀中咗就深啲 + 加框。
   一眼分得出係邊格,唔使靠嗰粒細點——中文長短唔一,圓形會變橢圓,所以用藥丸。 */
.quad-choice {
  display: flex; align-items: center; gap: .4rem;
  padding: .38rem .55rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: inherit; font-size: 12px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.quad-choice[data-q="紅"]   { background: #FBEAE3; color: #A8421C; }
.quad-choice[data-q="黃"]   { background: #FBF0DC; color: #8A6427; }
.quad-choice[data-q="灰"]   { background: #EDEFF2; color: #5C636D; }
.quad-choice[data-q="無色"] { background: var(--card); color: var(--muted); border-color: var(--line); }
.quad-choice:hover { filter: brightness(.97); }
.quad-choice.picked { font-weight: 700; }
.quad-choice[data-q="紅"].picked   { background: #F6D5C7; border-color: var(--quad-red); }
.quad-choice[data-q="黃"].picked   { background: #F7E3BE; border-color: var(--quad-yellow); }
.quad-choice[data-q="灰"].picked   { background: #DFE3E8; border-color: var(--quad-grey); }
.quad-choice[data-q="無色"].picked { background: var(--page); border-color: var(--quad-grey); color: var(--ink); }

.cap-row {
  display: flex; align-items: center; gap: .5rem;
  font-size: 12.5px; color: var(--muted);
}
.cap-row select, .cap-row input[type="date"] {
  flex: 1;
  padding: .35rem .45rem;
  font: inherit; font-size: 12.5px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
}
.cap-row.cap-note { align-items: flex-start; }
.cap-row textarea {
  flex: 1;
  padding: .35rem .45rem;
  font: inherit; font-size: 12.5px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 2.6em; resize: vertical;
  background: var(--card);
}
.cap-more-btn {
  align-self: flex-start;
  display: flex; align-items: center; gap: .25rem;
  border: 0; background: none; padding: .15rem 0;
  font: inherit; font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}
.cap-more-btn:hover { color: var(--ink); }
.cap-more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.cap-more { display: flex; flex-direction: column; gap: .5rem; }
.cap-actions { display: flex; gap: .5rem; }
.cap-actions button {
  flex: 1;
  padding: .45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit; font-weight: 600; font-size: 13px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.cap-actions .cap-submit { background: var(--capture); border-color: var(--capture); color: #fff; }

/* 詳情面板嘅四格掣欄(唔用 select,因為 option 裝唔到色點) */
.modal-field { font-size: 12px; color: var(--muted); margin-bottom: .7rem; }
.modal-field .cap-quads { margin-top: .25rem; }

/* ── 拖動接駁柱(D53):照 mockup 做——格仔近正方形、圖示喺上文字喺下,
   頂部「放呢度」標題,分配格頭像常駐顯示。
   佢係 grid 一欄(見上面 .dock 定位),唔係浮喺畫面上面,所以永不蓋住收件箱。 ── */
.dock { display: flex; flex-direction: column; gap: .4rem; }
.dock-head {
  margin: 0 0 .1rem;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}
.dock-slot {
  border: 1.5px dashed #C9CDD4;   /* D64:虛線格灰 */
  border-radius: 12px;
  background: var(--card);
  min-height: 66px;
  padding: .55rem .4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.dock-ico { width: 17px; height: 17px; flex: none; opacity: .75; }
.dock-slot.over {
  border-color: var(--prog-fill);
  border-style: solid;
  background: #EDF7F1;
  color: var(--prog-fill);
  font-weight: 600;
}
.dock-slot.over .dock-ico { opacity: 1; }
.dock-gap { height: .5rem; }
.dock-cancel { border-color: #E4A9B4; color: #B3384E; }  /* D64:取消格紅框 */
.dock-cancel.over { border-color: #B3384E; background: #FBECEF; color: #B3384E; }

/* 分配格:同事頭像牌常駐顯示(照 mockup),唔使拖上去先展開。唔顯示自己(D53) */
.dock-assign { min-height: 78px; }
.dock-people { display: flex; justify-content: center; gap: .28rem; }
.dock-person {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 11.5px; font-weight: 600;
  display: grid; place-items: center;
  border: 1.5px solid transparent;
}
.dock-person.over { border-color: var(--prog-fill); background: #DCF0E5; color: var(--prog-fill); }

/* 詳情面板嘅唯讀欄(D78 來源日期鎖死) */
.modal label.readonly input {
  background: var(--page);
  color: var(--muted);
  cursor: not-allowed;
}

/* ── 進度條(D28/D37;D64-4 准用色四處之一)────────── */
.progress {
  margin-top: 1rem;
  width: 62%;
  min-width: 14rem;
  background: var(--prog-bg);
  border-radius: 10px;
  padding: .625rem .875rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
/* 視覺執法 4:大%收斂,份量唔准大過任務名 */
.pct { font-size: 14px; font-weight: 600; color: var(--prog-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.progress-right { flex: 1 1 auto; min-width: 0; }
.track { height: 6px; background: var(--prog-track); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--prog-fill); border-radius: 999px; transition: width 320ms ease; }
.progress-note { margin-top: .25rem; font-size: 12px; color: #5E7A6C; font-variant-numeric: tabular-nums; }
.progress.allclear { animation: allclear 620ms ease; }
@keyframes allclear {
  0% { transform: scale(1); }
  35% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ── 加任務掣(D46;D64-4 准用色四處之一)──────────── */
.fab {
  position: absolute;
  right: 1rem;
  bottom: -1.25rem;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--capture);
  color: #fff;
  font-size: 25px;
  line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(37, 211, 102, .35);
  cursor: pointer;
  transition: transform 120ms ease;
  z-index: 3;
}
.fab:hover { transform: scale(1.06); }

/* D92 新增任務改做畫面正中彈出視窗——同詳情面板同一套規矩 */
.capture-overlay {
  position: fixed; inset: 0;
  background: rgba(16, 18, 22, .35);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.capture {
  display: flex;
  width: 25rem;
  max-width: calc(100vw - 2rem);
  background: var(--card);
  border: 1.5px solid var(--capture);
  box-shadow: 0 12px 32px rgba(16, 18, 22, .22);
}

/* 加任務掣下面嘅快捷鍵提示——唔使人記,擺喺眼前 */
.fab-hint {
  position: absolute;
  right: -.4rem; bottom: -2.7rem;
  width: 62px;
  text-align: center;
  white-space: nowrap;
  font-size: 10px;
  color: var(--muted);
  pointer-events: none;
  z-index: 3;
}
.cap-actions .cap-submit .cap-kbd {
  margin-left: .4rem;
  font-size: 10.5px;
  color: #fff;
  opacity: .85;
}

.empty { color: var(--muted); padding: .75rem .25rem; font-size: 13.5px; }

/* ── 提示訊息(P4:唔准靜死)──────────────────────── */
.toast {
  position: fixed;
  left: 50%; bottom: 2rem;
  transform: translateX(-50%);
  background: #2B2E33;
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: 0 6px 20px rgba(16, 18, 22, .25);
  z-index: 50;
}

/* ── 登入 ─────────────────────────────────────── */
.login { max-width: 320px; margin: 5rem auto; }
.login h1 { font-size: 20px; margin: 0 0 1rem; }
.login input {
  display: block; width: 100%;
  margin-bottom: .5rem;
  padding: .55rem .7rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.login input:focus-visible { outline: 2px solid var(--band-bg); outline-offset: 1px; }
.login button {
  width: 100%;
  padding: .55rem;
  font: inherit; font-weight: 600;
  color: #fff; background: var(--prog-fill);
  border: 0; border-radius: 8px; cursor: pointer;
}
.err { color: #B3384E; font-size: 13px; min-height: 1.2em; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── 4c 週報告(R-A5/E4/F2/G7)──────────────────────── */
.modal.modal-wide { width: 27rem; max-height: 82vh; overflow-y: auto; }
.rp-range { font-size: 12px; color: var(--muted); margin: -.5rem 0 1rem; }
.rp-sec { margin-bottom: 1rem; }
.rp-head { font-size: 12px; color: var(--muted); margin-bottom: .4rem; }

.scoreboard { display: flex; flex-direction: column; gap: .2rem; }
.score-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .5rem; border-radius: 8px; font-size: 13.5px;
}
.score-row.is-me { background: var(--page); font-weight: 600; }
.score-name { flex: 1 1 auto; }
.score-num { font-variant-numeric: tabular-nums; color: var(--muted); }
.score-row.is-me .score-num { color: var(--ink); }

.rp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.rp-list li {
  display: flex; align-items: baseline; gap: .5rem;
  font-size: 13px; padding: .3rem .5rem; border-radius: 8px; background: var(--page);
}
/* 日數係「拖咗幾耐/仲有幾耐」,用等寬數字對齊,一眼掃得到 */
.rp-days {
  flex: none; font-size: 11px; font-variant-numeric: tabular-nums;
  color: #A8541C; background: #FBEADF; border-radius: 999px; padding: .05rem .4rem;
}
.rp-days.urgent { color: #B3384E; background: #FBECEF; font-weight: 700; }
.rp-meta { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.rp-list li.rp-none { background: none; color: var(--muted); font-size: 12.5px; }

.modal-check { display: flex; align-items: center; gap: .45rem; font-size: 13px; color: var(--ink); margin-bottom: .7rem; }
.modal-check input { width: auto; }

/* ── 4d 公司行程帶(方案B 兩行式)+ 月視圖 ──────────────── */
.daystrip { display: block; padding: .55rem .75rem .5rem; }
.daystrip-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .25rem; }
.daystrip-count { font-size: 12px; opacity: .75; }
.daystrip-tools { margin-left: auto; display: inline-flex; gap: .35rem; }
.daystrip-btn {
  flex: none; width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(53, 86, 158, .35);
  background: rgba(255, 255, 255, .5);
  color: var(--band-ink);
  font-size: 14px; line-height: 1;
  display: grid; place-items: center;
  cursor: pointer; padding: 0;
}
.daystrip-btn svg { width: 13px; height: 13px; }
.daystrip-btn:hover { background: #fff; }

/* 方案B:時間軸兩行式。最多露 3 行(3 × 1.5em),多咗自己滾動。
   D162 改成成日時間軸之後行數會多好多,但**條帶高度維持唔變**——
   全部喺入面捲,唔准食今日欄嘅位。 */
/* position:relative — 唔加嘅話入面啲嘢 offsetTop 會跳去上面成塊板做參照。
   唔用 scroll-behavior:smooth——一開頁定位「現在」線唔係用戶捲嘅,
   要即刻到位,唔係會見到佢由頂慢慢滑落去,樣衰兼慢。 */
.evt-list { max-height: calc(3 * 1.55em); overflow-y: auto; position: relative; }

/* D162 過咗嘅行程:淡色但照睇得到。舊規矩係直接隱藏,結果夜晚睇=「今日沒有行程」 */
.evt-past { opacity: .45; }
.evt-past:hover { opacity: .75; }

/* D162「現在」線:同 Google Maps 嗰種「你而家喺呢度」一樣,
   一眼睇到而家幾點、之後仲有咩。一開頁自動捲到呢條線。 */
.evt-now {
  display: flex; align-items: center; gap: .45rem;
  line-height: 1.55;
  color: #C0392B;
}
.evt-now-time {
  flex: none; width: 2.9em;
  font-variant-numeric: tabular-nums; font-size: 11.5px; font-weight: 600;
}
.evt-now-line {
  flex: 1; height: 0; border-top: 1.5px solid currentColor; opacity: .7;
  position: relative;
}
.evt-now-line::before {
  content: ''; position: absolute; left: -3px; top: -3px;
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.evt-row { display: flex; align-items: baseline; gap: .45rem; line-height: 1.55; }
.evt-time { flex: none; width: 2.9em; font-variant-numeric: tabular-nums; font-size: 12.5px; opacity: .75; }
.evt-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; align-self: center; }
.dot-hr   { background: #2F9E68; } /* 綠=人事及AI(寫得入) */
.dot-main { background: #35569E; } /* 藍=營運(只讀) */
.evt-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt-none { opacity: .75; font-size: 13px; }
.daystrip-warn { font-size: 12px; opacity: .8; }

/* 月視圖:全螢幕 Google 式,格仔入面直接見行程名 */
.modal.month-modal {
  width: min(96vw, 1150px);
  max-height: 92vh;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.25rem;
}
.month-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.month-head h3 { margin: 0; font-size: 17px; }
.month-legend { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: .3rem; }
.month-nav { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; }
.month-nav .chev { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; }
.month-today {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; font: inherit; font-size: 12.5px; padding: .2rem .7rem; cursor: pointer;
}
.month-today:hover { background: var(--page); }
.month-grid-head {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
  font-size: 11.5px; color: var(--muted); text-align: center; margin-bottom: 3px;
}
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mv-cell {
  min-height: 92px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .3rem .35rem;
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden;
}
.mv-blank { background: none; border-color: transparent; }
.mv-today { border-color: var(--p1); border-width: 1.5px; }
.mv-today .mv-num { color: var(--p1); font-weight: 700; }
.mv-num { font-size: 12px; color: var(--muted); line-height: 1.2; }
.mv-evt {
  font-size: 11.5px; line-height: 1.35;
  padding: .05rem .3rem; border-radius: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mv-evt b { font-weight: 600; font-variant-numeric: tabular-nums; }
.mv-hr   { background: #E4F2E9; color: #1F4D38; } /* 綠系=人事及AI */
.mv-main { background: #E8EFFA; color: #2B4E8C; } /* 藍系=營運 */
.mv-more { font-size: 11px; color: var(--muted); cursor: pointer; padding-left: .3rem; }
.mv-more:hover { color: var(--ink); }
.mv-expanded { overflow: visible; min-height: 0; height: auto; }

/* ── D133 收埋左欄:淨返今日欄,望嘢集中啲 ──────────────── */
.nav-hide-btn {
  margin-left: auto; flex: none;
  width: 20px; height: 20px;
  border: 0; background: none; padding: 0;
  color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
  border-radius: 5px;
}
.nav-hide-btn svg { width: 14px; height: 14px; }
.nav-hide-btn:hover { background: var(--page); color: var(--ink); }

/* 收埋之後:第一欄歸零,左欄唔佔位。今日欄照舊鎖 640px,唔會被扯闊 */
.shell.nav-hidden { grid-template-columns: 0px minmax(0, 640px) 280px 0px minmax(0, 1fr); }
.shell.nav-hidden.dock-open { grid-template-columns: 0px minmax(0, 640px) 280px 116px minmax(0, 1fr); }
.shell.nav-hidden.no-right { grid-template-columns: 0px minmax(0, 640px) 0px 0px minmax(0, 1fr); }
.shell.nav-hidden.no-right.dock-open { grid-template-columns: 0px minmax(0, 640px) 0px 116px minmax(0, 1fr); }
.shell.nav-hidden .sidebar { display: none; }

/* 叫返左欄出嚟嗰粒:貼左上角,細細粒唔阻眼 */
.nav-show-btn {
  position: absolute;
  left: .5rem; top: 1.35rem;
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  display: grid; place-items: center;
  z-index: 4;
}
.nav-show-btn svg { width: 15px; height: 15px; }
.nav-show-btn:hover { color: var(--ink); background: var(--page); }
.shell { position: relative; }

/* 揀日子月曆(D132):同月視圖同一套外觀,但格仔細啲、淨係揀日 */
.modal.pickdate-modal { width: 22rem; }
.pd-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: .5rem; }
.pd-day {
  aspect-ratio: 1 / 1;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--card);
  font: inherit; font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
}
.pd-day:hover:not(:disabled) { background: #E8EFFA; border-color: #B5D4F4; }
.pd-blank { background: none; cursor: default; }
.pd-past { color: #C7CBD1; cursor: not-allowed; }
.pd-today { border-color: var(--p1); color: var(--p1); font-weight: 700; }

/* ── H2 報告問題:似對話框嘅輸入面板 ──────────────────── */
.modal.issue-modal { width: 24rem; }
.issue-hint { font-size: 12px; color: var(--muted); margin: -.4rem 0 .8rem; line-height: 1.6; }
.issue-thread { margin-bottom: .6rem; }
.issue-bubble {
  font-size: 13px; line-height: 1.55;
  padding: .5rem .7rem;
  border-radius: 12px 12px 12px 3px;
  background: var(--page);
  color: var(--ink);
  max-width: 88%;
}
.issue-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px 12px 3px 12px;
  padding: .55rem .7rem;
  font: inherit; font-size: 14px;
  resize: vertical;
  margin-bottom: .5rem;
}
.issue-input:focus { outline: none; border-color: var(--capture); box-shadow: 0 0 0 3px rgba(37,211,102,.12); }

/* ── E3 全清大獎勵:100% 先觸發,99% 唔准預支 ──────────── */
.celebrate {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  pointer-events: auto;
  z-index: 200;
  background: rgba(16, 18, 22, .18);
  animation: celebrate-in 240ms ease;
}
@keyframes celebrate-in { from { opacity: 0 } to { opacity: 1 } }
.celebrate-card {
  background: var(--card);
  border-radius: 18px;
  padding: 1.6rem 2.2rem;
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  box-shadow: 0 16px 44px rgba(16, 18, 22, .22);
  animation: celebrate-pop 520ms cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes celebrate-pop {
  0% { transform: scale(.7); opacity: 0 }
  60% { transform: scale(1.04) }
  100% { transform: scale(1); opacity: 1 }
}
.celebrate-card b { font-size: 19px; }
.celebrate-card span { font-size: 13px; color: var(--muted); }
.celebrate-tick {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--prog-bg);
  display: grid; place-items: center;
  margin-bottom: .3rem;
}
.celebrate-tick svg { width: 30px; height: 30px; fill: none; stroke: var(--prog-fill); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.confetti {
  position: absolute; top: -14px;
  width: 8px; height: 13px; border-radius: 2px;
  animation: confetti-fall 2.4s linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1 }
  100% { transform: translateY(105vh) rotate(560deg); opacity: 0 }
}

/* ── R-D 項目模組(實用版)──────────────────────────── */
.modal.proj-modal { width: 30rem; max-height: 86vh; overflow-y: auto; }
.proj-hint { font-size: 12px; color: var(--muted); margin: -.4rem 0 .9rem; line-height: 1.6; }
.proj-setup { font-size: 13.5px; line-height: 1.7; margin: -.2rem 0 .5rem; }
.proj-setup-hint { font-size: 12px; color: var(--muted); margin: 0 0 .6rem; }
.proj-list { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .9rem; }
.proj-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .55rem .7rem;
  background: var(--card);
}
/* D1:冇下一步行動 = 標紅。呢個係四處准用色以外嘅第五處,但佢係規矩明文要求嘅警示 */
.proj-row.proj-alert { border-color: #E4A9B4; background: #FDF7F8; }
.proj-main { display: flex; align-items: baseline; gap: .5rem; }
.proj-name { font-size: 14px; font-weight: 600; }
.proj-done {
  font-size: 10.5px; color: var(--prog-ink); background: var(--prog-bg);
  border-radius: 999px; padding: .05rem .4rem;
}
.proj-count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.proj-next { font-size: 12.5px; color: var(--ink); margin-top: .15rem; display: flex; align-items: baseline; gap: .4rem; }
.proj-warn { color: #B3384E; font-weight: 600; }
.proj-muted { color: var(--muted); }
.proj-tools { display: flex; gap: .35rem; margin-top: .45rem; }
.proj-btn {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; font: inherit; font-size: 11.5px;
  color: var(--muted); padding: .15rem .6rem; cursor: pointer;
}
.proj-btn:hover { background: var(--page); color: var(--ink); }
.proj-new { display: flex; gap: .4rem; margin-bottom: .5rem; }
.proj-new input {
  flex: 1 1 auto; border: 1.5px solid var(--line); border-radius: 9px;
  padding: .45rem .6rem; font: inherit; font-size: 13.5px;
}
.proj-new input:focus { outline: none; border-color: var(--capture); box-shadow: 0 0 0 3px rgba(37,211,102,.12); }
.proj-add {
  flex: none; border: 1px solid var(--capture); background: var(--capture); color: #fff;
  border-radius: 9px; font: inherit; font-size: 13px; padding: .45rem .9rem; cursor: pointer;
}

/* ── D139 日期導覽:睇明天、後天……冇上限 ──────────────── */
.day-sun {
  border: 0; background: none; padding: 0; margin: 0;
  display: inline-grid; place-items: center; cursor: default;
  width: 17px; height: 17px;
}
.day-sun.back-today { cursor: pointer; border-radius: 50%; box-shadow: 0 0 0 3px rgba(216,90,48,.16); }
.day-nav { display: inline-flex; gap: .1rem; margin-left: .35rem; }
.day-arrow {
  width: 20px; height: 20px; padding: 0;
  border: 0; background: none; color: var(--muted);
  border-radius: 5px; cursor: pointer;
  display: grid; place-items: center;
}
.day-arrow svg { width: 14px; height: 14px; }
.day-arrow:hover { background: var(--page); color: var(--ink); }
/* 睇緊第日:成塊板加條淡邊,一眼知道唔係今日 */
#todaypanel.future-day { box-shadow: inset 0 0 0 1.5px #C9DBF7; }

/* ── D141 行程負責人 + 行程詳情 ──────────────────────── */
.evt-row {
  width: 100%; text-align: left;
  border: 0; background: none; padding: 0; font: inherit;
  color: inherit; cursor: pointer;
  display: flex; align-items: baseline; gap: .45rem; line-height: 1.55;
  border-radius: 5px;
}
.evt-row:hover { background: rgba(255,255,255,.45); }
.evt-unassigned {
  flex: none; font-size: 10.5px; color: var(--band-ink);
  opacity: .6; border: 1px dashed currentColor; border-radius: 999px; padding: 0 .35rem;
}
.evt-row .person { transform: scale(.85); }
.ev-title { font-size: 16px; font-weight: 600; margin-bottom: .3rem; }
.ev-meta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: .35rem; margin-bottom: .6rem; }
.ev-owner { font-size: 13.5px; display: flex; align-items: center; gap: .4rem; margin-bottom: .3rem; }
.ev-none { color: var(--muted); }

/* ── D142 新增行程視窗執漏 ──────────────────────────── */
/* 剔號同文字要黐返埋:原本用 .modal-check 個 label 有 100% 闊度,粒剔飄咗去左邊 */
.ev-check {
  display: inline-flex !important; align-items: center; gap: .45rem;
  width: auto !important; font-size: 13.5px; margin-bottom: .7rem; cursor: pointer;
}
.ev-check input { width: auto !important; margin: 0; flex: none; }
.ev-check span { line-height: 1; }
/* 時間一行過,唔再上下兩行咁大舊 */
.ev-time-row { display: flex; align-items: center; gap: .3rem; margin-bottom: .45rem; }
.ev-time-label { font-size: 12px; color: var(--muted); width: 2.2rem; flex: none; }
.ev-time-row select {
  width: auto !important; flex: none;
  padding: .3rem .4rem; font-size: 13.5px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
.ev-colon { color: var(--muted); }
.ev-dur { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.ev-dur-bad { color: #B3384E; }
.ev-quick { display: flex; gap: .3rem; margin: .1rem 0 .7rem 2.2rem; }
.dur-pill {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; font: inherit; font-size: 11.5px;
  color: var(--muted); padding: .15rem .55rem; cursor: pointer;
}
.dur-pill:hover { background: var(--page); color: var(--ink); }
.dur-pill.picked { background: #DFE3E8; border-color: var(--quad-grey); color: var(--ink); font-weight: 700; }

/* ── D143 三態跟進燈:紅未看 / 黃已接收 / 綠已完成 ──────── */
.follow-lamp {
  flex: none; width: 7px; height: 7px; border-radius: 50%;
  align-self: center;
}
.lamp-unseen { background: #E24B4A; box-shadow: 0 0 0 3px rgba(226,75,74,.14); }
.lamp-seen   { background: #E3A73B; }
.lamp-done   { background: #2F9E68; }

/* ── D144 也許某天(右欄第三框)──────────────────────── */
/* D154:組名由死字變摺疊掣(三組各自收得埋),樣貌照舊——細字、灰、一條底線 */
.sd-group {
  display: flex; align-items: center; gap: .3rem;
  width: 100%;
  font: inherit; font-size: 11px; color: var(--muted);
  padding: .35rem .1rem .15rem;
  border: 0; border-bottom: 1px solid var(--line);
  margin-bottom: .2rem;
  background: none; text-align: left; cursor: pointer;
}
.sd-group:not(:first-child) { margin-top: .5rem; }
.sd-group:hover { color: var(--ink); }
.sd-group-issue { color: #A8541C; }
.sd-chev {
  width: 12px; height: 12px; flex: none;
  transition: transform .15s;
}
.sd-group.collapsed .sd-chev { transform: rotate(-90deg); }
.sd-group-name { flex: 1; }
.sd-group-count { font-variant-numeric: tabular-nums; opacity: .75; }
/* 組入面冇嘢:縮細啲、退後啲——係一句交代,唔係一件事 */
.sd-empty { font-size: 11.5px; padding: .15rem .1rem .3rem; }
.claim-btn {
  flex: none; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; font: inherit; font-size: 10.5px;
  color: var(--muted); padding: .1rem .45rem; cursor: pointer;
}
.claim-btn:hover { background: var(--page); color: var(--ink); }

/* ── D146 打卡:細細字,唔搶戲(D154 起黐喺月曆掣左邊)────────── */
.punch {
  font-size: 11.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── D150 載入失敗橫幅:唔准扮空白 ──────────────────── */
.load-error {
  grid-column: 2 / -1;
  display: flex; align-items: center; gap: .55rem;
  background: #FBECEF;
  border: 1px solid #E4A9B4;
  border-radius: 10px;
  padding: .55rem .75rem;
  font-size: 13px;
  color: #8A2B3E;
  margin-bottom: -.25rem;
}
.load-error svg { width: 16px; height: 16px; flex: none; }
.load-error-text { flex: 1 1 auto; }
.load-error-retry {
  flex: none;
  border: 1px solid #E4A9B4; background: #fff; color: #8A2B3E;
  border-radius: 999px; font: inherit; font-size: 12px;
  padding: .2rem .7rem; cursor: pointer;
}
.load-error-retry:hover { background: #FDF7F8; }
.load-error-retry:disabled { opacity: .6; cursor: default; }

/* ── D165 同事排程(唯讀)──────────────────────────────────
   件數行先:格底色深淺 = 逼唔逼。老闆問嘅係「派唔派得落」,
   所以要一眼掃到邊個滿哂,唔使逐格讀字。 */
.modal.team-modal { width: min(62rem, 94vw); max-height: 86vh; overflow: auto; }
.ts-wrap { overflow-x: auto; }
.ts-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.ts-table th, .ts-table td {
  border: 1px solid var(--line); vertical-align: top;
  padding: .35rem .4rem; text-align: left;
}
.ts-table thead th { background: var(--page); font-weight: 600; white-space: nowrap; }
.ts-wd { display: block; font-size: 11px; color: var(--muted); }
.ts-dd { display: block; font-variant-numeric: tabular-nums; }
.ts-corner { background: var(--page); }
.ts-name { white-space: nowrap; background: var(--page); font-weight: 600; }
.ts-name .person { transform: scale(.85); margin-right: .25rem; }
.ts-count { display: block; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: .15rem; }
.ts-item { display: block; font-size: 11.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 11ch; }
/* 私人:講數目,唔講內容 */
.ts-hidden { display: block; font-size: 11px; color: var(--muted); font-style: italic; }
.ts-0 { color: var(--muted); }
.ts-1 { background: rgba(47,158,104,.07); }
.ts-2 { background: rgba(227,167,59,.14); }
.ts-3 { background: rgba(192,57,43,.14); }
.ts-foot { font-size: 11.5px; color: var(--muted); margin-top: .6rem; }

/* ── D168 私人開關:同「負責人/由誰指派」歸一組(關邊個事)──────────
   要壓返 `.modal label input { display:block; width:100% }` 嗰條通用規則,
   唔壓嘅話個剔號會變成一條成行闊嘅嘢,飛咗去右邊,文字跌落下一行。 */
.priv-field { display: block; margin-bottom: .7rem; }
.modal .priv-line {
  display: flex; align-items: center; gap: .45rem;
  font-size: 13px; color: var(--ink); margin: .2rem 0 0;
}
.modal .priv-line input[type="checkbox"] {
  display: inline-block; width: auto; margin: 0; padding: 0;
  flex: none; accent-color: var(--capture);
}
.priv-note { margin: .3rem 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
/* 新增任務表格入面嗰個(窄啲,同其他 cap-row 一致)*/
.cap-private-row .priv-wrap { display: inline-flex; align-items: center; gap: .4rem; }
.cap-private-row input { width: auto; margin: 0; }
.priv-hint { font-size: 11.5px; color: var(--muted); }

/* ── D168 同事全景:四區一次過見晒 ──────────────────────── */
.ts-person {
  display: flex; align-items: center; gap: .3rem;
  border: 0; background: none; font: inherit; font-weight: 600; font-size: 12.5px;
  color: var(--ink); cursor: pointer; padding: 0; text-align: left; width: 100%;
}
.ts-person:hover { color: var(--capture); }
.ts-open { font-size: 10.5px; font-weight: 400; color: var(--muted); margin-left: auto; white-space: nowrap; }
.ts-person:hover .ts-open { color: var(--capture); }

.tm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.tm-sec { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; background: var(--card); }
.tm-sec h4 {
  margin: 0 0 .45rem; font-size: 12.5px; display: flex; align-items: center; gap: .4rem;
  padding-bottom: .35rem; border-bottom: 1px solid var(--line);
}
.tm-count { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 400; }
.tm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.tm-row { display: flex; align-items: baseline; gap: .4rem; font-size: 12.5px; line-height: 1.45; }
.tm-row .dot { flex: none; align-self: center; }
.tm-title { flex: 1 1 auto; min-width: 0; }
.tm-meta { flex: none; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tm-empty { font-size: 11.5px; margin: 0; }
/* 私人:講數目,唔講內容 */
.tm-hidden { margin: .45rem 0 0; font-size: 11px; color: var(--muted); font-style: italic; }
