@media screen {
  .leave-list-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 14px; }
  .leave-list-tabs button { padding:8px 14px; font:inherit; font-weight:650; border:1px solid #bdd3e2; border-radius:10px; background:#fff; color:#24566e; }
  .leave-list-tabs button.active { background:#deedf7; border-color:#5594b8; }
  .leave-list-tabs b { font-size:12px; margin-left:5px; background:#ffedc5; border-radius:12px; padding:2px 6px; }
  #leave-history-panel[hidden],#review-view[hidden],.history-query label[hidden] { display:none!important; }
  .history-query { display:flex; gap:12px; align-items:end; flex-wrap:wrap; margin:12px 0; }
  .history-query label { display:grid; gap:5px; font-size:13px; }
  .history-search-label { flex:1; min-width:200px; }
  .history-query input,.history-query select { width:100%; min-width:0; }
  .history-year-picker { white-space:nowrap; }
  .history-count { display:inline-flex; min-width:20px; justify-content:center; padding:1px 5px; border-radius:10px; background:#e6edf3; color:#34566d; font-size:12px; }
  [data-filter="pending"] .history-count,[data-filter="returned"] .history-count { background:#fff0cf; color:#89570f; }
  #history-list .record-row { display:grid; grid-template-columns:minmax(160px,1.1fr) minmax(160px,1fr) minmax(80px,.5fr) minmax(200px,1.2fr) 16px; gap:12px; width:100%; padding:10px 12px!important; text-align:left; font:inherit; color:inherit; }
  .record-main { display:grid; gap:4px; }
  #history-list .record-main strong { font-size:14px; }
  #history-list .record-main>span { font-size:12px; }
  .record-progress { display:grid; gap:5px; justify-items:start; }
  .leave-next-step { color:#14735f!important; font-size:14px; font-weight:700; overflow-wrap:anywhere; }
  .leave-workflow strong,.leave-workflow>span { display:block; margin-top:5px; }
  .leave-compact-report table { width:100%; table-layout:fixed; }
  .oa-ui .leave-compact-report table th:nth-child(1) { width:5%!important; }
  .oa-ui .leave-compact-report table th:nth-child(2) { width:10%!important; }
  .oa-ui .leave-compact-report table th:nth-child(3) { width:12%!important; }
  .oa-ui .leave-compact-report table th:nth-child(4) { width:22%!important; }
  .oa-ui .leave-compact-report table th:nth-child(5) { width:8%!important; }
  .oa-ui .leave-compact-report table th:nth-child(6),.oa-ui .leave-compact-report table th:nth-child(7) { width:8%!important; }
  .oa-ui .leave-compact-report table th:nth-child(8) { width:27%!important; }
  .leave-compact-report .report-name,.leave-compact-report .report-date { font-size:14px!important; }
  .leave-compact-report td { overflow-wrap:anywhere; vertical-align:top; }
  .leave-compact-report .report-date { white-space:normal!important; }
  .report-note summary { cursor:pointer; color:#365e79; }
  .report-note p { margin:6px 0 0; white-space:pre-wrap; }
}
@media screen and (max-width:1050px) {
  #history-list .record-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr) 16px; }
  #history-list .record-row .arrow { grid-column:3; grid-row:1 / span 2; }
  #history-list .date-range { display:block!important; }
}
@media screen {
  #detail-modal .detail-modal { display:flex; flex-direction:column; max-height:calc(100dvh - 30px); overflow:hidden!important; }
  #detail-modal .modal-head { flex-shrink:0; margin-bottom:12px; }
  #detail-content { min-height:0; overflow-y:auto; overflow-x:hidden; padding-right:8px; }
  #detail-actions { flex-shrink:0; flex-wrap:wrap; margin-top:10px; padding-top:12px; }
  #detail-content .detail-note { margin-bottom:12px; }
  .detail-empty-summary { color:#647181; font-size:13px; margin:8px 0 12px; }
  .leave-history { margin:16px 0 8px; }
  .leave-history summary { font-weight:700; cursor:pointer; padding:8px 0; }
  .history-latest { font-size:12px; color:#647181; line-height:1.5; overflow-wrap:anywhere; }
  .leave-history .timeline { margin-top:12px; }
  .leave-history[open] + .history-latest { display:none; }
  #review-list .review-support { font-size:13px; color:#425568; overflow-wrap:anywhere; margin:6px 0; }
  #leave-modal #form-error { flex-shrink:0; margin:8px 0; font-size:13px; line-height:1.5; }
}
.leave-detail-meta { grid-template-columns:repeat(2,minmax(0,1fr)); }
.leave-detail-progress { display:block; color:#526575; margin-top:6px; font-size:12px; }
/* Pending change comparisons share one compact presentation in list and detail. */
.leave-change-comparison{margin:8px 0;padding:10px;border:1px solid #cbdce7;border-radius:8px;background:#f7fafc;min-width:0}
.leave-change-comparison h3{margin:0 0 6px;font-size:14px}
.leave-change-comparison table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px;line-height:1.4}
.leave-change-comparison th,.leave-change-comparison td{padding:6px 8px;vertical-align:top;text-align:left;border-bottom:1px solid #dce6ed;overflow-wrap:anywhere;white-space:pre-wrap}
.leave-change-comparison th:first-child{width:20%}.leave-change-comparison thead th{color:#536d7d;background:#edf4f8}
.leave-change-comparison tbody tr:last-child>*{border-bottom:0}
.leave-submission-result{display:flex;align-items:center;gap:12px;margin:0 0 12px;padding:9px 12px;border:1px solid #9dcfc7;border-radius:8px;background:#edf8f4;color:#155b52;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.leave-submission-result>span{flex:1;min-width:0}.leave-submission-result>button{flex:none;padding:6px 10px;font-size:13px}.leave-submission-result small{font-size:12px}
