/* 職位日誌（核定版面：B 員工檔案＋C 月曆）。治理工作區語彙：深藍分層、白細線、暖金選取、閱讀紙。 */
.office-page.plog-page { max-width: 1440px; }
.plog-panel { max-width: none; }
.plog { --plog-paper: #fafaf7; --plog-ink: #202c40; --plog-tint: rgba(245, 185, 113, 0.10); --plog-gold-line: rgba(245, 185, 113, 0.45);
    --k-chat: var(--office-warm); --k-meeting: #7cc4ff; --k-call: #6ee7a0; --k-note: #c7b8f5; --k-void: #e46a5a;
    display: grid; gap: 18px; min-width: 0; }
.plog-btn { font: inherit; font-size: 14px; min-height: 40px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--office-card-border);
    background: var(--office-bg-2); color: var(--office-text); cursor: pointer; transition: border-color .15s ease-out, background-color .15s ease-out; }
.plog-btn:hover { border-color: var(--plog-gold-line); }
.plog-btn:disabled { opacity: .55; cursor: default; }
.plog-btn.primary { background: var(--office-warm); border-color: var(--office-warm); color: #30200e; font-weight: 650; }
.plog-btn.ghost { background: transparent; }
.plog-btn.danger { background: transparent; color: #ffb4a8; border-color: rgba(228, 106, 90, 0.5); }
.plog-btn.small { min-height: 32px; padding: 3px 10px; font-size: 13px; }
.plog-btn.icon { width: 40px; padding: 0; font-size: 18px; }
.plog :is(button, input, textarea, select):focus-visible { outline: 2px solid var(--office-warm); outline-offset: 2px; }
.plog-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--office-card-border); color: var(--office-text-dim); white-space: nowrap; }
.plog-tag.kind { color: var(--office-text); }
.plog-tag.s1 { color: #6ee7a0; border-color: rgba(110, 231, 160, 0.4); }
.plog-tag.s2 { color: #7cc4ff; border-color: rgba(124, 196, 255, 0.4); }
.plog-tag.s3 { color: #f59e8b; border-color: rgba(245, 158, 139, 0.45); }
.plog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--office-text-dim); font-variant-numeric: tabular-nums; margin: 0; }
.plog-empty { color: var(--office-text-dim); margin: 12px 0; }

/* 員工切換 */
.plog-crew { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.plog-chip { display: inline-flex; align-items: center; gap: 9px; padding: 5px 14px 5px 5px; border: 1px solid var(--office-card-border); border-radius: 999px;
    background: var(--office-bg-2); color: var(--office-text); font: inherit; font-size: 15px; cursor: pointer; white-space: nowrap; min-height: 42px; }
.plog-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.plog-chip[aria-selected="true"] { background: var(--plog-tint); border-color: var(--plog-gold-line); color: var(--office-warm); }

/* 員工檔案 */
.plog-profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding: 18px 20px;
    border: 1px solid var(--office-card-border); border-radius: 14px; background: var(--office-bg-2); }
.plog-face { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(245, 185, 113, 0.6); }
.plog-profile h2 { margin: 0; font-size: 24px; }
.plog-profile p { margin: 2px 0 0; color: var(--office-text-dim); }
.plog-stats { display: flex; gap: 4px; }
.plog-stat { display: grid; justify-items: end; gap: 0; padding: 6px 12px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--office-text); font: inherit; cursor: pointer; }
.plog-stat b { font-size: 22px; font-variant-numeric: tabular-nums; }
.plog-stat span { font-size: 12.5px; color: var(--office-text-dim); }
.plog-stat.is-on { background: var(--plog-tint); border-color: var(--plog-gold-line); }
.plog-stat.is-on b { color: var(--office-warm); }
.plog-profile > .plog-form { grid-column: 1 / -1; }

/* 心得 */
.plog-lessons-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.plog-lessons-head h3 { margin: 0; font-size: 16px; }
.plog-lessons-head .plog-btn { margin-left: auto; }
.plog-lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.plog-lesson { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--office-card-border); border-radius: 10px; background: var(--office-bg-2); }
.plog-lesson.is-draft { border-style: dashed; border-color: var(--plog-gold-line); }
.plog-lesson p { margin: 0; line-height: 1.6; }
.plog-lesson > p:first-child { max-width: none; }

