/* Common list filters: allow added sorting controls without creating an implicit grid row. */
@media screen {
  body #app main#main .toolbar {
    min-width:0 !important; max-width:100% !important; box-sizing:border-box;
  }
  body #app main#main .toolbar>input:is([type=search],[type=text],:not([type])) {
    box-sizing:border-box !important; flex:1 1 240px !important; width:280px !important;
    min-width:180px !important; max-width:320px !important;
  }
  body #app main#main .toolbar>select {
    box-sizing:border-box !important; flex:0 1 auto !important; width:auto !important;
    min-width:112px !important; max-width:240px !important;
  }
  body #app main#main .toolbar>.kmi-list-sort-select {
    flex:0 0 176px !important; width:176px !important; min-width:176px !important; max-width:176px !important;
  }
  body #app main#main .toolbar>input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  body #app main#main .toolbar>select,
  body #app main#main .toolbar>.btn,
  body #app main#main .toolbar>.panel-actions>.btn {
    height:var(--kmi-field-height,38px) !important; min-height:var(--kmi-field-height,38px) !important;
    max-height:var(--kmi-field-height,38px) !important; margin-top:0 !important; margin-bottom:0 !important;
  }
  body #app main#main :is(.table-wrap,.ap-table-wrap,.legacy-table-wrap) {
    width:100% !important; min-width:0 !important; max-width:100% !important;
    box-sizing:border-box !important; overflow-x:auto !important;
  }
  body #app main#main #trainingBody .training-library-toolbar {
    display:flex !important; flex-wrap:wrap !important; align-items:center !important; gap:8px !important;
  }
  body #app main#main #trainingBody .training-library-toolbar>input {
    flex:1 1 240px !important; width:280px !important; min-width:180px !important; max-width:320px !important;
  }
  body #app main#main #trainingBody .training-library-toolbar>select {
    flex:0 0 176px !important; width:176px !important; min-width:176px !important; max-width:176px !important;
  }
  body #app main#main .patrol-template-form.inspection113-video-upload {
    display:grid !important; grid-template-columns:minmax(0,1fr) max-content !important;
    align-items:end !important; gap:10px !important;
  }
  body #app main#main .patrol-template-form.inspection113-video-upload>label {
    display:grid; gap:6px; min-width:0;
  }
  body #app main#main .patrol-template-form.inspection113-video-upload input,
  body #app main#main .patrol-template-form.inspection113-video-upload>.btn {
    box-sizing:border-box !important; width:100%; min-width:0;
    height:var(--kmi-field-height,38px) !important; min-height:var(--kmi-field-height,38px) !important;
    max-height:var(--kmi-field-height,38px) !important; margin:0 !important;
  }
  body #app main#main .patrol-template-form.inspection113-video-upload input[type=file] { padding:5px 8px !important; }
}
@media screen and (max-width:620px) {
  body #app main#main .toolbar>input:is([type=search],[type=text],:not([type])),
  body #app main#main #trainingBody .training-library-toolbar>input {
    flex-basis:100% !important; width:100% !important; min-width:0 !important; max-width:100% !important;
  }
  body #app main#main .toolbar>select,
  body #app main#main #trainingBody .training-library-toolbar>select {
    flex:1 1 140px !important; width:auto !important; min-width:0 !important; max-width:100% !important;
  }
  body #app main#main .patrol-template-form.inspection113-video-upload { grid-template-columns:minmax(0,1fr) !important; }
}
/* V468: scoped live editors. Printed report markup and global controls are unchanged. */
@media screen {
  body #app main#main #workCompletionBody .work-completion-toolbar {
    width:100%; max-width:1120px; margin:0 auto 12px; box-sizing:border-box;
    display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:8px;
  }
  body #app main#main #workCompletionBody .work-completion-editor-scroll {
    width:100%; max-width:1120px; min-width:0; margin:0 auto 20px; padding:2px;
    box-sizing:border-box; overflow:auto;
  }
  body #app main#main #workCompletionBody .work-completion-sheet.is-editable {
    width:100% !important; min-width:1000px !important; max-width:none !important;
    margin:0 !important; font-size:13px !important; box-shadow:none !important;
    contain:none !important; content-visibility:visible !important;
  }
  body #app main#main #workCompletionBody .is-editable .work-completion-table th,
  body #app main#main #workCompletionBody .is-editable .work-completion-table td {
    height:auto !important; min-height:0 !important; max-height:none !important;
    padding:6px !important; vertical-align:middle !important; overflow:visible !important;
    border:1px solid #b9c6d8 !important; line-height:1.4 !important; box-sizing:border-box;
  }
  body #app main#main #workCompletionBody .is-editable .work-completion-person-field,
  body #app main#main #workCompletionBody .is-editable .work-completion-managed-field {
    display:flex !important; align-items:center !important; gap:6px !important;
    height:auto !important; min-height:var(--kmi-field-height,38px) !important;
    min-width:0 !important; width:100% !important; overflow:visible !important; box-sizing:border-box;
  }
  body #app main#main #workCompletionBody .is-editable input:not([type=hidden]),
  body #app main#main #workCompletionBody .is-editable select,
  body #app main#main #workCompletionBody .is-editable .btn,
  body #app main#main #workCompletionBody .work-completion-toolbar .btn {
    box-sizing:border-box !important; height:var(--kmi-field-height,38px) !important;
    min-height:var(--kmi-field-height,38px) !important; max-height:var(--kmi-field-height,38px) !important;
    border:1px solid #b9c6d8 !important; border-radius:5px !important; margin:0 !important;
    padding:0 8px !important; line-height:normal !important; font-size:13px !important;
    box-shadow:none !important; outline-offset:2px;
  }
  body #app main#main #workCompletionBody .is-editable .work-completion-person-field>input[type=text],
  body #app main#main #workCompletionBody .is-editable .work-completion-managed-field>select {
    flex:1 1 0 !important; width:0 !important; min-width:0 !important; max-width:none !important;
  }
  body #app main#main #workCompletionBody .is-editable .work-completion-person-field>.btn {
    flex:0 0 56px !important; width:56px !important; min-width:56px !important;
  }
  body #app main#main #workCompletionBody .is-editable .work-completion-managed-field>.btn {
    flex:0 0 76px !important; width:76px !important; min-width:76px !important;
  }
  body #app main#main #workCompletionBody .is-editable .work-completion-edit-wrap {
    display:block !important; height:auto !important; min-height:var(--kmi-field-height,38px) !important;
    max-height:none !important; padding:0 !important; overflow:visible !important;
  }
  body #app main#main #workCompletionBody .is-editable .work-completion-edit-value {
    box-sizing:border-box !important; height:auto !important; min-height:var(--kmi-field-height,38px) !important;
    max-height:none !important; padding:8px !important; border:1px solid #b9c6d8 !important;
    border-radius:5px !important; background:#fff !important; font-size:13px !important;
    line-height:1.5 !important; overflow:visible !important; white-space:pre-wrap !important;
  }
  body #app main#main #workCompletionBody .is-editable .work-completion-edit-value:focus {
    border-color:#315db1 !important; outline:2px solid #dce7fa !important; outline-offset:1px;
  }
  body #app main#main #workCompletionBody .is-editable .work-completion-title,
  body #app main#main #workCompletionBody .is-editable .work-completion-section-title {
    background:#315db1 !important; color:#fff !important; border-color:#315db1 !important;
    box-shadow:none !important; padding:6px 8px !important;
  }
  body #app main#main #workCompletionBody .work-completion-toolbar .btn.primary {
    background:#315db1 !important; color:#fff !important; border-color:#315db1 !important;
  }
  /* Shared template registration rows: report, Eval, patrol and cloned modules. */
  body #app main#main .patrol-template-panel .patrol-template-form:not(.inspection113-video-upload) {
    display:grid !important; grid-template-columns:minmax(0,1.1fr) 176px minmax(0,1.4fr) max-content;
    align-items:end !important; gap:10px !important; min-width:0; margin-bottom:16px;
  }
  body #app main#main .patrol-template-panel .patrol-template-form:not(.inspection113-video-upload)>label {
    display:grid !important; grid-template-rows:auto var(--kmi-field-height,38px); align-content:end;
    gap:6px !important; min-width:0 !important; margin:0 !important; font-size:12px; line-height:1.4;
  }
  body #app main#main .patrol-template-panel .patrol-template-form:not(.inspection113-video-upload) input,
  body #app main#main .patrol-template-panel .patrol-template-form:not(.inspection113-video-upload)>.btn {
    box-sizing:border-box !important; height:var(--kmi-field-height,38px) !important;
    min-height:var(--kmi-field-height,38px) !important; max-height:var(--kmi-field-height,38px) !important;
    margin:0 !important; min-width:0 !important; font-size:13px !important; line-height:normal !important;
    border:1px solid #b9c6d8 !important; border-radius:5px !important; padding:0 10px !important;
  }
  body #app main#main .patrol-template-panel .patrol-template-form:not(.inspection113-video-upload) input {
    width:100% !important; max-width:100% !important;
  }
  body #app main#main .patrol-template-panel .patrol-template-form:not(.inspection113-video-upload) input[type=file] {
    padding:5px 8px !important; overflow:hidden; background:#fff; cursor:pointer;
  }
  body #app main#main .patrol-template-panel .patrol-template-form:not(.inspection113-video-upload) input[type=file]::file-selector-button {
    height:calc(var(--kmi-field-height,38px) - 12px); box-sizing:border-box; margin:0 8px 0 0;
    padding:0 8px; border:1px solid #b9c6d8; border-radius:4px; background:#fff; color:#213754; font:inherit;
  }
  body #app main#main .patrol-template-panel .patrol-template-form:not(.inspection113-video-upload)>.btn {
    align-self:end; white-space:nowrap; background:#315db1 !important; color:#fff !important;
    border-color:#315db1 !important; box-shadow:none !important;
  }
  body #app main#main .ap-list-head468 {
    display:flex !important; flex-wrap:wrap; align-items:center !important; justify-content:space-between;
    gap:12px 20px; min-width:0;
  }
  body #app main#main .ap-list-head468>div:first-child { flex:1 1 220px; min-width:0; }
  body #app main#main .ap-list-toolbar468 {
    display:flex !important; flex-wrap:wrap; align-items:center !important; justify-content:flex-end;
    flex:0 1 420px; width:420px; max-width:100%; gap:8px !important; margin:0 !important; padding:0 !important;
  }
  body #app main#main .ap-list-toolbar468 #apSearch,
  body #app main#main .ap-list-toolbar468 #apNewDoc {
    box-sizing:border-box !important; height:var(--kmi-field-height,38px) !important;
    min-height:var(--kmi-field-height,38px) !important; max-height:var(--kmi-field-height,38px) !important;
    margin:0 !important;
  }
  body #app main#main .ap-list-toolbar468 #apSearch { flex:1 1 180px; min-width:0 !important; width:auto !important; max-width:100% !important; }
  body #app main#main .ap-list-toolbar468 #apNewDoc { flex:0 0 auto; white-space:nowrap; }
}
@media screen and (max-width:1000px) {
  body #app main#main .patrol-template-panel .patrol-template-form:not(.inspection113-video-upload) {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  body #app main#main .patrol-template-panel .patrol-template-form:not(.inspection113-video-upload)>.btn { justify-self:end; }
}
@media screen and (max-width:620px) {
  body #app main#main .patrol-template-panel .patrol-template-form:not(.inspection113-video-upload) { grid-template-columns:minmax(0,1fr); }
  body #app main#main .ap-list-toolbar468 { flex-basis:100%; width:100%; }
}
@media screen {
  body #app main#main #purchaseBody .purchase-toolbar {
    display:flex !important; flex-wrap:wrap !important; align-items:center !important;
    gap:8px !important; min-width:0; width:100%;
  }
  body #app main#main #purchaseBody .purchase-toolbar #purchaseQ {
    flex:1 1 240px !important; width:280px !important; min-width:180px !important; max-width:320px !important;
  }
  body #app main#main #purchaseBody .purchase-toolbar #purchaseLimit {
    flex:0 0 112px !important; width:112px !important; min-width:112px !important;
  }
  body #app main#main #purchaseBody .purchase-toolbar .kmi-list-sort-select {
    flex:0 0 176px !important; width:176px !important; min-width:176px !important;
  }
  body #app main#main #purchaseBody .purchase-actions468 {
    display:flex !important; flex:1 1 520px; flex-wrap:wrap !important; align-items:center !important;
    justify-content:flex-end !important; gap:8px !important; min-width:0; margin:0 0 0 auto !important;
  }
  body #app main#main #purchaseBody .purchase-toolbar input,
  body #app main#main #purchaseBody .purchase-toolbar select,
  body #app main#main #purchaseBody .purchase-toolbar button {
    box-sizing:border-box !important; height:var(--kmi-field-height,38px) !important;
    min-height:var(--kmi-field-height,38px) !important; max-height:var(--kmi-field-height,38px) !important;
    margin-top:0 !important; margin-bottom:0 !important;
  }
  body #app main#main #expenseStandardBody .expense-standard-scroll468 {
    display:block; width:100% !important; max-width:100% !important; min-width:0 !important;
    overflow-x:auto !important; overflow-y:auto !important; box-sizing:border-box;
  }
  body #app main#main #expenseStandardBody .expense-standard-list-table {
    width:100% !important; min-width:1460px !important; max-width:none !important;
  }
  body #app main#main #expenseStandardBody .expense-standard-list-table th.expense-standard-manage-col {
    width:180px !important; min-width:180px !important;
  }
  body #app main#main #expenseStandardBody .expense-standard-list-table td:last-child {
    height:auto !important; max-height:none !important; overflow:visible !important; padding:6px !important;
  }
  body #app main#main #expenseStandardBody .expense-standard-list-table td:last-child .row-actions {
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px !important; width:100%; min-width:0 !important; white-space:normal !important;
  }
  body #app main#main #expenseStandardBody .expense-standard-list-table td:last-child .row-actions>button {
    box-sizing:border-box !important; width:100% !important; min-width:0 !important; max-width:100% !important;
    margin:0 !important; padding:0 6px !important; font-size:12px !important;
    height:var(--kmi-field-height,38px) !important; min-height:var(--kmi-field-height,38px) !important;
  }
  body #app main#main #expenseStandardBody .expense-standard-guide-toolbar {
    display:flex !important; align-items:center !important; flex-wrap:wrap !important;
    gap:10px !important; margin:14px 0 !important; min-width:0 !important;
  }
  body #app main#main #expenseStandardBody #expenseStandardGuideQ {
    box-sizing:border-box !important; flex:1 1 280px; width:100% !important;
    min-width:0 !important; max-width:560px !important;
    height:var(--kmi-field-height,38px) !important; min-height:var(--kmi-field-height,38px) !important;
    margin:0 !important;
  }
  body #app main#main #expenseStandardBody .expense-standard-guide-toolbar>b {
    display:inline-flex !important; align-items:center !important; justify-content:center !important;
    box-sizing:border-box !important; height:var(--kmi-field-height,38px) !important;
    min-height:var(--kmi-field-height,38px) !important; min-width:126px; padding:0 12px !important;
    margin:0 0 0 auto !important; border-radius:5px !important; font-size:12px !important;
  }
}
@media screen and (max-width:620px) {
  body #app main#main #purchaseBody .purchase-toolbar #purchaseQ { flex-basis:100% !important; width:100% !important; max-width:none !important; }
  body #app main#main #purchaseBody .purchase-actions468 { flex-basis:100%; }
  body #app main#main #expenseStandardBody .expense-standard-guide-toolbar>b { margin-left:0 !important; }
}
@media screen {
  body #app main#main #documentBody .document-toolbar468 {
    display:flex !important; flex-wrap:wrap !important; align-items:center !important; gap:8px !important; min-width:0;
  }
  body #app main#main #documentBody .document-toolbar468 #documentQ {
    flex:1 1 240px !important; width:280px !important; min-width:180px !important; max-width:320px !important;
  }
  body #app main#main #documentBody .document-toolbar468 #documentStatus {
    flex:0 0 112px !important; width:112px !important; min-width:112px !important;
  }
  body #app main#main #documentBody .document-toolbar468 .kmi-list-sort-select {
    flex:0 0 176px !important; width:176px !important; min-width:176px !important;
  }
  body #app main#main #documentBody .document-actions468 {
    display:flex !important; flex:1 1 400px; flex-wrap:wrap !important; align-items:center !important;
    justify-content:flex-end !important; gap:8px !important; min-width:0; margin:0 0 0 auto !important;
  }
  body #app main#main #documentBody .document-toolbar468 input,
  body #app main#main #documentBody .document-toolbar468 select,
  body #app main#main #documentBody .document-toolbar468 button {
    box-sizing:border-box !important; height:var(--kmi-field-height,38px) !important;
    min-height:var(--kmi-field-height,38px) !important; max-height:var(--kmi-field-height,38px) !important;
    margin-top:0 !important; margin-bottom:0 !important;
  }
}
@media screen and (max-width:620px) {
  body #app main#main #documentBody .document-toolbar468 #documentQ { flex-basis:100% !important; width:100% !important; max-width:none !important; }
  body #app main#main #documentBody .document-actions468 { flex-basis:100%; }
}
