:root {
  --ink: #1c1915;
  --muted: #5c564e;
  --paper: #e6dfd2;
  --sheet: #f7f4ee;
  --line: #1c1915;
  --seal: #9f2218;
  --check: #1e8c45;
  --rule: rgba(28, 25, 21, 0.16);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans CJK TC", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.wrap { width: min(980px, calc(100% - 28px)); margin: 28px auto 48px; }
.sheet { background: var(--sheet); border: 1.5px solid var(--line); padding: 28px 28px 32px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1.5px solid var(--line); }
.mark { display: inline-flex; align-items: flex-end; margin: 0; text-decoration: none; }
.brand-logo { height: 104px; width: auto; display: block; }
.check { width: 0.95em; height: 0.95em; color: var(--check); display: inline-block; vertical-align: -0.15em; flex: none; }
.page-no { margin: 0 0 2px; font-variant-numeric: tabular-nums; }
.page-no .num { font-size: 1.375rem; font-weight: 700; letter-spacing: 0.06em; }
.page-no .role { margin-left: 8px; font-size: 1rem; color: var(--muted); }
a { color: inherit; }
button, .btn, input, select, textarea {
  font: inherit;
  color: inherit;
}
button, .btn {
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 12px;
  cursor: pointer;
}
button.primary, .btn.primary { background: var(--ink); color: var(--sheet); }
input, select, textarea {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #b9b1a3;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  margin-top: 0.3rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #2f6fdb; box-shadow: 0 0 0 3px rgba(47, 111, 219, 0.22); }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); background: #efebe3; border-style: dashed; }
input[type="checkbox"], input[type="radio"] { width: auto; margin: 0 6px 0 0; padding: 0; border: none; box-shadow: none; accent-color: #1c1915; }
input[type="file"] { background: #fff; border-style: dashed; padding: 0.45rem; }
input[type="checkbox"] { width: auto; margin-right: 6px; }
.sample-pick { width: 10em; flex: none; }
label { display: block; margin: 0.9rem 0 0.75rem; font-size: 0.9rem; font-weight: 700; color: #26323d; }
label > input, label > select, label > textarea { font-weight: 400; color: var(--ink); }
label .req { color: #c0261a; margin-left: 2px; font-weight: 700; }
.grid label, label.apply-pick { font-weight: 400; color: var(--ink); }
label strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.team { border: 1.5px solid var(--line); padding: 4px 16px 16px; margin: 12px 0; }
.dash { border: 1.5px solid var(--line); padding: 4px 16px 16px; margin: 16px 0; }
.dash .rowline, .team .rowline { flex-wrap: wrap; }
.dash h2 { margin-top: 10px; }
.days.late { color: var(--seal); font-weight: 700; }
textarea { min-height: 72px; font: inherit; color: inherit; }
.seat-group { margin: 16px 0; }
.seat-group strong { display: block; color: var(--ink); }
.role-name { width: 10em; flex: none; border-bottom: 1px solid var(--rule); }
.seat-row { display: flex; align-items: center; gap: 8px; }
.seat-row select { flex: 1; width: auto; margin: 6px 0; }
.seat-face { flex: none; display: flex; }
.faces { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.face { display: inline-flex; align-items: center; gap: 8px; }
.seat-now { margin: 0 0 8px; }
.seat-row button { flex: none; }
.seat-group button { margin-top: 4px; }
.seat { display: grid; grid-template-columns: 4em 1fr 1.4fr 7em; gap: 10px; align-items: end; margin: 8px 0; }
.seat select { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.rowline { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.rowline span { min-width: 0; }
.entry-month { max-height: 16em; overflow: auto; margin: 0; }
.muted { color: var(--muted); font-size: 0.875rem; }
.error { color: var(--seal); }
.steps { display: grid; grid-template-columns: repeat(6, 1fr); margin: 18px 0; border: 1px solid var(--line); }
.steps li { list-style: none; padding: 10px 8px; border-right: 1px solid var(--rule); }
.steps li:last-child { border-right: none; }
.steps .n { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--muted); }
.steps li.on { background: #efe7d4; }
.steps li.now { outline: 2px solid var(--seal); outline-offset: -2px; }
.project-steps { margin: 8px 0 16px; }
.project-steps li { min-height: 112px; padding: 18px 10px; }
.project-steps .n { font-size: 2rem; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
.project-steps li.on .n,
.project-steps li.now .n { color: var(--ink); }
.project-steps strong { display: block; margin-top: 10px; font-size: 1rem; line-height: 1.35; }
.project-steps li.now { background: #f4e6d4; }
.status-project { padding: 8px 0 2px; border-bottom: 1px solid var(--rule); }
.status-project .rowline { border-bottom: none; padding-bottom: 0; }
.status-steps { margin: 8px 0 12px; }
.status-steps li { padding: 8px 8px 10px; }
.status-steps .n { font-weight: 700; }
.status-steps strong { display: block; margin-top: 4px; font-size: 0.8125rem; line-height: 1.3; }
.status-steps li.now { background: #f4e6d4; }
.summary .score-label { margin: 0; font-size: 0.8125rem; letter-spacing: 0.08em; color: var(--muted); }
.summary .score { margin: 0 0 8px; font-size: 2.625rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.summary .score span { margin-left: 6px; font-size: 1rem; font-weight: 500; color: var(--muted); }
.load-count { font-weight: 700; white-space: nowrap; }
.load h3.rowline { border-bottom: none; padding-top: 0; }
.load h3.rowline > span:first-child { display: flex; align-items: center; gap: 8px; }
.load .avatar, .load .avatar-empty { width: 36px; height: 36px; display: block; }
.summary p { margin: 6px 0; }
.pdf-sheet { width: 100%; aspect-ratio: 297 / 210; background: white; border: 1px solid var(--line); }
.pdf-sheet iframe { width: 100%; height: 100%; border: 0; }
.compare { display: flex; flex-direction: column; gap: 22px; }
.tag { font-size: 0.8125rem; }
.tag.ok { display: inline-flex; align-items: center; gap: 4px; color: var(--check); }
.summary .bad, .load .bad { color: var(--seal); }
.summary .good, .load .good { color: var(--check); display: flex; align-items: center; gap: 6px; }
.tag.wait { color: var(--muted); }
.tag.high { color: var(--seal); font-weight: 700; }
.tag.important { color: var(--ink); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.search input { font-size: 1.125rem; }
.kept { border: 1.5px solid var(--line); padding: 8px 16px 16px; margin: 16px 0; }
.kept-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kept-pair > section + section { border-left: 1px solid var(--rule); padding-left: 16px; }
.kept h3 { margin: 8px 0; font-size: 1rem; }
.spec { border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 8px; }
.spec-title { margin: 0; }
.spec-title .tag { margin-left: 8px; }
.spec dl, .spec-head { display: grid; grid-template-columns: 4.5em 1fr; gap: 4px 10px; margin: 8px 0 0; }
.spec dd, .spec-head dd { margin: 0; }
.spec dt, .spec-head dt { color: var(--muted); }
.who { display: flex; align-items: center; gap: 8px; flex: none; }
.who .muted { white-space: nowrap; }
.avatar, .avatar-empty, .profile-photo { border-radius: 50%; object-fit: cover; background: #efe7d4; border: 1px solid var(--line); }
.avatar, .who .avatar-empty { width: 36px; height: 36px; flex: none; }
.profile-frame { width: 96px; height: 96px; margin: 8px 0; }
.profile-photo { width: 96px; height: 96px; display: block; }
.mascot-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 8px 0 16px; align-items: stretch; }
.mascot-pick button { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding: 8px 6px 10px; min-width: 0; }
.mascot-pick img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; display: block; }
.mascot-pick span { line-height: 1; }
.mascot-pick button.on { background: #efe7d4; outline: 2px solid var(--ink); }
.welcome-art { width: 100%; display: block; border: 1.5px solid var(--line); margin: 8px 0 0; }
.login-card { width: min(420px, 100%); margin: 28px auto 0; border: 1.5px solid var(--line); padding: 8px 22px 26px; }
.login-card .textlink { display: inline-block; margin-top: 16px; border: none; padding: 0; background: none; text-decoration: underline; }
dialog.modal { border: 1.5px solid var(--line); background: var(--sheet); color: var(--ink); padding: 8px 22px 22px; width: min(480px, calc(100% - 32px)); }
dialog.modal::backdrop { background: rgba(28, 25, 21, 0.45); }
dialog.modal h2 { margin-top: 14px; }
.role-pick { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }
.role-pick button { text-align: left; }
.duty { display: block; color: inherit; text-decoration: none; border: 1.5px solid var(--line); padding: 14px 16px; margin: 12px 0; }
a.duty:hover { background: #efe7d4; }
.duty h2 { margin: 0 0 8px; }
.duty p { margin: 0; color: var(--ink); font-size: 1rem; line-height: 1.6; }
h1 { font-size: 1.75rem; line-height: 1.35; margin: 18px 0 8px; }
h1.lead { color: #0e4ec4; font-weight: 700; font-size: 2rem; }
h2 { font-size: 1.125rem; margin: 22px 0 8px; }
ul { margin: 0; padding: 0; }
.tabs { display: flex; gap: 8px; margin-top: 8px; }
.staff-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.state {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.state-work { color: #146b34; background: #d9f3e4; }
.state-soon { color: #8a5600; background: #ffe7b0; }
.state-off { color: #7a4a00; background: #fdeccc; }
.state-weather { color: #0b636b; background: #c9f1f3; }
.state-sick { color: #9f2218; background: #ffd6d6; }
.state-maternity { color: #6b3fa0; background: #f3eef8; }
.state-annual { color: #1d5bbf; background: #e8f0fb; }
.state-stop { color: #9a3e0c; background: #ffd7bf; }
.state-late { color: #9f2218; background: #ffd0cb; }
.state-wait { color: #5c564e; background: #e6e1d8; }
.state-title { margin: 16px 0 8px; font-size: 1rem; }
.state-title.state-work { color: #146b34; background: transparent; }
.state-title.state-soon { color: #8a5600; background: transparent; }
.state-title.state-off { color: #7a4a00; background: transparent; }
.state-title.state-weather { color: #0b636b; background: transparent; }
.state-title.state-stop { color: #9a3e0c; background: transparent; }
.state-title.state-late { color: #9f2218; background: transparent; }
.staff-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.staff-card {
  border: 1.5px solid var(--line);
  border-left-width: 8px;
  border-radius: 8px;
  padding: 10px 12px 12px;
  background: var(--sheet);
}
.staff-card.state-work { border-left-color: #1e8c45; background: #f3fbf6; }
.staff-card.state-soon { border-left-color: #c47d00; background: #fff8e8; }
.staff-card.state-off { border-left-color: #c9a25a; background: #faf6ee; color: var(--ink); }
.staff-card.state-weather { border-left-color: #0e7c86; background: #f2fbfb; }
.staff-card.state-stop { border-left-color: #c45512; background: #fff4ec; }
.staff-card.state-late { border-left-color: #9f2218; background: #fff5f4; }
.staff-card p { margin: 4px 0 0; font-size: 0.875rem; }
.staff-card .detail, .staff-line .detail { margin: 4px 0 0; font-size: 0.8125rem; }
.staff-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.staff-line { border-left: 6px solid transparent; padding-left: 10px; }
.staff-line.state-work { border-left-color: #1e8c45; }
.staff-line.state-soon { border-left-color: #c47d00; }
.staff-line.state-off { border-left-color: #c9a25a; background: #faf6ee; color: var(--ink); }
.staff-line.state-off .state.state-off, .staff-card.state-off .state.state-off { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; color: #7a4a00; background: #fdeccc; border: 1px solid #e3c27f; }
.staff-line.state-weather { border-left-color: #0e7c86; }
.staff-line.state-sick { border-left-color: #9f2218; }
.staff-line.state-maternity { border-left-color: #6b3fa0; }
.staff-line.state-annual { border-left-color: #a39a8a; }
.staff-line.state-stop { border-left-color: #c45512; }
.staff-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.staff-line { flex-wrap: wrap; }
.pay-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.pay-range input[type="number"] { width: 8.2em; }
.pay-range select { width: auto; }
.sort-bar { display: flex; gap: 6px; }
.sort-bar button.on { font-weight: 700; background: #efe7d4; }
.staff-line.state-late { border-left-color: #9f2218; }
.staff-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-line { margin-top: 8px; }
.lang-line p { margin: 0; }
body.work .wrap { width: calc(100% - 16px); max-width: none; margin: 8px auto 24px; }
body.work .sheet { padding: 12px 16px 18px; }
body.work .brand-logo { height: 56px; }
body.work .folder { border: none; padding: 4px 0 8px; min-height: 0; }
body.work .team { border: none; margin: 0 0 20px; padding: 0 0 12px; border-bottom: 1px solid var(--rule); }
.case-files { margin: 8px 0 14px; }
.file-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file-add select, .file-add button { width: auto; }
.file-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; }
.file-row a { overflow-wrap: anywhere; }
.project-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.project-card {
  border: 1.5px solid var(--line);
  border-left-width: 8px;
  border-radius: 8px;
  padding: 12px 14px 14px;
  background: var(--sheet);
}
.project-card h3 { margin: 8px 0 4px; font-size: 1.25rem; }
.project-card .due-line { margin: 0; font-size: 1rem; font-weight: 700; }
.project-card.state-work { border-left-color: #1e8c45; background: #f3fbf6; }
.project-card.state-soon { border-left-color: #c47d00; background: #fff8e8; }
.project-card.state-late { border-left-color: #9f2218; background: #fff5f4; }
.project-card { cursor: pointer; }
.plan-pop { position: fixed; inset: 0; z-index: 30; background: rgba(28, 26, 22, .45); display: flex; justify-content: center; align-items: flex-start; padding: 24px 12px; overflow: auto; }
.plan-sheet { width: min(960px, 100%); background: var(--sheet, #f7f3ea); border-radius: 10px; padding: 16px 18px 22px; }
.plan-close { float: right; }
.flow-lane { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.flow-arrow { font-size: 1.25rem; }
.flow-step { min-width: 150px; border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.flow-step p { margin: 2px 0 0; font-size: 0.8125rem; }
.flow-step.now { border-color: #1e8c45; background: #f3fbf6; }
.flow-step.late { border-color: #9f2218; background: #fff5f4; }
.flow-step.wait { background: #f6f3ec; color: #6b6560; }
.flow-step.done { border-color: #1a4e9e; background: #f3f7ff; }
.send-box { margin: 12px 0; padding: 12px 14px; border: 2px solid #0e7a32; border-radius: 8px; background: #f3fbf6; }
.seal-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; }
.green-seal {
  width: 104px; height: 104px; border-radius: 50%;
  border: 3px solid #0b7a32; box-shadow: inset 0 0 0 2px #0b7a32;
  background: #eef8f1; color: #0b6b2c;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; text-decoration: none; line-height: 1.15; padding: 8px;
}
.green-seal small { font-size: 0.5rem; letter-spacing: 0.06em; font-weight: 700; }
.green-seal span { font-size: 0.6875rem; font-weight: 700; margin-top: 3px; }
.green-seal b { font-size: 1.125rem; margin-top: 2px; }
.send-box strong { display: block; margin-bottom: 4px; }
.send-box .reason { color: var(--ink); font-size: 0.9375rem; }
.reason-box {
  display: block;
  width: 100%;
  min-height: 96px;
  margin-top: 6px;
  padding: 10px 12px;
  background: #fff;
  color: #1c1915;
  border: 1.5px solid #1c1915;
  border-radius: 8px;
  resize: vertical;
}
.send-box input[type="file"] { display: block; margin: 8px 0; }
.draw-flow { display: flex; flex-direction: column; gap: 8px; max-width: 460px; }
.draw-box { border: 1.5px solid #222; background: #fff; border-radius: 6px; padding: 8px 12px; }
.draw-box p { margin: 2px 0 0; font-size: 0.8125rem; }
.draw-box.now { outline: 3px solid #1e8c45; }
.draw-box.late { outline: 3px solid #9f2218; background: #fff5f4; }
.draw-box.done { background: #f4f7fb; }
.draw-box.lock, .draw-box.release { background: #9f2218; color: #fff; border-color: #7d1b14; }
.desk-note { margin: 0 0 10px; padding: 10px 12px; border-radius: 8px; background: #f3fbf6; border: 1px solid #0e7a32; }
.desk-note.change { background: #fff5f4; border: 2px solid #9f2218; color: #9f2218; font-weight: 700; }
.reject-note { color: #9f2218; font-weight: 700; }
.desk-note.file { background: #f3f7ff; border-color: #1a4e9e; }
.draw-back { margin: 6px 0 6px 18px; padding-left: 10px; border-left: 2px dashed #9f2218; color: #9f2218; }
.draw-diamond { margin: 8px 0; padding: 8px 12px; border: 1.5px solid #222; background: #fff; transform: rotate(0deg); text-align: center; }
.gantt { margin-top: 8px; }
.gantt-scale { display: flex; justify-content: space-between; margin-left: 11.5em; font-size: 0.75rem; color: #6b6560; }
.gantt-row { display: grid; grid-template-columns: 11em 1fr; gap: 8px; align-items: center; margin: 5px 0; }
.gantt-name { font-size: 0.8125rem; }
.gantt-track { position: relative; height: 26px; background: #f3efe6; border-radius: 4px; }
.gantt-bar { position: absolute; top: 4px; height: 18px; border-radius: 4px; background: #cfc6b8; }
.gantt-bar.now { background: #1e8c45; }
.gantt-bar.done { background: #1a4e9e; }
.gantt-bar.late { background: #9f2218; }
.gantt-hope { position: absolute; top: -6px; bottom: -6px; width: 2px; background: #9f2218; }
.chat-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.chat-pick button.on { font-weight: 700; background: #efe7d4; }
.color-key { margin: 28px 0 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.color-key summary { cursor: pointer; font-weight: 700; }
.color-key .key-body { margin-top: 10px; }
.month-cal h3 { margin: 0 0 8px; font-size: 1rem; }
.color-key .key-lead { margin: 0 0 10px; }
.color-key article { display: grid; grid-template-columns: 7em 1fr; gap: 8px; align-items: center; margin: 0 0 8px; }
.color-key p { margin: 0; }
.progress-scroll { overflow-x: auto; margin: 8px 0 16px; border: 1.5px solid var(--line); background: #fff; }
.lane { display: grid; min-width: max-content; background: #fff; }
.lane-name { position: sticky; left: 0; z-index: 3; background: var(--sheet); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 4px 8px; font-size: 0.8125rem; display: flex; align-items: center; }
.lane-name.head { font-weight: 700; background: #efe7d4; }
.month-span { display: flex; align-items: center; justify-content: flex-start; padding-left: 6px; font-weight: 700; font-size: 0.8125rem; background: #efe7d4; border-bottom: 1px solid var(--line); border-left: 1px solid var(--rule); min-height: 28px; white-space: nowrap; }
.progress-day { min-height: 26px; min-width: 26px; border-radius: 0; font-size: 0.6875rem; }
.project-name { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 54px; border: none; border-top: 1.5px solid var(--line); cursor: pointer; text-align: left; }
.project-name .name-k { font-size: 0.6875rem; font-weight: 700; color: var(--muted); }
.cname { color: #1a4e9e; font-weight: 700; }
.aname { color: #1e8c45; font-weight: 700; }
.mname { color: #6d28d9; font-weight: 700; cursor: context-menu; }
.relay-menu { position: fixed; z-index: 60; width: 260px; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(28, 25, 21, 0.18); }
.relay-menu textarea { min-height: 72px; border: 1px solid var(--rule); border-radius: 8px; padding: 8px; }
.pname { color: #c2410c; }
.bubble.mine .cname { color: #9ec5ff; }
.bubble.mine .pname { color: #ffb088; }
.project-name .pname { font-size: 1.125rem; line-height: 1.2; font-weight: 700; text-shadow: 0 1px 0 #fff, 0 1px 2px rgba(194, 65, 12, 0.35); }
.lane-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border: none; border-top: 1.5px solid var(--line); border-bottom: 1px solid var(--rule); padding: 8px 10px; cursor: pointer; text-align: left; font-weight: 700; }
.lane-name.theme-t0, .lane-meta.theme-t0 { background: #e7f6ee; box-shadow: inset 4px 0 #1e8c45; }
.lane-name.theme-t1, .lane-meta.theme-t1 { background: #e8f0fb; box-shadow: inset 4px 0 #1a4e9e; }
.lane-name.theme-t2, .lane-meta.theme-t2 { background: #f3eef8; box-shadow: inset 4px 0 #6b3fa0; }
.lane-name.theme-t3, .lane-meta.theme-t3 { background: #fff4e4; box-shadow: inset 4px 0 #b86e00; }
.lane-name.theme-t4, .lane-meta.theme-t4 { background: #e7f6f7; box-shadow: inset 4px 0 #0e7c86; }
.flag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; color: #fff; }
.flag.bad { background: #9f2218; }
.flag.warn { background: #c47d00; }
.flag.stop { background: #c45512; }
.flag.off { background: #1d5bbf; }
.flag.weather { background: #0e7c86; }
.overview-report { margin: 4px 0 12px; }
.overview-report h3 { margin: 0 0 8px; font-size: 1rem; }
.report-place { margin: 0 0 8px; }
.report-months { display: flex; flex-wrap: wrap; gap: 8px; }
.report-months article { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-width: 148px; }
.report-months strong { display: block; font-size: 1.625rem; line-height: 1.1; }
.report-k { color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.report-months .hi { display: block; margin-top: 2px; color: #146b34; font-weight: 700; }
.report-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 0; font-size: 0.8125rem; }
.report-hint { margin: 6px 0 0; color: var(--muted); font-size: 0.8125rem; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.swatch.work { background: #d9f3e4; box-shadow: inset 0 0 0 1px #146b34; }
.swatch.off { background: #e7e2d8; }
.swatch.bar { background: #1e8c45; }
.swatch.hope { width: 3px; background: #9f2218; }
.lane-cell { min-width: 26px; min-height: 30px; border-bottom: 1px solid rgba(28, 25, 21, 0.16); }
.lane-cell.work { background: #f7fbf8; }
.lane-cell.off { background: #f3efe6; }
.lane-cell.on { box-shadow: inset 0 1px 0 rgba(28, 25, 21, 0.4), inset 0 -1px 0 rgba(28, 25, 21, 0.4); }
.lane-cell.on.bar-start { box-shadow: inset 1px 0 0 rgba(28, 25, 21, 0.4), inset 0 1px 0 rgba(28, 25, 21, 0.4), inset 0 -1px 0 rgba(28, 25, 21, 0.4); }
.lane-cell.on.bar-end { box-shadow: inset -1px 0 0 rgba(28, 25, 21, 0.4), inset 0 1px 0 rgba(28, 25, 21, 0.4), inset 0 -1px 0 rgba(28, 25, 21, 0.4); }
.lane-cell.on.bar-start.bar-end { box-shadow: inset 0 0 0 1px rgba(28, 25, 21, 0.4); }
.lane-cell.on.theme-t0 { background: #1e8c45; }
.lane-cell.on.theme-t1 { background: #1a4e9e; }
.lane-cell.on.theme-t2 { background: #6b3fa0; }
.lane-cell.on.theme-t3 { background: #b86e00; }
.lane-cell.on.theme-t4 { background: #0e7c86; }
.lane-cell.on.late { background: #9f2218; }
.lane-cell.on.wait { background: #cfc6b8; }
.lane-cell.on.done { background: #1a4e9e; }
.lane-cell.bar-start { border-radius: 4px 0 0 4px; }
.lane-cell.bar-end { border-radius: 0 4px 4px 0; }
.lane-cell.bar-start.bar-end { border-radius: 4px; }
.lane-cell.hope { box-shadow: inset -2px 0 0 #9f2218; }
.lane-cell.on.hope { box-shadow: inset 0 1px 0 rgba(28, 25, 21, 0.4), inset 0 -1px 0 rgba(28, 25, 21, 0.4), inset -2px 0 0 #9f2218; }
.cal-wrap { display: flex; flex-wrap: wrap; gap: 20px; margin: 8px 0 18px; }
.month-cal { width: min(100%, 420px); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { text-align: center; font-size: 0.8125rem; color: var(--muted, #6b6560); }
.cal-day { position: relative; min-height: 34px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; }
.cal-day.noted { cursor: help; }
.cal-day .tip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  z-index: 5;
  width: max-content;
  max-width: 220px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #1c1a16;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  pointer-events: none;
}
.cal-day:hover .tip { display: block; }
.due-slice { font-weight: 700; }
.account-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-head h2 { margin: 0; }
.seat-tip { cursor: help; }
.bar-tip { position: fixed; z-index: 40; max-width: 280px; padding: 8px 10px; border-radius: 8px; background: #1c1a16; color: #fff; font-size: 0.8125rem; line-height: 1.45; pointer-events: none; }
.bar-tip p { margin: 0; }
.bar-tip .now { color: #8ee0a8; font-weight: 700; }
.bar-tip .wait { color: #e6e0d4; font-weight: 700; }
.bar-tip .late { color: #ffb4ae; font-weight: 700; }
.bar-tip .ontime { color: #b7d4ff; font-weight: 700; }
.bar-tip .latedone { color: #ffd28a; font-weight: 700; }
.bar-tip .skip { color: #d0cbc3; font-weight: 700; }
.cal-day.work { background: #d9f3e4; color: #146b34; font-weight: 700; }
.cal-day.off { background: #e7e2d8; color: #6b6560; }
.cal-day.today { outline: 2px solid #1c1a16; outline-offset: -2px; }
.cal-day.due { box-shadow: inset 0 -3px 0 #9f2218; }
.seat-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: #efe7d4; font-size: 0.8125rem; }
.agent-chat { display: grid; grid-template-columns: var(--agent-side, 260px) 8px minmax(0, 1fr); height: calc(100vh - 168px); min-height: 560px; margin: 8px -4px 0; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #f7f4ee; }
.agent-sizer { cursor: col-resize; touch-action: none; position: relative; background: #efe7d4; }
.agent-sizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: rgba(28, 25, 21, 0.2); }
.agent-sizer:hover::after, .agent-sizer.drag::after { background: #1a4e9e; width: 3px; left: 2px; }
.agent-side { overflow-y: auto; padding: 12px 8px; background: #efe7d4; border-right: 1px solid var(--rule); }
.agent-k { margin: 4px 10px 8px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.agent-folder { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin: 0 0 4px; padding: 10px 12px; border: none; border-radius: 8px; background: transparent; text-align: left; }
.agent-folder.on { background: #fff; }
.agent-folder .cname { font-size: 0.75rem; font-weight: 700; }
.agent-folder .agent-preview { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 0.75rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.agent-folder.chat-row { flex-direction: row; align-items: center; gap: 10px; }
.chat-face { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: #e7e2d8; border: 1px solid var(--line); }
.chat-face.empty { display: grid; place-items: center; font-weight: 700; color: #1c1915; }
.chat-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.chat-line { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.chat-line .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-time { flex: none; font-size: 0.6875rem; font-weight: 400; color: var(--muted); }
.chat-row.unread .name, .chat-row.unread .agent-preview { font-weight: 700; color: var(--ink); }
.unread-n { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #1e8c45; color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 18px; text-align: center; }
.chat-head { display: flex; align-items: center; gap: 10px; }
.read-flag { font-size: 0.6875rem; color: var(--muted); }
.read-flag.read { color: #1a4e9e; font-weight: 700; }
.bubble .lang-k { display: block; margin-top: 8px; font-size: 0.6875rem; font-weight: 700; opacity: 0.65; }
.bubble .lang-k:empty { height: 8px; margin: 0; }
.agent-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f7f4ee; }
.agent-case { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 14px 20px 10px; font-size: 1rem; border-bottom: 1px solid var(--rule); }
.agent-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.agent-tools { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: none; }
.agent-pick { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 0.75rem; color: var(--muted); }
.agent-tools select { width: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px 6px; font-size: 0.8125rem; }
.agent-tools select.agent-speed { width: 5.4em; }
.voice-drop { position: relative; }
.voice-current { width: 36px; height: 36px; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #1c1915; display: grid; place-items: center; }
.voice-current svg, .voice-list svg { width: 26px; height: 26px; display: block; }
.voice-list { position: absolute; top: calc(100% + 4px); right: 0; z-index: 6; min-width: 8.2em; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 20px rgba(28, 25, 21, 0.12); }
.voice-list[hidden] { display: none; }
.voice-list button { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 6px 8px; border: none; border-radius: 6px; background: transparent; color: #1c1915; text-align: left; font-size: 0.8125rem; }
.voice-list button.on { background: #efe7d4; }
.think-flag { color: #b5b5b5; font-size: 0.8125rem; font-weight: 700; }
.think-flag.on { color: #1e8c45; animation: think-pulse 1s ease-in-out infinite; }
@keyframes think-pulse { 50% { opacity: 0.35; } }
.agent-speaker { width: 36px; height: 36px; margin: 0; padding: 0; border: none; border-radius: 8px; background: transparent; color: #1c1915; display: grid; place-items: center; }
.agent-speaker svg { width: 22px; height: 22px; display: block; }
.agent-speaker.mute { background: #d0d0d0; color: #1c1915; }
.agent-speaker.on { background: #1e8c45; color: #fff; }
.project-log { margin-top: 18px; }
.project-log h3 { margin-bottom: 4px; }
.project-log h4 { margin: 14px 0 4px; font-size: 0.8125rem; }
.project-log p { margin: 4px 0; }
.apply-pick { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 4px 14px 4px 0; }
.apply-pick input { width: auto; }
.agent-thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 20px 24px; }
.agent-spacer { margin-top: auto; }
.bubble { max-width: min(78%, 720px); display: flex; flex-direction: column; gap: 4px; }
.bubble.mine { align-self: flex-end; align-items: flex-end; }
.bubble.vercheck { align-self: flex-start; align-items: flex-start; }
.bubble .who { font-size: 0.75rem; color: var(--muted); }
.bubble p { margin: 0; padding: 10px 14px; border-radius: 18px; line-height: 1.45; white-space: pre-wrap; }
.bubble.mine p { background: #1c1915; color: #f7f4ee; border-bottom-right-radius: 5px; }
.bubble.vercheck p { background: #fff; border: 1px solid rgba(28, 25, 21, 0.12); border-bottom-left-radius: 5px; }
.composer { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0 16px 16px; padding: 12px 14px 10px; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; }
.composer textarea { width: 100%; min-height: 140px; border: none; border-bottom: none; padding: 0; resize: vertical; background: transparent; }
.composer button { align-self: flex-end; border: none; border-radius: 999px; background: #1c1915; color: #f7f4ee; padding: 8px 16px; }
.composer button:disabled { opacity: 0.45; }
.folders { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; margin: 18px 0 0; padding: 0 8px; }
.folders button { border: 1.5px solid var(--line); border-bottom: none; background: #efe7d4; border-radius: 10px 10px 0 0; padding: 10px 16px; white-space: nowrap; }
.folders button.on { background: var(--sheet); font-weight: 700; position: relative; top: 1.5px; }
.folder { border: 1.5px solid var(--line); min-height: 280px; padding: 8px 16px 20px; }
.budget-line input { width: 8em; flex: none; }
@media (max-width: 800px) {
  .grid, .steps, .seat, .kept-pair { grid-template-columns: 1fr 1fr; }
  .steps.status-steps { grid-template-columns: repeat(6, 1fr); }
  .mascot-pick { grid-template-columns: repeat(4, 1fr); }
  .kept-pair { grid-template-columns: 1fr; }
  .sheet { padding: 18px 14px 22px; }
  body.work .sheet { padding: 8px; }
  body.work .brand-logo { height: 44px; }
  .agent-chat { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .agent-sizer { display: none; }
  .agent-side { display: flex; gap: 6px; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--rule); }
  .agent-folder { width: auto; min-width: 140px; }
  .agent-thread { min-height: 280px; }
}

/* Button feedback (busy.js) */
button, .btn { transition: transform 0.06s ease, box-shadow 0.12s ease, background-color 0.12s ease, filter 0.12s ease; }
button:hover:not(:disabled), .btn:hover { filter: brightness(0.94); box-shadow: 0 1px 3px rgba(28, 25, 21, 0.18); }
button:focus-visible, .btn:focus-visible { outline: 2px solid #2f6fdb; outline-offset: 2px; }
button:active:not(:disabled), .btn:active { transform: translateY(1px) scale(0.98); filter: brightness(0.86); box-shadow: inset 0 2px 4px rgba(28, 25, 21, 0.25); }
button:disabled { cursor: progress; opacity: 0.7; }
button.vc-busy { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.vc-spin { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: vc-spin 0.7s linear infinite; flex: none; }
@keyframes vc-spin { to { transform: rotate(360deg); } }
.vc-note { display: inline-block; margin-left: 8px; font-size: 0.8125rem; font-weight: 600; vertical-align: middle; }
.vc-note.vc-ok { color: #0a7a3a; }
.vc-note.vc-error { color: #b42318; }
.vc-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.vc-toast { padding: 10px 14px; border-radius: 8px; font-size: 0.875rem; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); max-width: 360px; }
.vc-toast.vc-ok { background: #e7f6ec; color: #0a5c2c; border: 1px solid #0a7a3a; }
.vc-toast.vc-error { background: #fdecea; color: #8f1d14; border: 1px solid #b42318; }
.vc-loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; overflow: visible; z-index: 10001; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.vc-loadbar.on { opacity: 1; }
.vc-loadbar span { position: absolute; max-width: 30vw; top: 0; left: -30%; width: 30%; height: 3px; background: #2f6fdb; animation: vc-load 1.1s ease-in-out infinite; }
.vc-loadbar em { position: absolute; top: 6px; right: 12px; font-style: normal; font-size: 0.75rem; background: #fff; color: #1c1915; padding: 2px 8px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
@keyframes vc-load { 0% { left: -30%; } 100% { left: 100%; } }


/* Forms: sections, help text, job-type cards */
form p.muted { font-size: 0.8125rem; color: #5f6b76; background: #f1f4f7; border-left: 3px solid #b8c4cf; border-radius: 4px; padding: 0.45rem 0.7rem; margin: 0.4rem 0 0.9rem; font-weight: 400; }
.form-section { border: 1px solid #d8d0c2; border-radius: 10px; background: #fbf9f5; padding: 0.4rem 1.1rem 0.9rem; margin: 1.1rem 0; }
.form-section > h3 { margin: 0.6rem 0 0.4rem; font-size: 1rem; color: #1c1915; padding-bottom: 0.4rem; border-bottom: 1px solid #e3dccf; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .form-row2 { grid-template-columns: 1fr; } }
.jt-list { list-style: none; margin: 0.5rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
label.jt-card { display: flex; align-items: center; gap: 0.8rem; margin: 0; padding: 0.65rem 0.85rem; border: 1.5px solid #d3cbbd; border-radius: 10px; background: #fff; cursor: pointer; font-weight: 400; color: var(--ink); transition: border-color 0.12s, background 0.12s, box-shadow 0.12s; }
label.jt-card:hover { border-color: #8d8576; background: #fdfbf7; }
label.jt-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.jt-card .jt-n { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: #efe7d4; color: #1c1915; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
label.jt-card .jt-text { display: flex; flex-direction: column; gap: 0.15rem; }
label.jt-card .jt-name { font-size: 1rem; }
label.jt-card .jt-name b { font-weight: 700; margin-right: 0.4rem; }
label.jt-card .jt-meta { font-size: 0.8125rem; color: #6b6457; }
label.jt-card:has(input:checked) { border-color: #1f5fbf; background: #eef4ff; box-shadow: 0 0 0 3px rgba(31, 95, 191, 0.15); }
label.jt-card:has(input:checked) .jt-n { background: #1f5fbf; color: #fff; }
label.jt-card:has(input:focus-visible) { outline: 2px solid #2f6fdb; outline-offset: 2px; }
label.check-row { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; color: var(--ink); margin: 0.3rem 0 0.6rem; }
p.form-label { font-size: 0.9rem; font-weight: 700; color: #26323d; margin: 0.9rem 0 0.2rem; }

/* Job-type icons */
.jt-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; color: #4a4438; }
.jt-icon svg { width: 100%; height: 100%; display: block; }
label.jt-card:hover .jt-icon { color: #1c1915; }
label.jt-card:has(input:checked) .jt-icon { color: #1f5fbf; }
.jt-scope { display: flex; align-items: center; gap: 0.4rem; }
.jt-icon.jt-icon-sm { width: 1.75rem; height: 1.75rem; color: #1f5fbf; }

/* Named flow chart */
.flow-preview { margin-top: 0.8rem; }
.fc-title { margin: 0.8rem 0 0.3rem; font-size: 1rem; }
.flowchart { display: flex; flex-direction: column; align-items: stretch; max-width: 40rem; margin: 0.5rem auto 0.5rem 0; }
.fc-arrow { text-align: center; color: #8a8275; font-size: 1.1rem; line-height: 1.3; }
.fc-step { background: #fff; border: 1.5px solid #cfc7b8; border-radius: 10px; padding: 0.55rem 0.8rem; }
.fc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; }
.fc-n { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #efe7d4; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; flex: none; }
.fc-role { font-weight: 700; color: #26323d; }
.fc-role small { font-weight: 400; color: #6b6457; }
.fc-person { margin: 0.25rem 0 0.1rem 2.05rem; font-size: 0.95rem; }
.fc-person.fc-empty { color: #c0261a; font-weight: 700; }
.fc-text { margin-left: 2.05rem; font-size: 0.85rem; color: #4a4438; }
.fc-meta { margin-left: 2.05rem; font-size: 0.78rem; color: #6b6457; margin-top: 0.15rem; }
.fc-decide { border-style: dashed; border-color: #b8860b; background: #fffaf0; position: relative; }
.fc-decide .fc-n { background: #b8860b; color: #fff; border-radius: 4px; transform: rotate(45deg); }
.fc-decide .fc-n { font-size: 0; }
.fc-decide .fc-n::after { content: "?"; font-size: 0.8rem; transform: rotate(-45deg); color: #fff; }
.fc-branches { display: flex; flex-direction: column; gap: 0.2rem; margin: 0.35rem 0 0 2.05rem; font-size: 0.82rem; }
.fc-yes { color: #0a7a3a; font-weight: 600; }
.fc-no { color: #9a5b00; font-weight: 600; }
.fc-loopmark { font-size: 0.72rem; color: #9a5b00; background: #fff3dc; border: 1px solid #e8c98a; border-radius: 999px; padding: 0.05rem 0.45rem; }
.fc-badge { margin-left: auto; font-size: 0.72rem; border-radius: 999px; padding: 0.1rem 0.5rem; background: #eee; color: #555; }
.fc-state-done { border-color: #0a7a3a; background: #f1faf4; }
.fc-state-done .fc-badge { background: #0a7a3a; color: #fff; }
.fc-state-current { border-color: #1f5fbf; box-shadow: 0 0 0 3px rgba(31, 95, 191, 0.15); }
.fc-state-current .fc-badge { background: #1f5fbf; color: #fff; }
.fc-state-late { border-color: #c0261a; background: #fff4f2; }
.fc-state-late .fc-badge { background: #c0261a; color: #fff; }
.fc-state-pending { opacity: 0.85; }
.fc-detail { margin: 0.8rem 0; }
.fc-detail > summary { cursor: pointer; font-weight: 700; padding: 0.3rem 0; }
@media (max-width: 600px) { .flowchart { max-width: none; } .fc-person, .fc-text, .fc-meta, .fc-branches { margin-left: 0; } }
.send-box.my-turn { border: 2px solid #1f5fbf; background: #eef4ff; border-radius: 8px; padding: 0.6rem 0.8rem; margin: 0.6rem 0; }
.rev-done { color: #0a7a3a; font-weight: 700; }

/* Markdown text in chat bubbles and record cards */
.md { line-height: 1.6; overflow-wrap: anywhere; }
.md p { margin: 0 0 0.5em; }
.md p:last-child, .md ul:last-child, .md ol:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0.2em 0 0.5em; padding-left: 1.3em; }
.md li { margin: 0.15em 0; }
.md code { background: rgba(28, 25, 21, 0.07); border-radius: 4px; padding: 0 0.25em; font-size: 0.92em; }
.bubble .btext { padding: 10px 14px; border-radius: 18px; line-height: 1.55; }
.bubble.mine .btext { background: #1c1915; color: #f7f4ee; border-bottom-right-radius: 5px; }
.bubble.vercheck .btext { background: #fff; border: 1px solid rgba(28, 25, 21, 0.12); border-bottom-left-radius: 5px; }
.bubble .btext p { padding: 0; background: none; border: 0; border-radius: 0; white-space: normal; margin: 0 0 0.5em; }
.bubble .btext p:last-child { margin-bottom: 0; }
.bubble .chat-time { font-weight: 400; opacity: 0.8; }

/* 專案紀錄 */
.project-log .msg-card { max-width: 760px; background: #fff; border: 1px solid rgba(28, 25, 21, 0.12); border-radius: 10px; padding: 0.6rem 0.85rem; margin: 0.5rem 0; }
.project-log .msg-card.msg-agent { border-left: 4px solid #7a4bd0; }
.project-log .msg-head { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; font-size: 0.8125rem; margin-bottom: 0.3rem; }
.project-log .log-chart { margin: 0.4rem 0 0.8rem; }
.project-log .log-team { list-style: none; padding: 0; margin: 0.2rem 0; }
.project-log .log-team li { padding: 0.2rem 0; border-bottom: 1px dashed rgba(28, 25, 21, 0.12); }
.project-log .log-role { display: inline-block; min-width: 16rem; margin-right: 0.6rem; font-weight: 700; }
.project-log .log-role small { font-weight: 400; color: var(--muted); }
.project-log .log-note { font-size: 0.8125rem; }
.fc-round { font-size: 0.72rem; color: #fff; background: #9a5b00; border-radius: 999px; padding: 0.05rem 0.45rem; }
.fc-change { margin: 0.3rem 0 0 2.05rem; font-size: 0.82rem; color: #9a5b00; background: #fff3dc; border-radius: 6px; padding: 0.25rem 0.5rem; }
.fc-note { margin: 0.25rem 0 0 2.05rem; font-size: 0.8rem; color: #4a4438; }
.seat-switch { margin: 0.6rem 0; }
.seat-switch > summary { cursor: pointer; font-weight: 700; padding: 0.35rem 0; }
@media (max-width: 600px) { .project-log .log-role { min-width: 0; display: block; } .fc-person, .fc-text, .fc-meta, .fc-change, .fc-note, .fc-branches { margin-left: 0.4rem; } }

/* ---------- Flow diagram (SVG) ---------- */
.dg-wrap { position: relative; border: 1px solid #ddd4c4; border-radius: 10px; background: #fcfaf5; margin: 0.4rem 0; }
.dg-tools { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid #ebe4d6; flex-wrap: wrap; }
.dg-tools button { min-width: 32px; padding: 3px 8px; line-height: 1.2; }
.dg-level { font-size: 0.75rem; min-width: 3em; text-align: center; color: var(--muted); }
.dg-hint { margin-left: auto; font-size: 0.72rem; }
.dg-scroll { overflow: auto; padding: 6px; cursor: grab; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; }
.dg-scroll.grabbing { cursor: grabbing; }
.flow-svg { display: block; margin: 0 auto; font-family: inherit; }
.flow-svg text { fill: #1c1915; }
.dg-edge { stroke: #5f584c; stroke-width: 1.6; }
.dg-loop { fill: none; stroke: #b26b00; stroke-width: 1.8; stroke-dasharray: 6 4; }
.dg-loop.used { stroke-dasharray: none; stroke-width: 2.4; }
.dg-term rect { fill: #fff; stroke: #5f584c; stroke-width: 1.5; }
.dg-term.done rect { fill: #eaf7ef; stroke: #0a7a3a; }
.dg-term text { font-size: 13px; font-weight: 700; }
.dg-node { cursor: pointer; outline: none; }
.dg-node .dg-shape { stroke-width: 1.8; transition: stroke-width 0.1s, filter 0.1s; }
.dg-node:hover .dg-shape, .dg-node:focus-visible .dg-shape { stroke-width: 3; filter: drop-shadow(0 2px 4px rgba(26, 95, 180, 0.28)); }
.dg-current .dg-shape { stroke-width: 2.6; }
.dg-pending .dg-shape, .dg-plan .dg-shape { stroke-dasharray: none; }
.dg-role { font-size: 13px; font-weight: 700; }
.dg-sub { font-size: 10.5px; font-weight: 400; fill: #6b6457 !important; }
.dg-name { font-size: 13.5px; font-weight: 700; fill: #3b2a80 !important; }
.dg-name.dg-unassigned { fill: #c0261a !important; }
.dg-name-s { font-size: 11.5px; font-weight: 700; fill: #3b2a80 !important; }
.dg-task { font-size: 11px; fill: #5a5347 !important; }
.dg-hours { font-size: 10.5px; fill: #4a4438 !important; }
.dg-bar-track { fill: #efe9dc; }
.dg-bar-est { fill: #cfc6b4; }
.dg-bar-act { fill: #0a7a3a; }
.dg-bar-act.over { fill: #c47d00; }
.dg-status-ico { font-size: 11px; font-weight: 700; fill: #fff !important; }
.dg-initials { fill: #fff !important; font-weight: 700; }
.dg-face-empty { fill: #f3d6d2; stroke: #c0261a; }
.dg-face-q { fill: #c0261a !important; font-weight: 700; font-size: 14px; }
.dg-role-icon path { fill: none; stroke: #4a4438; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dg-round { fill: #b26b00; }
.dg-round-t { fill: #fff !important; font-size: 11px; font-weight: 700; }
.dg-yes rect { fill: #eaf7ef; stroke: #0a7a3a; }
.dg-yes text { fill: #0a7a3a !important; font-size: 11.5px; font-weight: 700; }
.dg-no rect { fill: #fff3dc; stroke: #b26b00; }
.dg-no text { fill: #8a5200 !important; font-size: 11.5px; font-weight: 700; }
.dg-no .dg-no-sub { font-size: 10px; font-weight: 400; }
.dg-pop { position: absolute; z-index: 20; top: 46px; left: 50%; transform: translateX(-50%); width: min(360px, calc(100% - 16px)); background: #fff; border: 1.5px solid #1a5fb4; border-radius: 12px; box-shadow: 0 10px 30px rgba(28, 25, 21, 0.25); padding: 12px 14px; }
.dg-pop-close { position: absolute; top: 6px; right: 6px; min-width: 30px; padding: 2px 8px; }
.dg-pop-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; padding-right: 30px; }
.dg-pop-role { font-weight: 700; display: flex; align-items: center; gap: 4px; }
.dg-pop-role small { font-weight: 400; color: var(--muted); }
.dg-pop dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 10px; margin: 0 0 6px; font-size: 0.84rem; }
.dg-pop dt { color: var(--muted); }
.dg-pop dd { margin: 0; }
.dg-pop-reply { background: #f6f3ec; border-radius: 8px; padding: 6px 8px; font-size: 0.86rem; }
@media (max-width: 600px) { .dg-pop { position: fixed; top: auto; bottom: 0; left: 0; right: 0; transform: none; width: auto; border-radius: 14px 14px 0 0; max-height: 70vh; overflow: auto; } .dg-hint { display: none; } }

/* Avatars, role icons, team strip, chips, progress */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; object-fit: cover; color: #fff; font-weight: 700; line-height: 1; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #d6cfbf; vertical-align: middle; }
.role-icon { vertical-align: -2px; flex: none; color: #4a4438; }
.team-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.5rem 0; }
.team-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border: 1px solid #ddd4c4; border-radius: 999px; background: #fff; }
.team-chip-text { display: flex; flex-direction: column; line-height: 1.15; }
.team-chip-role { font-size: 0.7rem; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.team-chip-name { font-size: 0.82rem; font-weight: 700; }
.record-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0.2rem 0 0.4rem; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: #efe9dc; color: #3b352b; }
.chip-rev { background: #0a7a3a; color: #fff; }
.chip-norev { background: #efe9dc; color: #6b6457; }
.chip-done { background: #eaf7ef; color: #0a7a3a; border: 1px solid #0a7a3a; }
.chip-now { background: #eaf2fd; color: #1f5fbf; border: 1px solid #1f5fbf; }
.chip-late { background: #fff1ef; color: #c0261a; border: 1px solid #c0261a; }
.chip-loop { background: #fff3dc; color: #8a5200; border: 1px solid #b26b00; }
.progress-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 0.3rem 0 0.5rem; max-width: 640px; }
.pbar { display: flex; flex-direction: column; gap: 3px; font-size: 0.78rem; }
.pbar-track { height: 8px; border-radius: 4px; background: #efe9dc; overflow: hidden; }
.pbar-fill { display: block; height: 100%; background: #0a7a3a; border-radius: 4px; }
.pbar.over .pbar-fill { background: #c47d00; }
.record-files h4 { margin: 0.6rem 0 0.2rem; font-size: 0.85rem; }
.record-files .file-list { list-style: none; padding: 0; margin: 0; font-size: 0.86rem; }
.record-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.5rem 0; }
.record-log ul { list-style: none; padding: 0; margin: 0.3rem 0; font-size: 0.8rem; }
.record-log li { padding: 2px 0; }
@media (max-width: 600px) { .progress-pair { grid-template-columns: 1fr; } }

/* Head shots on roster / header / seats / chat */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.photo-set { position: relative; display: inline-flex; margin-left: -18px; margin-top: 26px; }
.photo-btn { width: 26px; height: 26px; min-width: 0; padding: 0; border-radius: 50% !important; font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid #1a5fb4 !important; background: #fff; }
.staff-card-top { gap: 8px; }
.role-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.role-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; background: #efe9dc; font-size: 0.8rem; }
.seat-label { display: inline-flex; align-items: center; gap: 5px; }
.top .who { display: flex; align-items: center; gap: 8px; }
.bubble .who { display: inline-flex; align-items: center; gap: 4px; }
.bubble .who .avatar { box-shadow: none; }

/* ---------- Where we are + delays (blue stays reserved for clickables) ---------- */
.dg-done { opacity: 0.72; }
.dg-done.dg-delayed { opacity: 1; }
.dg-pending text, .dg-plan text { fill-opacity: 0.85; }
.dg-now .dg-shape { stroke-width: 4 !important; filter: drop-shadow(0 0 6px rgba(15, 118, 110, 0.55)) drop-shadow(0 0 2px rgba(15, 118, 110, 0.6)); }
.dg-now.dg-late .dg-shape { filter: drop-shadow(0 0 6px rgba(192, 38, 26, 0.5)); }
.dg-now-tag rect { fill: #0f766e; }
.dg-now-tag text { fill: #fff !important; font-size: 11.5px; font-weight: 700; }
.dg-delayed .dg-shape { stroke-width: 3; }
.dg-late-badge rect { fill: #c0261a; }
.dg-late-badge text { fill: #fff !important; font-size: 11px; font-weight: 700; }
.dg-pop-delay { border: 1.5px solid #c0261a; background: #fff1ef; border-radius: 8px; padding: 6px 8px; margin: 6px 0; font-size: 0.86rem; }
.dg-pop-delay b { color: #c0261a; display: block; margin-bottom: 2px; }
.chip-now { background: #e3f5f2 !important; color: #0f5e57 !important; border: 1px solid #0f766e !important; }
.send-box.my-turn { border-color: #0f766e !important; background: #eef8f6 !important; }
.delay-strip { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: flex-start; padding: 8px 12px; margin: 0.4rem 0; border-radius: 10px; border: 1.5px solid #ddd4c4; background: #fff; }
.delay-strip.is-late { border-color: #c0261a; background: #fff8f6; }
.delay-strip.on-time { border-color: #0a7a3a; background: #f4fbf6; }
.ds-cell { display: flex; flex-direction: column; gap: 1px; min-width: 7.5rem; }
.ds-k { font-size: 0.72rem; color: var(--muted); }
.ds-red { color: #c0261a; }
.ds-green { color: #0a7a3a; }
.ds-big { font-size: 1.15rem; }
.ds-points { flex: 1 1 100%; }
.ds-jumps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.ds-jump { display: inline-flex; align-items: center; gap: 2px; padding: 3px 10px !important; border-radius: 999px !important; color: #1a5fb4; border-color: #1a5fb4 !important; font-size: 0.82rem; }
.ds-jump b { color: #c0261a; margin-left: 2px; }
@media (max-width: 600px) { .ds-cell { min-width: 44%; } }

/* ---------- Gantt timeline (MS Project style) ---------- */
.tl-board { margin: 8px 0 16px; }
.tl-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.tl-all { min-height: 40px; padding: 6px 12px; border-radius: 8px; border: 1.5px solid #1a5fb4; background: #fff; color: #1a5fb4; font-weight: 700; cursor: pointer; }
.tl-all.on { background: #1a5fb4; color: #fff; }
.gt-zoom { display: inline-flex; gap: 4px; }
.tl-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8125rem; color: #5b5346; margin: 4px 0 8px; align-items: center; }
.gt-key-base::before { content: ""; display: inline-block; width: 26px; height: 4px; background: #b9b2a5; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.gt-key-red::before { content: ""; display: inline-block; width: 26px; height: 8px; background: repeating-linear-gradient(135deg, #c0261a 0 4px, #e0574c 4px 7px); border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.gt-head { position: sticky; top: 0; z-index: 20; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; background: #fff; border: 1.5px solid var(--line); border-bottom: 2px solid #8a8378; border-radius: 8px 8px 0 0; box-shadow: 0 4px 10px -6px rgba(28,25,21,.35); }
.gt-head::-webkit-scrollbar { display: none; }
.gt-body { overflow-x: auto; overflow-y: visible; border: 1.5px solid var(--line); border-top: none; border-radius: 0 0 8px 8px; background: #fff; }
.gt-inner { position: relative; display: flex; flex-direction: column; min-width: max-content; }
.gt-head .gt-inner { flex-direction: row; }
.gt-left { position: sticky; left: 0; z-index: 6; flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: #fbf8f1; border-right: 1.5px solid #cfc6b8; box-sizing: border-box; text-align: left; font: inherit; color: inherit; }
.gt-lefthead { font-size: .75rem; font-weight: 700; color: #5b5346; background: #efe7d4; height: 52px; }
.gt-c-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.gt-c-left { width: 84px; flex: none; font-size: .8125rem; }
.gt-c-st { width: 104px; flex: none; }
.gt-step .gt-c-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-step .gt-sdot { display: inline-block; margin-right: 6px; vertical-align: middle; }
.gt-sumleft .gt-c-name .tl-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
.gt-sumleft .tl-left { font-size: .75rem; }
.gt-scale { position: relative; height: 52px; flex: none; background: #f7f3ea; }
.gt-tier { position: absolute; left: 0; right: 0; }
.gt-tier-top { top: 0; height: 24px; border-bottom: 1px solid #d9d1c2; }
.gt-tier-bottom { top: 24px; height: 28px; }
.gt-t1, .gt-t2 { position: absolute; top: 0; bottom: 0; border-left: 1px solid #d9d1c2; box-sizing: border-box; overflow: hidden; white-space: nowrap; }
.gt-t1 span { position: sticky; left: 0; display: inline-block; padding: 3px 6px; font-weight: 700; font-size: .8125rem; color: #1c1915; }
.gt-t2 span { display: inline-block; padding: 6px 4px; font-size: .75rem; color: #3d372e; }
.gt-d { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; border-left-color: #e6dfd2; }
.gt-d b { font-size: .75rem; color: #1c1915; } .gt-d i { font-style: normal; font-size: .625rem; color: #7a7266; }
.gt-d.off { background: #ece8e0; } .gt-d.off b, .gt-d.off i { color: #9a9284; }
.gt-d.today { background: #c0261a; } .gt-d.today b, .gt-d.today i { color: #fff; }
.gt-today-tag { position: absolute; top: 2px; transform: translateX(-50%); background: #c0261a; color: #fff; font-size: .625rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; white-space: nowrap; z-index: 2; pointer-events: none; }
.gt-grid { position: absolute; top: 0; bottom: 0; pointer-events: none; z-index: 0; }
.gt-off { position: absolute; top: 0; bottom: 0; background: #f0ece4; }
.gt-vl { position: absolute; top: 0; bottom: 0; width: 1px; background: #ede7dc; }
.gt-vl-month { background: #cfc6b8; }
.gt-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #c0261a; z-index: 4; }
.gt-row { position: relative; display: flex; min-height: 34px; border-bottom: 1px solid #eee8dd; }
.gt-row.tl-hide { display: none; }
.gt-chart { position: relative; flex: none; z-index: 1; }
.gt-sumrow { min-height: 48px; border-top: 1.5px solid #cfc6b8; cursor: pointer; }
.gt-sumleft { cursor: pointer; border: none; border-right: 1.5px solid #cfc6b8; background: #fff; min-height: 48px; }
.gt-sumleft:hover, .gt-sumleft:focus-visible { background: #eef4fc; }
.gt-sumleft .tl-name { color: #1a5fb4; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-chev { color: #1a5fb4; font-size: 1.1rem; width: 1em; flex: none; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #1e8c45; }
.tl-trouble .tl-dot { background: #c0261a; } .tl-delayed .tl-dot { background: #d97706; } .tl-done .tl-dot { background: #a39a8a; }
.tl-line1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tl-line2 { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-left: 1.3em; }
.tl-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; border: 1px solid; }
.tl-chip-ontime { background: #e7f6ee; color: #146c35; border-color: #9fd3b1; }
.tl-chip-delayed { background: #fff3e0; color: #9a4f00; border-color: #f2c27c; }
.tl-chip-trouble { background: #fde8e6; color: #a3170d; border-color: #f0a39b; }
.tl-chip-done { background: #efede8; color: #6b645a; border-color: #cfc8bc; }
.tl-left { font-weight: 700; color: #1c1915; } .tl-left.soon { color: #9a4f00; } .tl-left.over { color: #c0261a; } .tl-left.done { color: #6b645a; font-weight: 600; }
/* bars */
.gt-base { position: absolute; height: 4px; bottom: 5px; background: #b9b2a5; border-radius: 2px; }
.gt-base-sum { bottom: 9px; }
.gt-sum { position: absolute; top: 15px; height: 10px; border-radius: 2px; background: #1e8c45; }
.gt-sum::before, .gt-sum::after { content: ""; position: absolute; top: 10px; border-style: solid; border-width: 6px 5px 0 5px; border-color: currentColor transparent transparent transparent; }
.gt-sum::before { left: 0; } .gt-sum::after { right: 0; }
.gt-sum-ontime { background: #1e8c45; color: #1e8c45; } .gt-sum-delayed { background: #d97706; color: #d97706; }
.gt-sum-trouble { background: #8f1d14; color: #8f1d14; } .gt-sum-done { background: #a39a8a; color: #a39a8a; }
.gt-red { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, #c0261a 0 4px, #e0574c 4px 7px); border-radius: 0 2px 2px 0; }
.gt-bar { position: absolute; top: 7px; height: 14px; border-radius: 4px; background: #d7d1c6; border: 1px solid #a39a8a; box-sizing: border-box; overflow: hidden; cursor: default; }
.gt-fill { position: absolute; left: 0; top: 0; bottom: 0; }
.gt-bar.gt-done { background: #b9e2c8; border-color: #1e8c45; } .gt-bar.gt-done .gt-fill { background: #2f9e5a; }
.gt-bar.gt-current { background: #c7ecea; border-color: #0f766e; box-shadow: 0 0 0 2px rgba(15,118,110,.25); } .gt-bar.gt-current .gt-fill { background: #0f766e; }
.gt-bar.gt-late { background: #f9d2cd; border-color: #c0261a; } .gt-bar.gt-late .gt-fill { background: #0f766e; }
.gt-bar.gt-pending { background: #efebe3; border-style: dashed; }
.gt-pct { position: absolute; right: 3px; top: -1px; font-size: .625rem; font-weight: 700; color: #1c1915; text-shadow: 0 0 2px #fff, 0 0 2px #fff; z-index: 1; }
.gt-ms { position: absolute; top: 50%; width: 12px; height: 12px; margin: -9px 0 0 -6px; transform: rotate(45deg); background: #fff; border: 2px solid #1c1915; z-index: 3; }
.gt-sumrow .gt-ms { top: 20px; margin-top: -6px; }
.gt-ms.is-done { background: #1c1915; }
.gt-ms-ok { border-color: #6b3fa0; } .gt-ms-ok.is-done { background: #6b3fa0; }
.gt-ms-label { position: absolute; left: 14px; top: -6px; transform: rotate(-45deg); transform-origin: left top; white-space: nowrap; font-size: .6875rem; font-weight: 700; color: #3d372e; }
.gt-due { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed #c0261a; z-index: 2; }
.gt-due span { position: absolute; top: 1px; left: 2px; font-size: .625rem; font-weight: 700; color: #c0261a; background: #fff; padding: 0 2px; border-radius: 3px; }
.gt-late-tag { position: absolute; top: 7px; font-size: .6875rem; font-weight: 700; color: #c0261a; white-space: nowrap; }
.gt-metarow .gt-meta { flex-wrap: wrap; gap: 4px 10px; font-size: .8125rem; border: none; border-right: 1.5px solid #cfc6b8; background: #f4f8fd; color: #1a5fb4; cursor: pointer; padding: 6px 10px 6px 30px; }
.gt-step { font-size: .8125rem; padding-left: 30px; }
.gt-sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #b9b2a5; }
.gt-sdot.gt-done { background: #1e8c45; } .gt-sdot.gt-current { background: #0f766e; } .gt-sdot.gt-late { background: #c0261a; }
@media (max-width: 600px) {
  .gt-sumleft { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; min-height: 64px; padding: 6px 8px; }
  .gt-sumrow { min-height: 64px; }
  .gt-sumleft .tl-name { font-size: .9375rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .tl-line2 { margin-left: 0; }
  .gt-step { padding-left: 10px; font-size: .75rem; }
  .gt-metarow .gt-meta { padding-left: 10px; }
  .tl-all { min-height: 44px; }
}
/* panning */
.gt-body { cursor: grab; }
.gt-body.is-panning { cursor: grabbing; user-select: none; }
.gt-body .gt-left { cursor: auto; }
.gt-body .gt-sumleft { cursor: pointer; }
.gt-nav { display: inline-flex; gap: 4px; }
.gt-edge { position: absolute; top: 12px; z-index: 5; min-height: 26px; padding: 2px 8px; border-radius: 999px; border: 1.5px solid #1a5fb4; background: #fff; color: #1a5fb4; font-size: .75rem; font-weight: 700; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 6px rgba(28,25,21,.18); }
.gt-edge:hover { background: #1a5fb4; color: #fff; }
@media (max-width: 600px) { .gt-edge { top: 18px; min-height: 30px; } }
/* compact task grid (t147) */
.gt-lefthead { position: sticky; }
.gt-split { position: absolute; right: -5px; top: 0; bottom: 0; width: 10px; cursor: col-resize; z-index: 8; }
.gt-split::after { content: ""; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 2px; border-radius: 1px; background: #a39a8a; }
.gt-split:hover::after { background: #1a5fb4; }
.gt-sumleft { flex-direction: column; align-items: stretch; justify-content: center; gap: 3px; padding: 5px 8px; min-height: 52px; }
.gt-sumrow { min-height: 52px; }
.gt-sumleft .tl-line1 { gap: 5px; }
.gt-sumleft .tl-name { font-size: .9375rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; overflow: hidden; }
.gt-sumleft .tl-line2 { margin-left: 1.25em; gap: 3px 6px; }
.gt-sumleft .tl-chip { font-size: .6875rem; padding: 1px 6px; }
.gt-sumleft .tl-left { font-size: .6875rem; line-height: 1.2; }
.gt-steprow { min-height: 30px; }
.gt-step { gap: 5px; padding: 0 6px 0 18px; font-size: .8125rem; height: 30px; white-space: nowrap; overflow: hidden; }
.gt-step .avatar { flex: none; border-radius: 50%; }
.gt-sn { flex: none; min-width: 18px; height: 18px; border-radius: 9px; font-size: .6875rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; background: #e6e0d4; color: #3d372e; }
.gt-sn.gt-done { background: #d5efdf; color: #146c35; } .gt-sn.gt-current { background: #0f766e; color: #fff; } .gt-sn.gt-late { background: #c0261a; color: #fff; }
.gt-sname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gt-sname b { font-weight: 600; }
.gt-sdate { flex: none; font-size: .6875rem; color: #6b645a; font-variant-numeric: tabular-nums; }
.gt-sdate.is-done { color: #146c35; }
.gt-stag { flex: none; font-size: .6875rem; font-weight: 700; color: #fff; background: #c0261a; border-radius: 4px; padding: 0 4px; }
.gt-steprow .gt-bar { top: 8px; height: 13px; }
.gt-steprow .gt-base { bottom: 3px; height: 3px; }
.gt-steprow .gt-late-tag { top: 7px; }
.gt-metarow { min-height: 28px; }
.gt-metarow .gt-meta { padding: 3px 8px 3px 18px; gap: 2px 8px; font-size: .75rem; }
.gt-meta-c { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-lefthead { height: 52px; }
@media (max-width: 600px) {
  .gt-step { height: 36px; padding-left: 6px; gap: 4px; font-size: .75rem; }
  .gt-steprow { min-height: 36px; }
  .gt-steprow .gt-bar { top: 11px; }
  .gt-sdate { display: none; }
  .gt-sumleft { min-height: 64px; padding: 6px; }
  .gt-sumleft .tl-line2 { margin-left: 0; }
  .gt-metarow .gt-meta { padding-left: 6px; }
}
/* project bands (t148) */
.gt-band-a > .gt-left { background: #ffffff; }
.gt-band-b > .gt-left { background: #f3efe6; }
.gt-band-a > .gt-chart { background: rgba(255,255,255,0); }
.gt-band-b > .gt-chart { background: rgba(120,100,60,.07); }
.gt-row:hover > .gt-left, .gt-row:hover > .gt-chart { background-color: #e8f0fb; }
.gt-row:hover > .gt-chart { background-color: rgba(26,95,180,.08); }
.gt-sumrow { border-top: 2px solid #8a8378; border-bottom: 1px solid #d9d1c2; }
.gt-sumrow:first-of-type { border-top: none; }
.gt-row > .gt-left { box-shadow: inset 5px 0 0 var(--st, #1e8c45); }
.gt-steprow > .gt-left, .gt-metarow > .gt-left { box-shadow: inset 5px 0 0 color-mix(in srgb, var(--st, #1e8c45) 35%, transparent); }
.gt-row.tl-ontime { --st: #1e8c45; } .gt-row.tl-delayed { --st: #d97706; } .gt-row.tl-trouble { --st: #c0261a; } .gt-row.tl-done { --st: #a39a8a; }
.gt-sumleft { padding-left: 12px; }
.gt-sumleft .tl-line1 { flex-wrap: nowrap; }
.gt-sumleft .tl-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: unset; min-width: 0; flex: 1; }
.tl-code { flex: none; font-size: .6875rem; font-weight: 800; letter-spacing: .02em; padding: 1px 6px; border-radius: 4px; color: #fff; background: #1e8c45; }
.tl-code-delayed { background: #b45f06; } .tl-code-trouble { background: #c0261a; } .tl-code-done { background: #8a8378; }
.gt-sum-code { position: absolute; top: 1px; font-size: .625rem; font-weight: 800; color: #3d372e; white-space: nowrap; background: rgba(255,255,255,.85); padding: 0 3px; border-radius: 3px; z-index: 3; }
.gt-sum { top: 16px; height: 9px; }
.gt-sumrow .gt-base-sum { top: 29px; bottom: auto; height: 3px; }
.gt-sumrow .gt-ms { top: 20px; }
.gt-meta-full { flex-basis: 100%; font-weight: 700; color: #1c1915; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .gt-sumleft .tl-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .gt-sumrow .gt-base-sum { top: 29px; }
}
@media (max-width: 600px) {
  .gt-sumleft .tl-line1 { flex-wrap: wrap; row-gap: 2px; }
  .gt-sumleft .tl-name { flex-basis: 100%; font-size: .875rem; }
}
/* 專案總覽 overview head + one-line toolbar (t149) */
.ov-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 4px 0 6px; }
.ov-head h2 { margin: 0; font-size: 1.25rem; }
.ov-en { font-size: .875rem; color: #5b5346; font-weight: 600; }
.ov-total { font-weight: 700; font-size: .875rem; color: #3d372e; }
.ov-count { font-size: .8125rem; }
.tl-tools { flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.tl-tools .tl-all { min-height: 36px; padding: 4px 10px; font-size: .875rem; }
.gt-seg { display: inline-flex; border: 1.5px solid #1a5fb4; border-radius: 8px; overflow: hidden; }
.gt-seg button { min-height: 33px; min-width: 40px; padding: 2px 10px; border: none; border-left: 1px solid #1a5fb4; background: #fff; color: #1a5fb4; font-weight: 700; cursor: pointer; }
.gt-seg button:first-child { border-left: none; }
.gt-seg button.on { background: #1a5fb4; color: #fff; }
.tl-new { margin-left: auto; min-height: 36px; }
.tl-key[hidden] { display: none; }
@media (max-width: 600px) {
  .tl-tools { gap: 5px; }
  .tl-tools .tl-all { min-height: 40px; padding: 4px 8px; font-size: .8125rem; }
  .gt-seg button { min-height: 37px; min-width: 38px; padding: 2px 8px; }
  .tl-new { margin-left: 0; flex-basis: 100%; min-height: 44px; }
}
@media (max-width: 600px) { .tl-tools .tl-en { display: none; } }
/* customer first + search/sort (t150) */
.gt-sumleft .tl-cust { flex: 1; min-width: 0; font-size: 1rem; font-weight: 800; color: #1c1915; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-sumleft .tl-line1b { display: flex; align-items: center; gap: 5px; min-width: 0; margin-left: 1.25em; }
.gt-sumleft .tl-line1b .tl-name { flex: 1; min-width: 0; font-size: .8125rem; font-weight: 600; color: #1a5fb4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.gt-sumleft .tl-code { font-size: .625rem; padding: 0 5px; }
.gt-sumrow, .gt-sumleft { min-height: 66px; }
.gt-sumrow .gt-sum-code { top: 3px; }
.gt-sumrow .gt-sum { top: 20px; } .gt-sumrow .gt-base-sum { top: 33px; } .gt-sumrow .gt-ms { top: 24px; } .gt-sumrow .gt-edge { top: 16px; }
.gt-grouprow { min-height: 26px; border-top: 2px solid #5b5346; }
.gt-group { background: #e9e1cf !important; box-shadow: none !important; font-size: .8125rem; gap: 2px; }
.gt-grouprow > .gt-chart { background: #f1ebdd; }
.gt-row.tl-filt { display: none !important; }
.tl-search { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid #1a5fb4; border-radius: 8px; padding: 0 6px; background: #fff; min-height: 36px; }
.tl-q { border: none; outline: none; min-width: 150px; width: 210px; font: inherit; font-size: .875rem; background: transparent; padding: 4px 2px; }
.tl-q::-webkit-search-cancel-button { display: none; }
.tl-qn { font-size: .75rem; color: #5b5346; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-qx { border: none; background: none; color: #1a5fb4; font-weight: 800; cursor: pointer; min-width: 28px; min-height: 28px; }
.tl-qx[hidden] { display: none; }
.tl-sort { display: inline-flex; align-items: center; gap: 4px; }
.tl-sort-k { font-size: .8125rem; color: #5b5346; }
.tl-sort select { min-height: 36px; border: 1.5px solid #1a5fb4; border-radius: 8px; color: #1a5fb4; font-weight: 700; background: #fff; padding: 0 6px; cursor: pointer; }
.case-title { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.ct-cust .cname { font-size: 1.1em; font-weight: 800; color: #1c1915; }
.ct-proj { font-size: .85em; font-weight: 600; }
.ct-code { display: inline-block; background: #5b5346; color: #fff; vertical-align: middle; font-size: .7rem; }
@media (max-width: 600px) {
  .tl-search { flex: 1 1 100%; } .tl-q { flex: 1; width: auto; min-width: 0; }
  .gt-sumleft .tl-cust { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .9375rem; }
  .gt-sumleft .tl-line1b { margin-left: 0; }
  .gt-sumrow, .gt-sumleft { min-height: 84px; }
}
@media (max-width: 600px) {
  .tl-tools .tl-zh-long, .tl-sort-k { display: none; }
  .tl-search { flex: 1 1 auto; min-width: 0; }
  .tl-new { flex-basis: auto; margin-left: 0; min-height: 40px; padding: 4px 10px; }
  .tl-tools .tl-all, .tl-new { padding: 4px 8px; }
  .gt-seg button { min-width: 34px; padding: 2px 6px; }
}
@media (max-width: 600px) {
  .tl-search { flex: 1 1 0; width: 0; }
  .tl-q { width: 0; flex: 1 1 0; min-width: 0; }
  .tl-tools { row-gap: 6px; }
  .tl-sort select { min-height: 40px; }
}
@media (max-width: 600px) {
  .tl-tools > * { order: 3; }
  .tl-tools > .tl-search { order: 0; flex: 1 1 130px; width: auto; }
  .tl-tools > .tl-sort { order: 1; }
  .tl-tools > .tl-new { order: 2; }
  .tl-q { flex: 1 1 auto; width: 60px; }
  .tl-qn { font-size: .6875rem; }
}
.tl-sort-k { white-space: nowrap; }
.gt-group { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 26px; padding-top: 0; padding-bottom: 0; }
/* customer+project bubble (t154) */
.pbub { display: inline-flex; align-items: baseline; gap: 5px; max-width: 100%; min-width: 0; padding: 2px 10px; border-radius: 999px; background: var(--pb, #5b5346); color: #fff; font-size: .875rem; line-height: 1.35; white-space: nowrap; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); vertical-align: middle; }
.pbub-c { font-weight: 800; flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.pbub-sep { opacity: .7; flex: none; }
.pbub-n { font-weight: 500; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pbub-pn { flex: none; font-size: .6875rem; font-weight: 600; color: rgba(255,255,255,.75); }
.pbub-sm { font-size: .6875rem; padding: 0 7px; max-width: 260px; }
.gt-sumleft .tl-line1 { min-width: 0; }
.gt-sumleft .tl-line1 .pbub { flex: 1 1 auto; }
.gt-sumleft .tl-line2 { margin-left: 1.25em; }
.gt-sumrow, .gt-sumleft { min-height: 54px; }
.gt-sumrow .gt-sum-code { top: 1px; background: none; padding: 0; }
.gt-sumrow .gt-sum { top: 20px; } .gt-sumrow .gt-base-sum { top: 33px; } .gt-sumrow .gt-ms { top: 24px; } .gt-sumrow .gt-edge { top: 14px; }
.case-title .pbub { font-size: 1rem; padding: 3px 12px; }
h2 .case-title .pbub, h3 .case-title .pbub { font-size: 1.0625rem; }
@media (max-width: 600px) {
  .gt-sumleft .tl-line1 .pbub { white-space: normal; flex-wrap: wrap; border-radius: 10px; row-gap: 0; }
  .gt-sumleft .pbub-c { max-width: 100%; }
  .gt-sumleft .pbub-n { flex-basis: 100%; white-space: nowrap; }
  .gt-sumleft .pbub-sep { display: none; }
  .gt-sumleft .tl-line2 { margin-left: 0; }
  .gt-sumrow, .gt-sumleft { min-height: 76px; }
  .case-title .pbub { white-space: normal; border-radius: 12px; flex-wrap: wrap; }
}
/* second cue for customers beyond the 24-colour palette */
.pbub-cue { box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.pbub-cue1 { outline: 2px dashed rgba(255,255,255,.85); outline-offset: -4px; }
.pbub-cue2 { outline: 2px dotted rgba(255,255,255,.9); outline-offset: -4px; }
.pbub-cue3 { outline: 3px double rgba(255,255,255,.85); outline-offset: -5px; }
.pbub-cue4 { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.14) 0 4px, transparent 4px 9px); }
.pbub-ini { flex: none; width: 1.35em; height: 1.35em; border-radius: 50%; background: #fff; color: var(--pb); font-weight: 900; font-size: .75em; display: inline-flex; align-items: center; justify-content: center; align-self: center; }
/* Gantt grid: two-line bubble at all sizes so customer and project both stay readable */
.gt-sumleft .tl-line1 .pbub { white-space: normal; flex-wrap: wrap; border-radius: 10px; row-gap: 0; padding: 3px 9px; line-height: 1.25; }
.gt-sumleft .pbub-c { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 100%; }
.gt-sumleft .pbub-sep { display: none; }
.gt-sumleft .pbub-n { flex: 1 1 0; white-space: nowrap; font-size: .8125rem; }
.gt-sumleft .pbub-pn { align-self: center; }
.gt-sumrow, .gt-sumleft { min-height: 66px; }
@media (max-width: 600px) { .gt-sumleft .pbub-c { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .gt-sumrow, .gt-sumleft { min-height: 84px; } }
/* compact project list (t156) */
.plist { margin: 6px 0 14px; }
.pl-rows { display: flex; flex-direction: column; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.pl-item + .pl-item { border-top: 1px solid #e3dccf; }
.pl-group { padding: 4px 12px; font-size: .8125rem; font-weight: 800; background: #e9e1cf; border-top: 2px solid #5b5346; }
.pl-group:first-child { border-top: none; }
.pl-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px 8px 14px; border: none; background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; box-shadow: inset 5px 0 0 var(--st, #1e8c45); min-height: 56px; }
.pl-row.tl-ontime { --st: #1e8c45; } .pl-row.tl-delayed { --st: #d97706; } .pl-row.tl-trouble { --st: #c0261a; } .pl-row.tl-done { --st: #a39a8a; }
.pl-row:hover, .pl-row:focus-visible { background: #eef4fc; }
.pl-item.is-open > .pl-row { background: #eef4fc; border-bottom: 1px solid #cfd9e8; }
.pl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pl-main .pbub { align-self: flex-start; max-width: 100%; }
.pl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .8125rem; }
.pl-cur { display: inline-flex; align-items: center; gap: 3px; font-size: .8125rem; }
.pl-cur .avatar { border-radius: 50%; }
.pl-prog { flex: none; display: flex; align-items: center; gap: 6px; width: 120px; }
.pl-bar { flex: 1; height: 6px; border-radius: 3px; background: #e6e0d4; overflow: hidden; }
.pl-bar i { display: block; height: 100%; background: #2f9e5a; }
.pl-pn { font-size: .75rem; color: #5b5346; font-variant-numeric: tabular-nums; }
.pl-detail { padding: 8px 12px 14px; background: #fbf8f1; }
.pl-back { margin-bottom: 8px; }
.pl-filter { cursor: pointer; font: inherit; font-size: .8125rem; }
.pl-filter.on { outline: 2px solid #1a5fb4; outline-offset: 1px; }
.pl-chips { display: inline-flex; gap: 4px; }
.pl-hide { display: inline-flex; align-items: center; gap: 4px; font-size: .8125rem; color: #3d372e; cursor: pointer; }
.pl-note { margin: 6px 2px; font-size: .8125rem; }
@media (max-width: 600px) {
  .pl-row { flex-wrap: wrap; gap: 6px 8px; padding: 8px 10px 8px 12px; }
  .pl-prog { width: 100%; order: 3; padding-left: 1.4em; }
  .pl-main .pbub { white-space: normal; flex-wrap: wrap; border-radius: 10px; }
  .pl-tools > .tl-search { order: 0; flex: 1 1 100%; }
  .pl-tools > * { order: 1; }
  .pl-filter { min-height: 36px; min-width: 44px; }
}
/* t157: opened project = row header + one compact strip + diagram */
.pl-head { display: flex; align-items: stretch; background: #eef4fc; border-bottom: 1px solid #cfd9e8; }
.pl-head > .pl-row { flex: 1; min-width: 0; border-bottom: none; background: transparent; }
.pl-back { flex: none; align-self: center; margin: 0 10px 0 4px; padding: 4px 10px; min-height: 32px; font-size: .8125rem; border-radius: 16px; border: 1.5px solid #1a5fb4; background: #fff; color: #1a5fb4; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pl-back:hover { background: #1a5fb4; color: #fff; }
.pl-detail { padding: 6px 10px 12px; }
.pl-detail > .team, .pl-detail > div > .team { margin: 0; padding: 0; border: none; box-shadow: none; background: transparent; }
.pl-item.is-done:not(.is-open) > .pl-row { background: #f3f1ec; color: #6b6457; }
.rec-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 5px 8px; margin: 0 0 6px; border: 1px solid #ddd4c4; border-radius: 8px; background: #fff; font-size: .8125rem; }
.rec-strip.is-late { border-color: #e7b3ad; background: #fff8f7; }
.rec-strip .chip { margin: 0; }
.rs-k { color: #6b6457; font-size: .75rem; margin-right: 3px; }
.rs-mini { display: inline-flex; align-items: center; gap: 2px; }
.rs-track { display: inline-block; width: 46px; height: 5px; margin-left: 4px; border-radius: 3px; background: #e6e0d4; overflow: hidden; }
.rs-track i { display: block; height: 100%; background: #2f9e5a; }
.rs-mini.over .rs-track i { background: #c47d00; }
.rs-dates b { margin-right: 2px; }
.rs-late { font-size: .9375rem; }
.rec-strip .ds-jump { padding: 2px 7px; font-size: .75rem; min-height: 26px; }
.project-record > .dg-wrap { margin-top: 0; }
.dg-wrap > .dg-tools { position: absolute; top: 6px; right: 6px; z-index: 3; padding: 2px 4px; gap: 2px; border: 1px solid #ddd4c4; border-radius: 8px; background: rgba(255,255,255,.92); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.dg-wrap > .dg-tools button { min-width: 28px; min-height: 28px; padding: 0 6px; font-size: .875rem; }
.dg-wrap > .dg-scroll { max-height: max(360px, calc(100vh - 260px)); }
@media (max-width: 600px) {
  .pl-head { flex-wrap: wrap; }
  .pl-back { margin: 0 8px 8px auto; }
  .pl-head > .pl-row { flex-basis: 100%; }
  .dg-wrap > .dg-scroll { max-height: 72vh; }
  .rec-strip { gap: 4px 6px; }
}
/* t158: new-project form opens at its top */
.np-form { scroll-margin-top: 8px; transition: box-shadow .3s, outline-color .3s; outline: 3px solid transparent; outline-offset: 4px; border-radius: 10px; }
.np-form.np-flash { outline-color: #1a5fb4; box-shadow: 0 0 0 6px rgba(26,95,180,.15); }
.np-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.np-head h2 { margin: 0; }
.np-en { font-size: .8em; font-weight: 600; }
.np-cancel { padding: 6px 14px; min-height: 40px; border-radius: 20px; border: 1.5px solid #5b5346; background: #fff; font-weight: 700; cursor: pointer; }
.np-cancel:hover { background: #f3efe6; }
/* t161: step hours without budget bars */
.dg-spent { font-size: 12px; font-weight: 700; fill: #0a7a3a !important; }
.dg-est { font-size: 11px; fill: #8a8275 !important; }
/* t162: roster search */
.roster-tools { margin: 4px 0 10px; }
.roster-tools .tl-search { flex: 1 1 320px; }
.city-chip.on { background: #1a5fb4; color: #fff; border-color: #1a5fb4; outline: none; }
mark.hit { background: #ffe58a; color: inherit; padding: 0 1px; border-radius: 2px; }
.roster-empty { padding: 22px 12px; text-align: center; font-weight: 700; border: 1.5px dashed #cfc6b8; border-radius: 10px; background: #fff; }
@media (max-width: 600px) { .roster-tools .tl-search { flex-basis: 100%; } }
.roster-tools .tl-search .tl-q { flex: 1 1 auto; width: auto; min-width: 0; }
/* t163: resource utilization card */
.util-slot { position: relative; margin-left: auto; display: inline-flex; }
.util-slot:empty { display: none; }
.util-card { display: inline-flex; align-items: center; gap: 10px; padding: 4px 12px; min-height: 44px; border: 1.5px solid #cfc6b8; border-radius: 10px; background: #fff; font: inherit; color: #1c1915; cursor: pointer; text-align: left; }
.util-card:hover, .util-card[aria-expanded="true"] { border-color: #5b5346; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.util-staff { font-weight: 800; font-size: .9375rem; white-space: nowrap; }
.util-mid { display: flex; flex-direction: column; gap: 2px; min-width: 170px; }
.util-top { font-size: .8125rem; white-space: nowrap; }
.util-en { color: #6b6457; }
.util-pct { font-size: 1rem; }
.util-bar { position: relative; display: flex; height: 7px; border-radius: 4px; background: #e9e3d7; overflow: hidden; }
.util-bar i { display: block; height: 100%; }
.util-used { background: var(--ut, #2f9e5a); min-width: 2px; }
.util-booked { background: var(--ut, #2f9e5a); opacity: .3; }
.util-green { --ut: #2f9e5a; } .util-green .util-pct { color: #1e7a3f; }
.util-amber { --ut: #d97706; } .util-amber .util-pct { color: #a85a00; }
.util-red { --ut: #c0261a; } .util-red .util-pct { color: #c0261a; }
.util-sub { font-size: .75rem; color: #5b5346; white-space: nowrap; font-variant-numeric: tabular-nums; }
.util-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: 360px; max-width: calc(100vw - 24px); max-height: 70vh; overflow: auto; padding: 10px 12px; background: #fff; border: 1.5px solid #5b5346; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: .8125rem; }
.util-pop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.util-x { border: none; background: none; font-size: 1rem; cursor: pointer; min-width: 32px; min-height: 32px; }
.util-pop h5 { margin: 8px 0 3px; font-size: .8125rem; }
.util-tbl { width: 100%; border-collapse: collapse; }
.util-tbl td { padding: 2px 4px; border-bottom: 1px solid #f0ebe1; }
.util-tbl td:last-child, .util-p { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.util-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.util-role { padding: 1px 7px; border-radius: 10px; background: #f3efe6; white-space: nowrap; }
.util-top3 { margin: 0; padding-left: 1.3em; }
.util-top3 li { display: flex; align-items: center; gap: 4px; margin: 3px 0; }
.util-top3 .avatar { border-radius: 50%; }
.util-name { font-weight: 700; }
.util-rule { margin: 8px 0 0; font-size: .72rem; line-height: 1.4; }
@media (max-width: 600px) {
  .util-slot { margin-left: 0; flex: 1 1 100%; }
  .util-card { width: 100%; }
  .util-mid { flex: 1; min-width: 0; }
  .util-pop { left: 0; right: auto; width: 100%; max-width: none; }
}
/* t165: a done project is fully monochrome everywhere (stored customer colour is only hidden, not changed) */
.gt-row.tl-done > .gt-left, .gt-row.tl-done > .gt-chart,
.pl-item.is-done > .pl-row, .pl-item.is-done > .pl-head, .pl-item.is-done > .pl-detail { filter: grayscale(1); }
.gt-row.tl-done .pbub, .pl-item.is-done .pbub { filter: brightness(.82) contrast(1.15); }
/* t166: message search */
.msg-search { display: flex; width: 100%; margin: 0 0 6px; box-sizing: border-box; }
.msg-search .tl-q { flex: 1 1 auto; width: auto; min-width: 0; }
.msg-hit { align-items: flex-start; }
.msg-hit .avatar { border-radius: 50%; flex: none; }
.msg-in { font-weight: 400; font-size: .75rem; }
.msg-snip { display: block; font-size: .8125rem; color: #3d372e; line-height: 1.35; white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg-wait { font-size: .8125rem; margin: 4px 6px; }
.msg-none { padding: 14px 8px; }
.bubble.msg-flash { outline: 3px solid #f2b705; outline-offset: 2px; background: #fff7d6 !important; transition: background .4s; }
/* t167: 訊息 left column — my projects accordion */
.msg-proj-block { border: 1px solid #e3dccf; border-radius: 10px; margin: 0 0 6px; background: #fff; overflow: hidden; }
.msg-proj-block.open { border-color: #b9ae9b; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.msg-proj { display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 8px; border: none; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; min-height: 44px; }
.msg-proj:hover, .msg-proj.open { background: #f6f2ea; }
.msg-proj .pbub { min-width: 0; max-width: 100%; flex: 0 1 auto; white-space: normal; flex-wrap: wrap; border-radius: 10px; row-gap: 0; padding: 3px 8px; line-height: 1.3; font-size: .75rem; }
.msg-proj .pbub-c { max-width: none; }
.chat-head .pbub { vertical-align: middle; }
.msg-proj .unread-n { flex: none; }
.msg-proj-body { padding: 2px 4px 6px 14px; border-top: 1px solid #ece5d8; }
.msg-member { min-height: 44px; }
.msg-member[disabled] { opacity: .55; cursor: default; }
.msg-role { display: block; font-size: .75rem; }
.msg-now { flex: none; font-size: .72rem; font-weight: 700; color: #0f766e; background: #e3f5f2; border-radius: 8px; padding: 0 6px; }
button.msg-fold { display: block; width: 100%; box-sizing: border-box; margin: 6px 0 4px; text-align: left; border: none; background: none; cursor: pointer; padding: 6px 10px; min-height: 36px; }
@media (max-width: 800px) {
  .agent-side { display: block; max-height: 52vh; overflow-y: auto; overflow-x: hidden; }
  .agent-side .agent-folder { width: 100%; min-width: 0; }
  .msg-search { min-height: 44px; }
}
/* t168: GM messaging rule */
.msg-member.locked { filter: grayscale(1); }
.msg-lock { flex: none; font-size: .75rem; }
.msg-readonly { margin: 8px 12px 12px; padding: 12px; border: 1.5px dashed #b9ae9b; border-radius: 10px; background: #fff; color: #5b5346; font-size: .875rem; }

/* ---------- Drawing numbers 圖號 / drawing history ---------- */
.chip.chip-dn { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #eef2f7; color: #1f3a5f; border: 1px solid #c9d6e6; cursor: pointer; font-size: .82em; }
.chip.chip-dn:hover { background: #e1e9f3; }
.chip.chip-draft { background: #fdecea; color: #b3261e; border: 1px dashed #e0a39d; }
.dg-dn { font-size: 10.5px; fill: #1f3a5f; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dg-dn.dg-dn-rev { fill: #1b5e20; font-weight: 700; }
.draw-history { margin: 10px 0 6px; padding: 10px 12px; border: 1px solid #dfe5ec; border-radius: 10px; background: #fafcfe; transition: box-shadow .3s; }
.draw-history.dh-flash { box-shadow: 0 0 0 3px #f2b84b; }
.dh-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dh-head h4 { margin: 0; font-size: 14px; }
.dh-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #1f3a5f; margin-left: 4px; }
.dh-dl { margin-left: auto; font-size: 13px; font-weight: 600; color: #1b5e20; text-decoration: none; border: 1px solid #a5d6a7; border-radius: 999px; padding: 2px 10px; background: #f1f8f1; }
.dh-note { font-size: 12px; flex-basis: 100%; }
.dh-saved { color: #1b5e20; font-size: 12px; }
.dh-line { list-style: none; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 0; margin: 10px 0 2px; padding: 0; }
.dh-node { display: flex; align-items: flex-start; gap: 6px; position: relative; padding-right: 26px; }
.dh-node:not(:last-child)::after { content: "→"; position: absolute; right: 7px; top: 3px; color: #9aa7b4; }
.dh-dot { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: #c62828; }
.dh-rev .dh-dot { background: #2e7d32; border-radius: 6px; }
.dh-void .dh-dot { background: #9e9e9e; }
.dh-text { display: flex; flex-direction: column; line-height: 1.25; font-size: 12.5px; }
.dh-text b a { color: inherit; text-decoration: underline dotted; }
.dh-void .dh-text b { text-decoration: line-through; color: #757575; }
.dh-drafttag { color: #b3261e; font-size: 11px; }
.dh-oktag { color: #1b5e20; font-size: 11px; font-weight: 600; }
.dh-voidtag { color: #757575; font-size: 11px; font-weight: 700; }
.dh-meta { color: #78838f; font-size: 11px; }
.dh-orig { font-size: 11px; color: #5c6b7a; }
.dh-other { opacity: .78; }
.dh-lock { color: #8a96a3; }
.dh-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #dfe5ec; font-size: 13px; }
.dn-field { border: 1px solid #dfe5ec; border-radius: 10px; padding: 8px 12px; margin: 6px 0; }
.dn-field legend { font-weight: 600; padding: 0 4px; }
.dn-sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 2px 0 6px 26px; }
.dn-sub select, .dn-sub input { max-width: 100%; }
.dn-oldrev { width: 7em; }
.dn-settings { margin: 18px 0 6px; border: 1px solid #dfe5ec; border-radius: 10px; padding: 8px 12px; background: #fff; }
.dn-settings summary { cursor: pointer; font-weight: 600; }
.dn-body label { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dn-body input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; min-width: 16em; flex: 1 1 16em; }
.dn-prev { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #1f3a5f; }
.pl-item.is-done .chip-dn, .gt-row.tl-done .chip-dn { filter: grayscale(1); }
@media (max-width: 640px) {
  .dh-line { flex-direction: column; }
  .dh-node { padding-right: 0; padding-bottom: 14px; }
  .dh-node:not(:last-child)::after { content: "↓"; right: auto; left: 6px; top: auto; bottom: -1px; }
  .dh-dl { margin-left: 0; }
}

/* ---------- PDF viewer (viewer.js) ---------- */
body.pv-open { overflow: hidden; }
.pv { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: #3a3f47; color: #eef1f4; font-size: 14px; outline: none; }
.pv-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #23272e; border-bottom: 1px solid #111; min-height: 52px; }
.pv-head-left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.pv-head-left .pbub { max-width: 42vw; }
.pv-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; color: #fff; letter-spacing: .02em; }
.pv-ver { background: #fff; color: #222; border-radius: 8px; padding: 6px 8px; font-size: 14px; max-width: 60vw; }
.pv-chip { border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.pv-chip-draft { background: #fdecea; color: #b3261e; border: 1px solid #f1a7a1; }
.pv-chip-ok { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.pv-chip-void { background: #eeeeee; color: #555; border: 1px solid #bbb; text-decoration: line-through; }
.pv-chip-file { background: #e3eaf3; color: #1f3a5f; }
.pv-spacer { flex: 1 1 auto; }
.pv-tools { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #2c3138; overflow-x: auto; scrollbar-width: thin; white-space: nowrap; }
.pv-group { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-left: 1px solid #444b55; }
.pv-btn { min-width: 38px; height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid #4d5560; background: #39404a; color: #f3f5f7; font-size: 16px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.pv-btn:hover { background: #48505b; }
.pv-btn.on { background: #f2b84b; color: #222; border-color: #f2b84b; }
.pv-btn[hidden] { display: none; }
.pv-close { font-size: 18px; background: #5b2d2d; border-color: #7b3a3a; }
.pv-pageno { width: 3.6em; height: 34px; border-radius: 6px; border: 1px solid #4d5560; text-align: center; font-size: 14px; }
.pv-count, .pv-zoom, .pv-hits { color: #cfd6de; font-size: 13px; min-width: 3.2em; text-align: center; }
.pv-q { width: 13em; height: 34px; border-radius: 6px; border: 1px solid #4d5560; padding: 0 8px; font-size: 14px; }
.pv-mscale { height: 34px; border-radius: 6px; }
.pv-body { flex: 1 1 auto; display: flex; min-height: 0; position: relative; }
.pv-thumbs { flex: 0 0 140px; overflow-y: auto; background: #2a2e35; padding: 8px; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid #222; }
.pv-thumbs[hidden] { display: none; }
.pv-thumb { background: none; border: 2px solid transparent; border-radius: 6px; padding: 2px; cursor: pointer; color: #cfd6de; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 90px; }
.pv-thumb canvas { max-width: 110px; box-shadow: 0 1px 4px rgba(0,0,0,.5); background: #fff; }
.pv-thumb.on { border-color: #f2b84b; }
.pv-main { flex: 1 1 auto; overflow: auto; touch-action: pan-x pan-y; cursor: grab; position: relative; }
.pv-main[hidden] { display: none; }
.pv-main.pv-grab { cursor: grabbing; user-select: none; }
.pv-measuring .pv-main { cursor: crosshair; }
.pv-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 12px; width: max-content; min-width: 100%; box-sizing: border-box; }
.pv-page { position: relative; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.45); flex: 0 0 auto; }
.pv-canvas { display: block; }
.pv-hl, .pv-ms { position: absolute; inset: 0; pointer-events: none; }
.pv-hit { position: absolute; background: rgba(255, 213, 0, .45); border-radius: 2px; mix-blend-mode: multiply; }
.pv-hit.now { background: rgba(255, 120, 0, .6); outline: 2px solid #ff6d00; }
.pv-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #e53935; border: 2px solid #fff; box-shadow: 0 0 0 1px #e53935; }
.pv-line { position: absolute; height: 2px; background: #e53935; transform-origin: 0 50%; }
.pv-mlabel { position: absolute; transform: translate(-50%, -130%); background: #e53935; color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pv-note { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: rgba(20,22,26,.92); color: #fff; padding: 8px 14px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
.pv-note.show { opacity: 1; }
.pv-compare { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.pv-compare[hidden] { display: none; }
.pv-cmp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; background: #2c3138; }
.pv-cmp-bar select { height: 34px; border-radius: 6px; max-width: 70vw; }
.pv-cmp-legend { font-size: 13px; color: #dfe4ea; }
.pv-lg-a { color: #ff6b6b; font-weight: 700; } .pv-lg-b { color: #6aa6ff; font-weight: 700; } .pv-lg-s { color: #bdbdbd; }
.pv-cmp-view { flex: 1 1 auto; overflow: auto; padding: 12px; display: flex; justify-content: center; align-items: flex-start; }
.pv-diff { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.45); }
.pv-side { display: flex; gap: 14px; align-items: flex-start; }
.pv-side figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.pv-side figcaption { font-size: 13px; color: #dfe4ea; }
.pv-side canvas { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.45); }
.pv-wait { color: #dfe4ea; }
.chip.chip-view { background: #1f3a5f; color: #fff; border: 1px solid #1f3a5f; cursor: pointer; }
.pv-print { display: none; }
@media print {
  body.pv-open > *:not(.pv-print) { display: none !important; }
  .pv-print { display: block !important; }
  .pv-print img { width: 100%; page-break-after: always; break-after: page; display: block; }
}
@media (max-width: 700px) {
  .pv-bar { padding: 6px 8px; gap: 6px; }
  .pv-head-left .pbub { max-width: 100%; }
  .pv-ver { max-width: 100%; font-size: 15px; }
  .pv-btn { min-width: 44px; height: 44px; font-size: 18px; }
  .pv-q { width: 9em; }
  .pv-thumbs { position: absolute; z-index: 2; inset: 0 auto 0 0; box-shadow: 4px 0 12px rgba(0,0,0,.5); }
  .pv-pages { padding: 8px; gap: 10px; }
}
.pv input, .pv select { width: auto; margin: 0; color: #15181c; background: #fff; }
.pv .pv-ver { width: auto; }
.pv-cmp-bar label { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: #eef1f4; }
@media (max-width: 700px) { .pv .pv-ver { width: 100%; } .pv-head-left .pv-no { font-size: 14px; } }

/* ---------- 繪圖工作 Drafting work (job orders) ---------- */
.dw { max-width: 980px; }
.dw-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.dw-head h2 { margin: 0; }
.dw-count { color: #5b6470; font-size: 14px; }
.dw-search { width: 100%; box-sizing: border-box; font-size: 16px; padding: 12px 14px; border-radius: 10px; border: 1px solid #c9d1da; margin: 12px 0 6px; }
.dw-saved { background: #e8f5e9; color: #1b5e20; padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.dw-sec { margin: 18px 0; }
.dw-sec > h3, .dw-done > summary { font-size: 17px; margin: 0 0 10px; }
.dw-done > summary { cursor: pointer; padding: 8px 0; color: #455; }
.dw-list { display: grid; gap: 12px; }
.dw-card { border: 1px solid #d8dee6; border-left: 6px solid #9aa5b1; border-radius: 12px; padding: 14px 16px; background: #fff; box-shadow: 0 1px 3px rgba(20,30,40,.06); }
.dw-card.dw-ack { border-left-color: #f2a516; background: #fffaf0; }
.dw-card.dw-doing { border-left-color: #2f6fd6; }
.dw-card.dw-done { border-left-color: #43a047; opacity: .85; }
.dw-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dw-st { border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.dw-st-ack { background: #fff0cc; color: #8a5a00; }
.dw-st-doing { background: #e3edff; color: #1f4fa8; }
.dw-st-done { background: #e8f5e9; color: #1b5e20; }
.dw-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 6px; font-size: 14px; }
.dw-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; background: #f1f4f8; padding: 3px 8px; border-radius: 6px; }
.dw-no-new { font-family: inherit; font-weight: 500; color: #5b6470; }
.dw-days { border-radius: 6px; padding: 3px 8px; }
.dw-days-ok { background: #eef6ee; color: #256029; }
.dw-days-soon { background: #fff0cc; color: #8a5a00; }
.dw-days-late { background: #fdecea; color: #b3261e; font-weight: 700; }
.dw-days-done { background: #f1f4f8; color: #5b6470; }
.dw-todo p { margin: 4px 0; line-height: 1.5; }
.dw-fb { background: #fff4f2; border-radius: 6px; padding: 4px 8px; }
.dw-files a { margin-right: 10px; }
.dw-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dw-btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid #c9d1da; background: #f7f9fb; font-size: 15px; cursor: pointer; }
.dw-btn.primary { background: #2f6fd6; color: #fff; border-color: #2f6fd6; font-weight: 700; }
.dw-ack .dw-btn.primary { background: #1f8a3a; border-color: #1f8a3a; }
.dw-big { min-height: 52px; font-size: 17px; padding: 0 22px; }
.dw-upload { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border: 1px dashed #9db5dc; border-radius: 10px; background: #f6f9ff; max-width: 560px; }
.dw-upload label { display: grid; gap: 4px; font-size: 14px; }
.dw-upload input { font-size: 16px; padding: 8px; }
.dw-pick { font-weight: 700; }
.dw-picked { font-weight: 600; color: #1f4fa8; }
.dw-name { margin: 0; }
@media (max-width: 700px) {
  .dw-card { padding: 12px; }
  .dw-actions .dw-btn { flex: 1 1 100%; }
  .dw-big { width: 100%; }
  .dw-upload { max-width: none; }
}
.dw-list > * { min-width: 0; }
.dw-card { overflow-wrap: anywhere; }
.dw-card .pbub { white-space: normal; max-width: 100%; flex-wrap: wrap; height: auto; }
.dw-req { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.dw-req.open { display: block; }
.dw-search { min-width: 0; }
.dw-card .pbub { border-radius: 12px; }

/* ---------- 訊息 chat: big sender avatars, grouped runs, readable header, auto-grow composer ---------- */
.msg-group { display: flex; align-items: flex-start; gap: 10px; max-width: min(88%, 800px); }
.msg-group.other { align-self: flex-start; }
.msg-group.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-face { flex: none; position: sticky; top: 0; }
.msg-face .avatar, .msg-face img, .msg-face .agent-face { width: 42px !important; height: 42px !important; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0,0,0,.18); }
.msg-face .avatar-initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 16px !important; }
.msg-col { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.msg-group.mine .msg-col { align-items: flex-end; }
.msg-col .bubble { max-width: 100%; }
.msg-who { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: .8125rem; line-height: 1.3; padding: 0 4px; }
.msg-group.mine .msg-who { flex-direction: row-reverse; }
.msg-name { font-weight: 700; color: #1c1915; font-size: .875rem; }
.msg-role { font-size: .6875rem; background: #efeae1; color: #5b5346; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.msg-time { color: #8a8275; font-size: .75rem; font-weight: 400; }
.msg-time-sub { padding: 0 6px; }
.agent-case.chat-head { display: block; padding: 12px 20px; }
.msg-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.msg-head-team { justify-content: space-between; }
.msg-head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg-head-name { font-size: 1.0625rem; }
.msg-head-sub { font-size: .75rem; color: #8a8275; }
.msg-head .pbub { white-space: normal; font-size: .9375rem; line-height: 1.35; padding: 4px 12px; border-radius: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; }
.msg-head .pbub .pbub-c { font-weight: 800; }
.msg-head-person .avatar { width: 48px !important; height: 48px !important; border-radius: 50%; object-fit: cover; }
.msg-stack { display: flex; align-items: center; flex: none; padding-left: 8px; }
.msg-stack .avatar { width: 34px !important; height: 34px !important; border-radius: 50%; object-fit: cover; margin-left: -8px; box-shadow: 0 0 0 2px #fff; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.msg-stack-more { margin-left: -8px; width: 34px; height: 34px; border-radius: 50%; background: #5b5346; color: #fff; font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.composer textarea { min-height: 0; resize: none; line-height: 1.45; overflow-y: auto; max-height: 240px; }
@media (max-width: 700px) {
  .msg-group { max-width: 94%; gap: 8px; }
  .msg-face .avatar, .msg-face img, .msg-face .agent-face { width: 36px !important; height: 36px !important; }
  .agent-case.chat-head { padding: 10px 12px; }
  .msg-head .pbub { font-size: .875rem; }
  .msg-stack .avatar, .msg-stack-more { width: 28px !important; height: 28px !important; }
}
.msg-hbub { display: flex; flex-direction: column; gap: 1px; min-width: 0; max-width: 100%; padding: 6px 14px; border-radius: 12px; background: var(--pb, #5b5346); color: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.msg-hbub-c { font-size: 1rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-hbub-n { font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .95; }
.msg-hbub-pn { margin-left: 8px; font-size: .75rem; padding: 0 6px; border-radius: 6px; background: rgba(255,255,255,.22); font-weight: 700; }
@media (max-width: 700px) { .msg-hbub { padding: 5px 10px; } .msg-hbub-c { font-size: .9375rem; } .msg-hbub-n { font-size: .8125rem; } }
@media (max-width: 700px) {
  .msg-hbub-c, .msg-hbub-n { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .msg-head-team { align-items: flex-start; }
  .msg-stack .avatar:nth-child(n+4) { display: none; }
}
.msg-stack-phone { display: none; }
@media (max-width: 700px) { .msg-stack .msg-stack-more:not(.msg-stack-phone) { display: none; } .msg-stack .msg-stack-phone { display: inline-flex; } }

/* Tutorial videos (login page only) */
.tut { width: min(560px, 100%); margin: 28px auto 0; }
.tut-h { font-size: 1.05rem; margin: 0 0 10px; }
.tut-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tut-card { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 1.5px solid var(--line); background: transparent; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.tut-card:hover, .tut-card:focus-visible { border-color: #1b6b3a; }
.tut-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #222; }
.tut-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tut-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff; display: grid; place-items: center; font-size: 18px; padding-left: 3px; box-sizing: border-box; }
.tut-time { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.72); color: #fff; font-size: .78rem; padding: 1px 6px; border-radius: 3px; font-variant-numeric: tabular-nums; }
.tut-name { padding: 2px 10px 9px; font-weight: 600; font-size: .95rem; }
.tut-over { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.82); display: grid; place-items: center; padding: 16px; box-sizing: border-box; }
.tut-box { width: min(1280px, 100%); max-height: 100%; display: flex; flex-direction: column; }
.tut-bar { display: flex; align-items: center; justify-content: space-between; color: #fff; padding: 0 0 8px; gap: 12px; }
.tut-x { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.4); width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; flex: none; }
.tut-video { width: 100%; max-height: calc(100vh - 90px); background: #000; display: block; }
@media (max-width: 480px) { .tut-row { gap: 10px; } .tut-name { font-size: .88rem; padding: 2px 8px 8px; } .tut-over { padding: 8px; } }
.np-prod[hidden] { display: none !important; }
.apply-extra[hidden] { display: none !important; }

.pv-viewonly { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 13px; background: #fff4e5; color: #8a4b00; border: 1px solid #f3c27a; white-space: nowrap; }
.pv-viewonly[hidden] { display: none; }

/* Login: photo left ~60%, form right on desktop; stacked on phone with the form near the top. */
.login-split { display: block; }
.login-split .login-card { margin-top: 14px; }
@media (max-width: 899px) { .login-split .welcome-art { max-height: 20vh; object-fit: cover; } }
@media (min-width: 900px) {
  .login-split { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; align-items: stretch; }
  .login-split .welcome-art { margin: 0; height: 100%; width: 100%; object-fit: cover; }
  .login-split .login-card { width: 100%; margin: 0; }
}
@media (min-width: 900px) {
  .login-split + .tut { margin-top: 14px; }
  .login-split + .tut .tut-thumb { aspect-ratio: 16 / 7; }
  .door-split .login-card h2:first-child, .door-split .login-card h3:first-child { margin-top: 10px; }
}
@media (min-width: 900px) {
  .login-split + .tut .tut-thumb { aspect-ratio: 16 / 5; }
  .login-split + .tut { margin-top: 8px; }
  h1:has(+ .login-split) { margin-top: 6px; margin-bottom: 6px; }
}
@media (min-width: 900px) { .wrap:has(.login-split) { margin: 14px auto 12px; } .sheet:has(.login-split) { padding-bottom: 18px; } }
body:has(.login-split) { min-height: 0; }
/* Brand photo: never crop the people. */
.login-split .welcome-art { object-fit: contain !important; background: var(--sheet); }
@media (max-width: 899px) { .login-split .welcome-art { max-height: none !important; height: auto; } }