/* 每月摘要：沿用心得卡，一個月一張；全文保留換行，長的在卡片內捲動 */
.plog-summaries { margin-top: 4px; }
.plog-summary-ask { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.plog-lessons-head .plog-summary-ask .plog-btn { margin-left: 0; }
.plog-month { min-height: 40px; padding: 0 10px; border: 1px solid var(--office-card-border); border-radius: 8px; background: var(--office-bg-2);
    color: var(--office-text); font: inherit; font-size: 14px; }
.plog-month:focus-visible { outline: 2px solid var(--plog-gold-line); outline-offset: 2px; }
.plog-summary-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 10px; }
.plog-summary-top { display: flex; align-items: center; gap: 8px; }
.plog-summary-top h4 { margin: 0; font-size: 15px; }
.plog-summary .plog-summary-text { white-space: pre-wrap; max-height: 320px; overflow-y: auto; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.plog-summary .plog-form textarea { min-height: 240px; }

/* 主體：左側月曆＋時間軸，右側全文 */
.plog-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 540px); gap: 22px; align-items: start; }
.plog-left { min-width: 0; display: grid; gap: 14px; }
.plog-cal { padding: 14px 16px; border: 1px solid var(--office-card-border); border-radius: 12px; background: var(--office-bg-2); }
.plog-cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.plog-cal-head h3 { flex: 1; margin: 0; font-size: 17px; text-align: center; font-variant-numeric: tabular-nums; }
.plog-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.plog-wd { font-size: 12px; color: var(--office-text-dim); text-align: center; padding: 2px 0; }
.plog-day { position: relative; min-height: 50px; padding: 5px 7px; border: 1px solid var(--office-card-border); border-radius: 8px; background: transparent;
    color: var(--office-text); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; text-align: left; cursor: pointer; }
.plog-day:disabled { cursor: default; color: var(--office-text-dim); opacity: .55; }
.plog-day.is-blank { border-color: transparent; }
.plog-day.has:hover { border-color: var(--plog-gold-line); }
.plog-day.is-today { box-shadow: inset 0 0 0 1px rgba(245, 185, 113, 0.35); }
.plog-day.is-on { background: var(--plog-tint); border-color: var(--plog-gold-line); color: var(--office-warm); }
.plog-dots { position: absolute; left: 7px; right: 6px; bottom: 6px; display: flex; flex-wrap: wrap; gap: 3px; }
.plog-dots i, .plog-legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--k-chat); }
.plog .k-meeting { background: var(--k-meeting); } .plog .k-call, .plog .k-client_meeting { background: var(--k-call); }
.plog .k-note { background: var(--k-note); } .plog .k-void { background: var(--k-void); }
.plog-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 0; font-size: 12.5px; color: var(--office-text-dim); }
.plog-legend i { margin-right: 5px; vertical-align: 1px; width: 8px; height: 8px; }
.plog-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.plog-seg { display: inline-flex; border: 1px solid var(--office-card-border); border-radius: 8px; overflow: hidden; }
.plog-seg button { font: inherit; font-size: 13.5px; min-height: 38px; padding: 6px 12px; background: transparent; color: var(--office-text-dim); border: 0; border-right: 1px solid var(--office-card-border); cursor: pointer; }
.plog-seg button:last-child { border-right: 0; }
.plog-seg button.is-on { background: var(--plog-tint); color: var(--office-warm); }
.plog-search { flex: 1 1 220px; }
.plog-search input { width: 100%; min-height: 38px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--office-card-border); background: var(--office-bg-2); color: var(--office-text); font: inherit; font-size: 14px; }
.plog-count { font-size: 13px; color: var(--office-text-dim); font-variant-numeric: tabular-nums; }
.plog-timeline { position: relative; padding-left: 22px; }
.plog-timeline::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--office-card-border); }
.plog-date { position: relative; margin: 16px 0 8px; font-size: 13px; font-weight: 500; color: var(--office-text-dim); font-variant-numeric: tabular-nums; }
.plog-date:first-child { margin-top: 2px; }
.plog-date::before { content: ''; position: absolute; left: -21px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--office-warm); }
.plog-card { display: grid; gap: 4px; width: 100%; margin-bottom: 8px; padding: 12px 14px; border: 1px solid var(--office-card-border); border-radius: 10px;
    background: var(--office-bg-2); color: var(--office-text); font: inherit; text-align: left; cursor: pointer; }
