/* TimeTree-like dark theme. Detail page mirrors docs/ref-timetree-*.png */
:root {
  --bg: #000;
  --panel: #111214;
  --card: #1a1b1e;
  --line: #26272b;
  --text: #f2f2f2;
  --muted: #8e8e93;
  --dim: #5f6066;
  --green: #2fb36d;
  --hl: #2fb36d;
  --sun: #ff6b6b;
  --sat: #5aa9ff;
  --warn: #f5b041;
  --hour: 52px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang HK", "Noto Sans HK", "Microsoft JhengHei", sans-serif;
  color: var(--text); -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
body.lock { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; }
#app { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
.dim { color: var(--muted); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 5; background: rgba(0,0,0,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top))) 10px 6px; }
.top-row { display: flex; align-items: center; gap: 6px; }
.top-row + .top-row { margin-top: 6px; }
.cal-name { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 16px; }
.sync-text { flex: 1; font-size: 11px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.ok { background: var(--green); }
.dot.err { background: var(--sun); }
.me { width: 32px; height: 32px; border-radius: 50%; background: #5b5c61; font-weight: 700; font-size: 13px; }
h1 { font-size: 18px; margin: 0; flex: 1; text-align: center; white-space: nowrap; }
.nav { font-size: 26px; width: 34px; height: 34px; border-radius: 10px; color: var(--muted); }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.pill.outbox { color: var(--warn); border-color: #4a3b15; }
.pill.warn { color: var(--warn); border-color: #4a3b15; }
.pill.outbox.bad { color: var(--sun); border-color: #5a1f1f; }
.seg { display: flex; background: var(--card); border-radius: 9px; padding: 2px; }
.seg button { padding: 3px 11px; border-radius: 7px; font-size: 13px; color: var(--muted); }
.seg button.on { background: #3a3b40; color: var(--text); font-weight: 700; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; scrollbar-width: none; }
.chip { flex: none; display: flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--card); }
.chip i { width: 8px; height: 8px; border-radius: 50%; }
.chip.off { opacity: .35; text-decoration: line-through; }
main { flex: 1; }

/* ---------- month ---------- */
.dow, .grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dow div { font-size: 11px; text-align: center; color: var(--muted); padding: 5px 0; }
.dow div:first-child { color: var(--sun); }
.dow div:last-child { color: var(--sat); }
.cell { min-height: 82px; border-top: 1px solid var(--line); padding: 2px 1px; overflow: hidden; cursor: pointer; }
.cell .n { font-size: 11px; display: inline-block; min-width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; margin: 0 0 1px 2px; }
.cell.sun .n { color: var(--sun); }
.cell.sat .n { color: var(--sat); }
.cell.out { opacity: .35; }
.cell.today .n { background: var(--text); color: #000; font-weight: 700; }
.cell.sel { background: #16171a; }
.bar { font-size: 10px; line-height: 15px; height: 15px; border-radius: 3px; padding: 0 3px; margin: 1px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.bar.cancel { opacity: .4; text-decoration: line-through; }
.bar.pending { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.22) 0 4px, transparent 4px 8px); }
.more { font-size: 10px; color: var(--muted); padding-left: 3px; }

.daylist { border-top: 8px solid var(--panel); padding: 8px 10px 24px; }
.daylist > h2 { font-size: 14px; margin: 6px 0 10px; color: var(--muted); font-weight: 600; }
.card { display: flex; align-items: stretch; gap: 10px; padding: 12px 4px; border-radius: 10px; background: transparent; margin: 0; text-align: left; width: 100%; color: inherit; }
.card:active { background: #1c1d21; }
.card .stripe { width: 3px; border-radius: 2px; flex: none; }
/* TimeTree 式：左邊開始／完結時間（上午／下午），全日 = 「全日」 */
.card .time { width: 64px; font-size: 13px; color: var(--muted); flex: none; line-height: 1.6; text-align: right; align-self: center; white-space: nowrap; }
.card .time b { color: var(--text, #f2f2f4); font-weight: 500; }
.card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.card .t { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .av.sm { width: 34px; height: 34px; font-size: 14px; align-self: center; background: #b5524a; }
.card .av.sm.none { background: transparent; }
.dayhead { padding: 4px 4px 10px; }
.dayhead h2 { font-size: 20px; font-weight: 800; color: var(--text, #f2f2f4); margin: 4px 0 0; }
.dayhead small { font-size: 14px; color: var(--muted); }
.card .t.strike { text-decoration: line-through; opacity: .6; }
.card .s { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .badges { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #2a2b30; color: #c9c9ce; }
.badge.warn { background: #3a2f12; color: var(--warn); }
.badge.ok { background: #12301f; color: #6ee7a0; }
.badge.no { background: #3a1616; color: #ff9b9b; }
.empty { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }

/* ---------- day ---------- */
.allday { padding: 6px 10px; border-bottom: 1px solid var(--line); display: flex; gap: 4px; flex-wrap: wrap; }
.allday .bar { font-size: 12px; height: 22px; line-height: 22px; padding: 0 8px; cursor: pointer; }
.timeline { position: relative; margin: 8px 6px 0 48px; }
.hour { height: var(--hour); border-top: 1px solid var(--line); position: relative; }
.hour span { position: absolute; left: -46px; top: -7px; font-size: 10px; color: var(--muted); width: 40px; text-align: right; }
.blk { position: absolute; border-radius: 6px; color: #fff; padding: 3px 6px; font-size: 11px; overflow: hidden; cursor: pointer; line-height: 1.3; }
.blk b { display: block; font-size: 12px; }
.blk.cancel { opacity: .4; text-decoration: line-through; }
.now { position: absolute; left: -6px; right: 0; height: 2px; background: var(--sun); z-index: 2; }
.now::before { content: ""; position: absolute; left: 0; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); }

/* ---------- detail (TimeTree dark) ---------- */
.detail { position: fixed; inset: 0; z-index: 10; background: #000; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: .4; } }
.d-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(10px + var(--safe-area-inset-top, env(safe-area-inset-top))) 14px 10px; }
.d-toptitle { flex: 1; text-align: center; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .15s; }
.detail.scrolled .d-toptitle { opacity: 1; }
.circ { width: 46px; height: 46px; border-radius: 50%; background: #2a2b2f; display: grid; place-items: center; flex: none; color: #fff; }
.circ:active { background: #3a3b40; }
.circ.sm { width: 40px; height: 40px; background: #1c1d20; border: 1px solid #2a2b2f; color: #9b9ca1; }
.d-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 20px; }
.d-cancel { margin: 0 16px 8px; padding: 8px 12px; border-radius: 10px; background: #3a1616; color: #ff9b9b; font-size: 14px; text-align: center; }
.d-av { width: 30px; height: 30px; border-radius: 50%; background: #6b625f; color: #fff; margin: 14px auto 0; display: grid; place-items: center; font-size: 14px; }
.d-title { text-align: center; font-size: 24px; font-weight: 800; margin: 26px 18px 22px; line-height: 1.3; word-break: break-word; }
.d-when { display: flex; align-items: center; padding: 6px 24px 22px; border-bottom: 1px solid var(--line); }
.d-when .w1, .d-when .w2 { flex: 1; }
.d-when .w2 { padding-left: 14px; font-weight: 400; }
.d-when .wd { font-size: 15px; font-weight: 700; }
.d-when .w2 .wd { font-weight: 400; }
.d-when .wt { font-size: 40px; font-weight: 700; letter-spacing: -.5px; line-height: 1.15; }
.d-when .w2 .wt { font-weight: 400; }
.d-when .wt small { font-size: 16px; margin-right: 3px; }
.wchev { color: #6a6b70; transform: scale(1.8); }
.d-desc { white-space: pre-wrap; font-size: 17px; line-height: 1.55; padding: 18px 18px 28px; border-bottom: 1px solid var(--line); word-break: break-word; }
.d-desc .hl { color: var(--hl); }
.d-rows { border-bottom: 1px solid var(--line); }
.d-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 17px 18px; border-top: 1px solid var(--line); font-size: 17px; text-align: left; }
.d-rows .d-row:first-child { border-top: 0; }
button.d-row:active { background: #111; }
.d-ic { color: #8e8e93; display: grid; place-items: center; }
.d-lb { flex: none; }
.d-val { flex: 1; text-align: right; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-chev { color: #4a4b50; transform: scale(.8); }
.tdot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -1px; margin-right: 8px; }
.d-sub { font-size: 12px; color: var(--dim); text-align: right; padding: 0 18px 10px; margin-top: -10px; }
.d-sech { padding: 22px 18px 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.d-sech small { font-weight: 400; color: var(--dim); }
.d-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 10px 18px; }
.ph { aspect-ratio: 1; border-radius: 8px; background: #1c1d20 center/cover no-repeat; position: relative; overflow: hidden; display: flex; align-items: flex-end; text-decoration: none; }
.ph span { font-size: 9px; background: rgba(0,0,0,.6); color: #fff; width: 100%; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph.noimg::before { content: "🖼"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; opacity: .4; }
.d-today { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 22px 18px 10px; }
.d-today::before, .d-today::after { content: ""; flex: 1; border-top: 1px dotted #3a3b40; }
.d-comments { padding: 0 18px; }
.d-nocmt { color: var(--dim); text-align: center; font-size: 13px; padding: 6px 0 12px; }
.cmt { display: flex; gap: 10px; margin-bottom: 14px; }
.av { width: 34px; height: 34px; border-radius: 50%; background: #5b5c61; color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; flex: none; }
.r-前線 { background: #0e7490 !important; }
.r-辦公室 { background: #7e22ce !important; }
.r-老闆 { background: #c2410c !important; }
.cb { min-width: 0; }
.cmt .who { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.cmt .who time { margin-left: 4px; color: var(--dim); }
.cmt .bubble { background: #1c1d20; border-radius: 4px 14px 14px 14px; padding: 8px 12px; font-size: 15px; white-space: pre-wrap; word-break: break-word; display: inline-block; }
.pend { color: var(--warn); font-size: 11px; }
.d-gone { color: var(--muted); text-align: center; padding: 40px; }
.d-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px calc(10px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom))); border-top: 1px solid var(--line); background: #0b0b0c; }
.d-input { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; border-radius: 22px; background: #1c1d20; border: 1px solid #2a2b2f; padding: 0 14px; color: #8e8e93; min-width: 0; }
.d-input input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 16px; }
.d-input input::placeholder { color: #8e8e93; }
.circ.send { color: #c9c9ce; }

/* ---------- modal / bottom sheet ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal .box { background: #1c1d20; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom))); width: 100%; max-width: 520px; display: grid; gap: 12px; font-size: 15px; max-height: 85vh; overflow-y: auto; animation: up .18s ease-out; }
.modal h3 { margin: 0; font-size: 18px; }
.modal p { margin: 0; line-height: 1.5; }
.modal label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.modal input:not([type=radio]) { font: inherit; font-size: 17px; padding: 11px 12px; border: 1px solid #333; border-radius: 10px; width: 100%; background: #0f0f10; color: var(--text); }
.radio { display: flex; gap: 8px; }
.radio label { flex: 1; display: block; }
.radio input { position: absolute; opacity: 0; }
.radio span { display: block; text-align: center; padding: 12px 0; border-radius: 10px; border: 1px solid #333; font-size: 16px; color: var(--text); }
.radio input:checked + span { background: var(--green); border-color: var(--green); font-weight: 700; }
.row2 { display: flex; gap: 8px; }
.row2 .btn { flex: 1; }
.btn { background: var(--green); color: #fff; font-weight: 700; border-radius: 12px; padding: 12px; font-size: 16px; text-align: center; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid #3a3b40; }
.meta { font-size: 12px; color: var(--dim); }
.menu { gap: 0; padding-top: 6px; }
.menu > button, .menu > a { padding: 15px 4px; border-bottom: 1px solid #2a2b2f; text-align: left; font-size: 16px; text-decoration: none; display: block; }
.menu > p { padding: 12px 4px; }
.who-list { display: grid; gap: 6px; }
.who-list label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid #2a2b2f; color: var(--text); font-size: 16px; cursor: pointer; }
.who-list label:has(input:checked) { border-color: var(--green); background: #12301f; }
.who-list input { position: absolute; opacity: 0; }
.who-list small { color: var(--muted); margin-left: auto; }
.ob { font-size: 14px; padding: 8px 0; border-bottom: 1px solid #2a2b2f; word-break: break-word; }
.linkbtn { color: var(--sun); text-decoration: underline; font-size: 12px; margin-left: 6px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #f2f2f2; color: #000; padding: 9px 16px; border-radius: 999px; font-size: 14px; z-index: 30; max-width: 90vw; }

/* ---------- 前線填寫 form (fields from Sheet「前線欄位設定」) ---------- */
.fform { gap: 14px; }
.fform h3 small { font-size: 13px; font-weight: 400; }
.ff { display: grid; gap: 6px; }
.ff .fl { font-size: 14px; color: var(--text); }
.ff .ft { color: var(--dim); font-size: 11px; }
.ff .req { color: var(--sun); }
.ff textarea { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #333; border-radius: 10px; width: 100%; background: #0f0f10; color: var(--text); resize: vertical; }
.ff .hint { color: var(--dim); font-size: 12px; }
.ff .ferr { color: #ff9b9b; font-size: 12px; }
.ff .ferr:empty { display: none; }
.ff.bad input:not([type=radio]), .ff.bad textarea, .ff.bad .radio span { border-color: #b33; }
.radio.wrap { flex-wrap: wrap; }
.radio.wrap label { flex: 1 1 30%; }
.radio.wrap span { font-size: 14px; padding: 10px 4px; }
.fgroup { border: 1px solid #2a2b2f; border-radius: 12px; padding: 10px; display: grid; gap: 10px; margin: 0; }
.fgroup legend { color: var(--muted); font-size: 13px; padding: 0 6px; }
/* 分段（手風琴）: one panel per 分組, only the tapped one open */
.fsec { border: 1px solid #2a2b2f; border-radius: 12px; overflow: hidden; }
.fsec-h { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 14px; font-size: 15px; font-weight: 600; color: var(--text); text-align: left; }
.fsec-h::after { content: '▸'; color: var(--muted); margin-left: 6px; }
.fsec.open .fsec-h::after { content: '▾'; }
.fsec.open .fsec-h { border-bottom: 1px solid #2a2b2f; }
.fsec-st { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
.fsec-st.need { color: #ff9b9b; }
.fsec-b { display: grid; gap: 12px; padding: 12px 14px; }
.fentry { display: grid; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed #2a2b2f; }
.fentry-h { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.btn.sm { padding: 8px 12px; font-size: 14px; font-weight: 600; }
.fphotos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fthumb { width: 64px; height: 64px; border-radius: 8px; background: #2a2b30 center/cover; position: relative; }
.fthumb button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: #000; color: #fff; font-size: 14px; }
.fwarn { background: #3a2f12; color: var(--warn); padding: 8px 10px; border-radius: 10px; font-size: 13px; }
.fold { font-size: 13px; color: var(--muted); }
.d-diff { margin: 0 18px 10px; padding: 8px 10px; border-radius: 10px; background: #3a1616; color: #ff9b9b; font-size: 13px; }
.sigpad { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.8); display: grid; place-items: center; }
.sigbox { background: #1c1d20; border-radius: 14px; padding: 14px; width: min(94vw, 520px); display: grid; gap: 10px; }
.sigbox canvas { width: 100%; height: auto; border-radius: 8px; touch-action: none; background: #fff; }

/* 相位：每格附相（docs/10）— 相片名單逐格影，未影嘅格係虛線 */
.fslot { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; max-width: 76px; }
.fslot small { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.2; }
.fthumb.empty { border: 1.5px dashed #55565c; background: transparent; font-size: 20px; color: #8a8b90; }
.fthumb.empty.need { border-color: var(--warn); }
.fneed { flex-basis: 100%; font-size: 11px; color: var(--warn); }
/* 未完成提醒：月曆格、日程格、詳情頁、彈窗 */
.bar.todo::before, .blk.todo b::before { content: '⚠ '; }
.bar.todo, .blk.todo { box-shadow: inset 0 0 0 1.5px var(--warn); }
.d-todo { margin: 0 18px 12px; padding: 10px 12px; border-radius: 10px; background: #3a2f12; color: var(--warn); font-size: 13px; line-height: 1.5; }
.d-todo b { display: block; margin-bottom: 2px; }
.d-todo ul { margin: 0; padding-left: 18px; }
.todo-pop .todo-list { max-height: 55vh; overflow: auto; }
.todo-pop .todo-o { display: block; width: 100%; text-align: left; padding: 10px 0; border-bottom: 1px solid #2a2b30; color: inherit; background: none; }
.todo-pop .todo-o b { font-size: 14px; }
.todo-pop .todo-o .due { color: var(--warn); font-size: 11px; margin-left: 6px; }
.todo-pop ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: #d6d6da; }
.todo-pop li { margin-bottom: 2px; }

/* 操作紀錄 (app/audit.js) — 詳情頁 and 對數畫面 */
.d-audit { margin: 4px 18px 18px; border-top: 1px solid var(--line); padding-top: 10px; }
.d-audit summary, .of-audit summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; }
.d-audit summary small { font-weight: 400; color: var(--dim); margin-left: 6px; }
.audit { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.audit li { display: grid; grid-template-columns: 74px 92px 1fr; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.audit .a-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.audit .a-who small { display: block; color: var(--dim); font-size: 11px; }
.audit .a-chg { display: block; color: var(--muted); word-break: break-word; }
.audit s { color: var(--dim); }
.audit-none { color: var(--dim); font-size: 12px; margin: 6px 0; }

/* 前線「我嘅隊／全部」(app/teams.js) */
.chips .seg.scope { flex: none; }
.card.other { opacity: .62; }
.d-ro { margin: 0 18px 12px; padding: 10px 12px; border-radius: 10px; background: #1f2633; color: #a9c3ff; font-size: 13px; line-height: 1.5; }

/* 限時聯絡資料：撳「聯絡」先 show（app/contact.js） */
.box.contact .ct-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid #2a2b30; }
.box.contact .ct-lb { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.box.contact .ct-val { font-size: 17px; word-break: break-word; user-select: text; -webkit-user-select: text; }
.box.contact .ct-addr { font-size: 15px; }
.box.contact .ct-act { display: flex; gap: 6px; align-items: center; }

/* 已做完 (app/done.js)：標題唔再轉綠，只加 ✔️。掣喺詳情右上角「更多」下面 */
.d-topr { position: relative; flex: none; }
.d-marks { position: absolute; top: calc(100% + 6px); right: 0; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.btn-done { white-space: nowrap; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; background: #2a2b2f; border: 1px solid #3a3b40; }
.btn-done.on { color: var(--green); border-color: var(--green); background: #0f2a1b; }

/* 月曆標記 (app/marks.js markOf)：紅字＝有必填未齊；綠字＝全部做好。深底＋左邊留標籤色，唔係就睇唔清 */
:root { --red: #ff5a5a; }
.bar.mk-red, .blk.mk-red { background: #2a1214 !important; color: var(--red); box-shadow: inset 3px 0 0 var(--tc, var(--red)); }
.bar.mk-green, .blk.mk-green { background: #0f2a1b !important; color: var(--green); box-shadow: inset 3px 0 0 var(--tc, var(--green)); }
.blk.mk-red b, .blk.mk-green b { color: inherit; }
.card .t.mk-red { color: var(--red); }
.card .t.mk-green { color: var(--green); }

/* Filter TAB（日曆／列表篩選） */
.ftabs { display: flex; gap: 6px; overflow-x: auto; margin-top: 6px; scrollbar-width: none; }
.ftab { flex: none; font-size: 12px; padding: 4px 10px; border-radius: 8px; background: var(--card); color: var(--muted); }
.ftab.on { background: #f2f2f2; color: #000; font-weight: 700; }
.ftab small { opacity: .7; margin-left: 3px; }
.ask-prev h3 { line-height: 1.4; }
.cell { position: relative; }
.lv-n { position: absolute; top: 3px; right: 2px; font-size: 10px; color: var(--warn); }
.lv-day { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 10px; font-size: 13px; color: var(--warn); }
.lv-block { color: var(--sun); }

/* 返回掣：手機撳即時，唔等雙擊縮放 */
.circ, .of-circ { touch-action: manipulation; }

/* 頂部掣多咗：字唔好斷行；同步字先讓位；真係唔夠位就打橫碌 */
.top-row:first-child { overflow-x: auto; scrollbar-width: none; }
.top-row:first-child::-webkit-scrollbar { display: none; }
.top-row:first-child > * { flex: none; white-space: nowrap; }
.top-row:first-child > .sync-text { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.flocked { font-weight: 700; font-size: 17px; padding: 6px 0; }
.fdone > summary { padding: 10px 2px; font-weight: 700; cursor: pointer; }
.fdone[open] > summary { margin-bottom: 6px; }
.btn[hidden], label[hidden] { display: none; }
.fthumb.pdf, .xp-photo.pdf { display: grid; place-items: center; font-size: 26px; }
.ph.pdf { background: #2a2b30; }
.ph.pdf::before { content: "📄"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; }

/* ---------- 電腦版（辦公室主要用網頁版）: 闊屏先生效，手機唔受影響 ---------- */
@media (min-width: 900px) {
  #app { max-width: 1320px; }
  .top { padding-left: 20px; padding-right: 20px; }
  /* 月曆畫面：左月曆、右當日列表（右邊可以自己捲） */
  .mv { display: grid; grid-template-columns: minmax(0, 1fr) 420px; align-items: start; }
  .mcal { padding: 8px 12px 24px 20px; }
  .cell { min-height: 112px; padding: 3px 4px; }
  .cell .n { font-size: 13px; }
  .bar { font-size: 12px; line-height: 18px; height: 18px; padding: 0 5px; }
  .cell:hover { background: #121316; }
  .mv .daylist { position: sticky; top: var(--top-h, 120px); max-height: calc(100vh - var(--top-h, 120px)); overflow-y: auto; border-top: 0; border-left: 1px solid var(--line); padding: 12px 16px 32px; }
  /* 日檢視：列表唔好拉到成個闊度 */
  main > .daylist { max-width: 760px; margin: 0 auto; border-top: 0; }
  .card:hover { background: #16171a; }
  /* 彈窗：電腦唔好由底升起，擺中間 */
  .modal { align-items: center; }
  .modal .box { border-radius: 18px; max-width: 480px; padding-bottom: 18px; }
  /* 詳情頁闊少少 */
  .detail { max-width: 720px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); }
  .toast { bottom: 40px; }
}
@media (min-width: 1300px) {
  .mv { grid-template-columns: minmax(0, 1fr) 480px; }
  .cell { min-height: 128px; }
}

/* 搜尋（標題、內容） */
.top-row .srch { margin-left: 2px; }
.top-row .back { flex: none; white-space: nowrap; font-weight: 600; }
.sbar { display: flex; gap: 8px; align-items: center; padding: 6px 12px 8px; }
.sbar input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line, #ccc); background: var(--card, #fff); color: inherit; }
.sres-n { margin: 10px 4px 4px; font-size: 13px; opacity: .7; }
body.searching #prev, body.searching #next, body.searching #todayBtn, body.searching #seg { visibility: hidden; }

/* 內容入面嘅訂單編號：撳去返舊單 */
.d-desc a.olink { color: #4da3ff; text-decoration: underline; }
.d-desc a.olink.miss { color: inherit; opacity: .8; text-decoration-style: dotted; }

/* 停接單（辦公室／老闆） */
.lv-block.stop { color: #ff6b6b; font-weight: 600; }
.lv-block.car { color: #f5a623; font-weight: 600; }

/* 已CHECK 只睇（老闆、前線）：撳唔到 */
.btn-done.view { cursor: default; opacity: .75; pointer-events: none; }
.btn-done.view.same { color: var(--warn); border-color: var(--warn); background: #2e2410; opacity: 1; }
.btn-done.view.on { opacity: 1; }

/* 影完一張：「📷 再影下一張」（2026-11-12） */
.fshoot-bar { position: sticky; bottom: 0; z-index: 3; display: flex; gap: 8px; padding: 10px 0 4px; background: var(--card, #1c1d21); }
.fshoot-bar .btn { flex: 1; }
