/* 單頁紀錄工作區抽屜：桌機靠右約 62vw（上限 1100px），手機全螢幕。沿用 styles.css 的色彩變數與按鈕樣式。 */
.record-drawer { position: fixed; inset: 0 0 0 auto; width: min(62vw, 1100px); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--line, #e4e9e7); background: var(--card, #fff); color: var(--ink, #18201e); box-shadow: -18px 0 50px rgba(15, 30, 26, .18); overflow: hidden; }
.record-drawer[open] { display: flex; flex-direction: column; animation: record-drawer-in .18s ease-out; }
.record-drawer::backdrop { background: rgba(15, 30, 26, .38); }
@keyframes record-drawer-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .record-drawer[open] { animation: none; } }
.record-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px 12px; border-bottom: 1px solid var(--line, #e4e9e7); }
.record-drawer-heading { min-width: 0; }
.record-drawer-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.record-drawer-title-row h2 { margin: 0; font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }
.record-drawer-subtitle { margin: 4px 0 0; color: var(--muted, #66736f); font-size: 13px; }
.record-drawer-close { flex: none; min-height: 34px; width: 36px; padding: 0; font-size: 22px; font-weight: 400; line-height: 1; }
.record-drawer-tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line, #e4e9e7); overflow-x: auto; scrollbar-width: thin; }
.record-drawer-tabs .record-drawer-tab { flex: none; min-height: 38px; padding: 8px 12px; border-radius: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted, #66736f); font-size: 13px; font-weight: 700; }
.record-drawer-tabs .record-drawer-tab:hover { background: var(--green-soft, #e8f6f1); color: var(--green-dark, #006c53); transform: none; }
.record-drawer-tabs .record-drawer-tab[aria-selected="true"] { border-bottom-color: var(--green, #008f6d); color: var(--green-dark, #006c53); }
.record-drawer-message { margin: 0; padding: 0 22px; font-size: 13px; color: var(--green-dark, #006c53); }
.record-drawer-message:not(:empty) { padding: 8px 22px; background: #f2faf7; border-bottom: 1px solid #cde5dd; }
.record-drawer-message[data-tone="error"] { color: #b42318; background: #fff4f2; border-color: #f1c4bf; }
.record-drawer-panel { flex: 1; min-height: 0; overflow: auto; padding: 18px 22px 28px; outline: none; }
.record-drawer-body > * + * { margin-top: 18px; }
.record-drawer-body h3 { margin: 0 0 8px; font-size: 15px; }
.record-drawer-body .button-row { margin-top: 0; }
.record-drawer-note { margin: 8px 0 0; color: var(--muted, #66736f); font-size: 13px; }
.record-drawer-body > .record-drawer-note { margin-top: 8px; }
.record-drawer-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.record-drawer-section-head h3 { margin: 0; }
.record-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 0; }
.record-facts div { padding: 10px 12px; border: 1px solid var(--line, #e4e9e7); border-radius: 10px; background: var(--bg, #f5f7f6); }
.record-facts dt { color: var(--muted, #66736f); font-size: 12px; }
.record-facts dd { margin: 2px 0 0; font-weight: 800; overflow-wrap: anywhere; }
.record-drawer-body table { width: 100%; }
.record-task-detail td { background: var(--bg, #f5f7f6); }
.record-task-detail dl { margin: 0 0 8px; }
.record-timeline { list-style: none; margin: 0; padding: 0; }
.record-timeline li { padding: 10px 0; border-bottom: 1px solid var(--line, #e4e9e7); }
.record-timeline small { display: block; color: var(--muted, #66736f); }
.record-link { min-height: 0; padding: 0; border: 0; background: none; color: var(--green-dark, #006c53); font: inherit; font-weight: 700; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.record-link:hover { background: none; color: var(--green, #008f6d); transform: none; }
.record-list-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 12px; }
.record-list-filter label { display: grid; gap: 4px; font-size: 12px; color: var(--muted, #66736f); }
.record-list-filter input, .record-list-filter select { min-height: 38px; padding: 7px 10px; border: 1px solid #c9d6d2; border-radius: 8px; font: inherit; font-size: 14px; }
.record-list-filter input { width: min(320px, 100%); }
@media (max-width: 760px) {
  .record-drawer { inset: 0; width: 100vw; border-left: 0; }
  .record-drawer-head { padding: 14px 16px 10px; }
  .record-drawer-panel { padding: 14px 16px 24px; }
  .record-list-filter label, .record-list-filter input { width: 100%; }
}
.record-drawer-error { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #f1c4bf; border-radius: 10px; background: #fff4f2; color: #b42318; font-size: 13px; }