.plog-card:hover { border-color: var(--plog-gold-line); }
.plog-card.is-on { background: var(--plog-tint); border-color: var(--plog-gold-line); }
.plog-card.is-on .plog-card-title { color: var(--office-warm); }
.plog-card-title { font-weight: 600; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plog-card.is-void .plog-card-title { text-decoration: line-through; color: var(--office-text-dim); }

/* 全文（閱讀紙） */
.plog-reader { position: sticky; top: 12px; max-height: calc(100dvh - 24px); overflow: auto; border-radius: 10px; scrollbar-width: thin; scrollbar-color: rgba(245, 185, 113, .3) transparent; }
.plog-reader > .plog-empty { padding: 22px; border: 1px dashed var(--office-card-border); border-radius: 10px; margin: 0; }
.plog-paper { background: var(--plog-paper); color: var(--plog-ink); border-radius: 10px; padding: 20px 22px 18px; }
.plog-paper h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.4; }
.plog-facts { margin: 0 0 10px; font-size: 12.5px; color: #626979; font-variant-numeric: tabular-nums; }
.plog-back { display: none; }
.plog-void-note { margin: 0 0 10px; padding: 8px 10px; border-radius: 6px; background: #fdecea; color: #a1372b; font-size: 13.5px; }
.plog-line { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 2px 12px; padding: 9px 0; border-bottom: 1px solid #e9e4d8; }
.plog-line-head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.plog-line:last-of-type { border-bottom: 0; }
.plog-when { font-size: 12.5px; color: #7a7f8c; font-variant-numeric: tabular-nums; padding-top: 2px; }
.plog-who { font-weight: 700; font-size: 14px; }
.plog-who.is-agent { color: #8a5a1c; }
.plog-line p { margin: 2px 0 0; max-width: none; line-height: 1.65; overflow-wrap: anywhere; }
.plog-line.is-void p { text-decoration: line-through; color: #9aa0aa; }
.plog-why { display: block; margin-top: 3px; font-size: 12.5px; color: #b0473a; }
.plog-doc { display: inline-block; margin: 6px 8px 0 0; padding: 3px 10px; border-radius: 999px; border: 1px solid #d9d3c4;
    background: #fff; color: #8a5a1c; font-size: 13px; text-decoration: none; }
.plog-doc:hover { border-color: #b8975a; }
.plog-line.is-note { background: #fff6e5; border-radius: 6px; padding: 9px 10px; margin: 4px 0; border-bottom: 0; }
.plog-line.is-note .plog-who { color: #8a5a1c; }
.plog-line-acts { display: flex; gap: 6px; margin-left: auto; opacity: 0; transition: opacity .15s ease-out; }
.plog-line:hover .plog-line-acts, .plog-line:focus-within .plog-line-acts { opacity: 1; }
.plog-paper .plog-btn { background: #fff; color: var(--plog-ink); border-color: #d9d3c4; }
.plog-paper .plog-btn.danger { color: #b0473a; border-color: #e6b7ae; }
.plog-paper .plog-btn.primary { background: var(--office-warm); border-color: var(--office-warm); color: #30200e; }
.plog-paper .plog-acts { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.plog-paper .plog-meta { color: #626979; }
.plog-form { display: grid; gap: 8px; margin-top: 10px; }
.plog-form :is(input, textarea, select) { width: 100%; min-height: 40px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--office-card-border);
    background: var(--office-bg-1); color: var(--office-text); font: inherit; font-size: 14px; }
.plog-paper .plog-form :is(input, textarea, select) { background: #fff; color: var(--plog-ink); border-color: #d9d3c4; }
.plog-form-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.plog-acts { display: flex; gap: 6px; flex-wrap: wrap; }

@media (hover: none) { .plog-line-acts { opacity: 1; } }
@media (max-width: 1000px) {
    .plog-body { grid-template-columns: 1fr; }
    .plog-reader { position: fixed; inset: 0; z-index: 30; max-height: none; border-radius: 0; background: var(--office-bg-1); padding: 12px; display: none; }
    .plog.is-reading .plog-reader { display: block; }
    .plog-back { display: inline-flex; align-items: center; margin-bottom: 10px; }
    .plog-profile { grid-template-columns: auto minmax(0, 1fr); }
    .plog-stats { grid-column: 1 / -1; justify-content: space-between; }
    .plog-profile > .plog-btn { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 560px) {
    .plog-face { width: 56px; height: 56px; }
    .plog-profile h2 { font-size: 20px; }
    .plog-day { min-height: 42px; padding: 4px 5px; }
    .plog-line { grid-template-columns: 40px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .plog-btn, .plog-line-acts { transition: none; } }

/* 檢視切換：工作日誌／工作說明書 */
.plog > [hidden] { display: none; }
.plog-views { display: flex; gap: 4px; border-bottom: 1px solid var(--office-card-border); }
.plog .plog-view { font: inherit; font-size: 15px; min-height: 44px; padding: 8px 16px; margin-bottom: -1px; background: none; border: 0; border-radius: 0;
    border-bottom: 2px solid transparent; color: var(--office-text-dim); cursor: pointer; }
.plog .plog-view:hover { color: var(--office-text); }
.plog .plog-view.is-on { color: var(--office-warm); border-bottom-color: var(--office-warm); font-weight: 650; }

/* 工作說明書：左邊是閱讀紙，右邊是版本與操作 */
.plog-jd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 22px; align-items: start; }
.plog-jd-doc { min-width: 0; }
.plog-jd-paper, .plog-jd-form { padding: 26px 30px 24px; }
.plog-jd-kicker { margin: 0 0 6px; font-size: 12.5px; letter-spacing: .04em; color: #8a5a1c; font-weight: 650; }
.plog-jd-paper h3, .plog-jd-form h3 { font-size: 21px; }
.plog-jd-duties { margin: 14px 0 18px; padding: 12px 14px; border-radius: 8px; background: #fff6e5; }
.plog-jd-duties h4 { margin: 0 0 4px; font-size: 13px; color: #8a5a1c; }
.plog-jd-duties > p { margin: 0; line-height: 1.7; }
.plog-jd-text { max-width: 72ch; line-height: 1.75; overflow-wrap: anywhere; }
.plog-jd-text h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: #626979; }
.plog-jd-text h5 { margin: 20px 0 6px; font-size: 16px; color: var(--plog-ink); }
.plog-jd-text h6 { margin: 14px 0 4px; font-size: 14.5px; }
.plog-jd-text p { margin: 4px 0; }
.plog-jd-text :is(ul, ol) { margin: 4px 0 8px; padding-left: 1.3em; }
.plog-jd-text ul { list-style: disc; }
.plog-jd-text ol { list-style: decimal; }
.plog-jd-text li { margin: 3px 0; }
.plog-jd-legend { margin: 10px 0 0; }
.plog-diff { font-size: 14px; line-height: 1.7; border: 1px solid #e9e4d8; border-radius: 8px; overflow: hidden; background: #fff; }
.plog-diff-line { display: grid; grid-template-columns: 22px minmax(0, 1fr); padding: 1px 10px 1px 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.plog-diff-line.is-add { background: #e6f4ea; color: #1d5a32; }
.plog-diff-line.is-del { background: #fdecea; color: #8f2d22; }
.plog-diff-line.is-del span:last-child { text-decoration: line-through; }
.plog-diff-sign { text-align: center; font-weight: 700; }
.plog-jd-side { display: grid; gap: 12px; position: sticky; top: 12px; }
.plog-jd-card { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--office-card-border); border-radius: 12px; background: var(--office-bg-2); }
.plog-jd-card.is-draft { border-style: dashed; border-color: var(--plog-gold-line); }
.plog-jd-card h4 { margin: 0; font-size: 15.5px; }
.plog-jd-card > .plog-btn { justify-self: start; }
.plog-jd-help { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--office-text-dim); }
.plog-jd-warn { margin: 0; font-size: 13.5px; color: #ffb4a8; }
.plog-tag.is-active { color: var(--office-warm); border-color: var(--plog-gold-line); }
.plog-versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.plog-version { width: 100%; display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 8px; min-height: 40px; padding: 6px 8px;
    border: 0; border-radius: 8px; background: none; color: var(--office-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.plog-version:hover { background: var(--plog-tint); }
.plog-version.is-discarded b { color: var(--office-text-dim); font-weight: 500; }
.plog-version-meta { font-size: 12.5px; color: var(--office-text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plog-jd-form { display: grid; gap: 14px; }
.plog-jd-form > .plog-facts { margin: 0; }
.plog-jd-field { display: grid; gap: 6px; }
.plog-jd-label { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.plog-jd-label b { font-size: 14.5px; }
.plog-jd-label small { font-size: 12.5px; color: #626979; }
.plog-jd-field :is(input, textarea) { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #d9d3c4; background: #fff; color: var(--plog-ink);
    font: inherit; font-size: 14.5px; line-height: 1.65; }
.plog-jd-textarea { min-height: 420px; resize: vertical; }
.plog-jd-count { justify-self: end; font-size: 12px; color: #7a7f8c; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) {
    .plog-jd { grid-template-columns: 1fr; }
    .plog-jd-side { position: static; order: -1; }
}
@media (max-width: 560px) {
    .plog-jd-paper, .plog-jd-form { padding: 18px 16px; }
    .plog-version { grid-template-columns: auto auto; }
    .plog-version-meta { grid-column: 1 / -1; }
}
