.bq-app {
    width: 100%;
    max-width: none;
    min-width: 0;
    color: #263238;
    letter-spacing: 0;
}

.zz-ui-v2 .bq-app,
.zz-ui-v2 .bq-app > section,
.zz-ui-v2 .bq-app > .bq-scan-warnings {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.zz-ui-v2 .bq-app .bq-section-heading > div,
.zz-ui-v2 .bq-app .bq-source-grid > *,
.zz-ui-v2 .bq-app .bq-upload-row > *,
.zz-ui-v2 .bq-app .bq-progress-header > * {
    min-width: 0;
}

.bq-app h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
}

.bq-app .btn {
    width: auto;
    min-width: 0;
    white-space: nowrap;
}

.bq-message {
    display: none;
    margin: 0 0 12px;
    border-radius: 4px;
}

.bq-message.is-visible {
    display: block;
}

.bq-source-band,
.bq-review-band {
    padding: 14px 0;
    border-top: 1px solid #dde3e8;
    border-bottom: 1px solid #dde3e8;
}

.bq-source-band {
    border-top: 0;
    padding-top: 4px;
}

.bq-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.bq-section-heading > div:first-child {
    min-width: 0;
}

.bq-muted {
    display: inline-block;
    margin-top: 2px;
    color: #52647b;
    font-size: 13px;
}

.bq-source-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1.8fr) minmax(230px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.bq-field {
    min-width: 0;
}

.bq-app [hidden] { display: none !important; }
@media (min-width: 1001px) {
    .bq-source-grid.bq-source-local { grid-template-columns: minmax(0, 1fr) auto; }
}

.bq-field label {
    display: block;
    margin-bottom: 4px;
    color: #34444e;
    font-size: 13px;
    font-weight: 700;
}

.bq-field .form-control {
    min-width: 0;
    min-height: 34px;
}

.bq-subject-confirmation {
    margin: 9px 0;
}

.bq-source-actions {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.bq-upload-row {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 11px;
    margin-top: 11px;
    border-top: 1px solid #e0e6ea;
}

.bq-upload-row.is-visible {
    display: flex;
}

.bq-upload-status {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.bq-upload-status strong {
    color: #34444e;
    font-size: 13px;
}

.bq-upload-status .bq-muted {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.bq-upload-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex: 0 0 auto;
    flex-wrap: wrap;
}

.bq-native-file {
    position: fixed !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.bq-progress-panel {
    display: none;
    padding: 12px 14px;
    margin: 12px 0;
    border: 1px solid #9ec5e5;
    border-radius: 4px;
    background: #f5faff;
}

.bq-progress-panel.is-visible {
    display: block;
}

.bq-progress-panel.is-error {
    border-color: #ef9a9a;
    background: #fff7f7;
}

.bq-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.bq-progress-header > div:first-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.bq-progress-header strong {
    color: #1d4f73;
    font-size: 14px;
}

.bq-progress-header span {
    overflow-wrap: anywhere;
}

.bq-progress-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}

.bq-progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 4px;
    background: #dce8f0;
}

.bq-progress-value {
    width: 0;
    height: 100%;
    background: #147d92;
    transition: width .25s ease;
}

.bq-progress-panel.is-error .bq-progress-value {
    background: #c62828;
}

.bq-summary-band {
    display: none;
    grid-template-columns: repeat(6, minmax(100px, 1fr));
    margin: 12px 0;
    border-top: 1px solid #dde3e8;
    border-bottom: 1px solid #dde3e8;
}

.bq-summary-band.is-visible {
    display: grid;
}

.bq-scan-warnings {
    display: none;
    margin: -3px 0 12px;
    padding: 10px 12px;
    border: 1px solid #e0b34f;
    border-radius: 4px;
    background: #fffaf0;
    color: #59420e;
    font-size: 13px;
}

.bq-scan-warnings.is-visible {
    display: block;
}

.bq-scan-warnings.is-blocking {
    border-color: #d98282;
    background: #fff5f5;
    color: #722323;
}

.bq-scan-warnings ul {
    margin: 6px 0 0 18px;
    padding: 0;
}

.bq-scan-warnings li + li {
    margin-top: 3px;
}

.bq-stat {
    min-width: 0;
    padding: 10px 12px;
    border-right: 1px solid #dde3e8;
}

.bq-stat:last-child {
    border-right: 0;
}

.bq-stat span,
.bq-stat strong {
    display: block;
}

.bq-stat span {
    color: #66757f;
    font-size: 12px;
}

.bq-stat strong {
    margin-top: 2px;
    color: #24343e;
    font-size: 19px;
    line-height: 1.2;
}

.bq-review-band {
    display: none;
}

.bq-review-band.is-visible {
    display: block;
}

.bq-review-heading {
    margin-bottom: 8px;
}

.bq-heading-actions,
.bq-batch-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bq-filter-row {
    display: grid;
    grid-template-columns: minmax(280px, 1.5fr) minmax(190px, .65fr) 100px;
    gap: 10px;
    align-items: end;
    margin-bottom: 10px;
}

.bq-table-wrap {
    border-top: 1px solid #d5dce1;
    border-bottom: 1px solid #d5dce1;
}

.bq-package-table {
    min-width: 980px;
    margin: 0;
    table-layout: fixed;
}

.bq-package-table th {
    border-top: 0;
    background: #eef2f4;
    color: #2e3e47;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    vertical-align: middle;
}

.bq-package-table td {
    padding: 8px 7px;
    border-color: #e1e6e9;
    vertical-align: middle;
}

.bq-package-table th:nth-child(1),
.bq-package-table td:nth-child(1) {
    width: 42px;
}

.bq-package-table th:nth-child(2),
.bq-package-table td:nth-child(2) {
    width: 24%;
}

.bq-package-table th:nth-child(3),
.bq-package-table td:nth-child(3) {
    width: 130px;
}

.bq-package-table th:nth-child(4),
.bq-package-table td:nth-child(4) {
    width: 28%;
}

.bq-package-table th:nth-child(5),
.bq-package-table td:nth-child(5) {
    width: 25%;
}

.bq-package-table th:nth-child(6),
.bq-package-table td:nth-child(6) {
    width: 46px;
}

.bq-package-main-row.is-open td {
    background: #f8fafb;
}

.bq-check-cell,
.bq-command-cell {
    text-align: center;
}

.bq-package-title {
    display: block;
    overflow-wrap: anywhere;
    font-size: 14px;
    font-weight: 700;
}

.bq-package-path,
.bq-file-line,
.bq-subject-line {
    display: block;
    margin-top: 2px;
    color: #60717b;
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.bq-file-line strong {
    display: inline-block;
    min-width: 42px;
    color: #44545d;
}

.bq-status {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
    white-space: normal;
}

.bq-status-ready {
    background: #dff5e8;
    color: #146c43;
}

.bq-status-review {
    background: #fff2c7;
    color: #7a5700;
}

.bq-status-validated {
    background: #d8f2f5;
    color: #0b6570;
}

.bq-status-blocked,
.bq-status-failed {
    background: #fde1e1;
    color: #a02222;
}

.bq-status-running {
    background: #e1ebf8;
    color: #24558a;
}

.bq-status-imported {
    background: #e5e9ec;
    color: #33444d;
}

.bq-confidence {
    display: block;
    margin-top: 5px;
    color: #66757f;
    font-size: 11px;
}

.bq-detail-row {
    display: none;
}

.bq-detail-row.is-open {
    display: table-row;
}

.bq-detail-row > td {
    padding: 0 !important;
    background: #fbfcfd;
}

.bq-detail-layout {
    display: grid;
    grid-template-columns: minmax(300px, 1.05fr) minmax(280px, .9fr) minmax(280px, 1fr);
    gap: 0;
    border-left: 3px solid #147d92;
}

.bq-detail-section {
    min-width: 0;
    padding: 13px 14px;
    border-right: 1px solid #dce3e7;
}

.bq-detail-section:last-child {
    border-right: 0;
}

.bq-detail-section h3 {
    margin: 0 0 10px;
    color: #34444e;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
}

.bq-detail-section .bq-field {
    margin-bottom: 9px;
}

.bq-detail-section .bq-field:last-child {
    margin-bottom: 0;
}

.bq-inline-control {
    display: flex;
    align-items: center;
    gap: 7px;
}

.bq-inline-control .form-control {
    min-width: 0;
    flex: 1 1 auto;
}

.bq-selected-subject {
    padding: 7px 9px;
    margin-bottom: 8px;
    border-left: 3px solid #147d92;
    background: #eef7f8;
    color: #264a50;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.bq-detail-list {
    padding-left: 18px;
    margin: 0 0 9px;
    color: #53646d;
    font-size: 12px;
}

.bq-detail-list li {
    margin-bottom: 3px;
    overflow-wrap: anywhere;
}

.bq-detail-list.bq-errors {
    color: #a02222;
}

.bq-detail-list.bq-warnings {
    color: #7a5700;
}

.bq-validation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(100px, 1fr));
    gap: 6px;
    margin-bottom: 9px;
}

.bq-validation-item {
    padding: 6px 7px;
    border: 1px solid #dce3e7;
    background: #fff;
}

.bq-validation-item span,
.bq-validation-item strong {
    display: block;
}

.bq-validation-item span {
    color: #677780;
    font-size: 11px;
}

.bq-validation-item strong {
    color: #263a44;
    font-size: 14px;
}

.bq-empty-state {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 100px;
    color: #72818a;
}

.bq-empty-state.is-visible {
    display: flex;
}

.bq-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 0 4px;
}

.bq-batch-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #dde3e8;
}

.bq-selection-count {
    color: #53646d;
    font-size: 13px;
    font-weight: 700;
}

.bq-folder-location {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e6e9;
}

.bq-file-browser-dialog {
    width: calc(100vw - 32px);
    max-width: 1400px;
    margin: 16px auto;
}

.bq-file-browser-body {
    height: calc(100vh - 112px);
    min-height: 480px;
    padding: 0;
    overflow: hidden;
}

.bq-file-browser-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.bq-folder-location code {
    min-width: 0;
    color: #33444d;
    overflow-wrap: anywhere;
}

.bq-folder-list,
.bq-subject-results {
    max-height: 55vh;
    overflow-y: auto;
    margin-top: 10px;
}

.bq-folder-item,
.bq-subject-item {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    border: 0;
    border-bottom: 1px solid #e5e9ec;
    background: #fff;
    color: #2e3e47;
    text-align: left;
}

.bq-folder-item:hover,
.bq-folder-item:focus,
.bq-subject-item:hover,
.bq-subject-item:focus {
    background: #f0f6f7;
    color: #0d6672;
    outline: 0;
}

.bq-folder-item span,
.bq-subject-item span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.bq-subject-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
}

.bq-subject-item strong {
    font-size: 13px;
}

.bq-subject-item small {
    color: #62737c;
}

.bq-confirmation-phrase {
    display: block;
    padding: 8px 9px;
    margin: 5px 0 9px;
    border: 1px solid #d6dde1;
    background: #f5f7f8;
    color: #263a44;
    font-weight: 700;
    overflow-wrap: anywhere;
}

#bqFormatGuideModal .modal-dialog,
#bqFolderModal .modal-dialog,
#bqSubjectModal .modal-dialog,
#bqConfirmModal .modal-dialog {
    margin-top: 58px;
    margin-bottom: 16px;
}

.bq-file-browser-dialog .modal-content {
    height: calc(100vh - 74px);
    overflow: hidden;
}

.bq-file-browser-body {
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
}

.bq-guide-dialog {
    width: calc(100vw - 32px);
    max-width: 1320px;
    margin: 16px auto;
}

.bq-guide-dialog .modal-content {
    max-height: calc(100vh - 74px);
    overflow: hidden;
}

.bq-guide-subtitle {
    margin-top: 2px;
    color: #65757e;
    font-size: 13px;
}

.bq-guide-dialog .bq-guide-body {
    max-height: none;
    min-height: 0;
    flex: 1 1 auto;
    padding: 0;
    overflow-y: auto;
}

.bq-guide-notice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 18px;
    border-bottom: 1px solid #c7dce6;
    background: #eef8fc;
    color: #244c5d;
}

.bq-guide-notice i {
    margin-top: 3px;
    color: #1482a6;
}

.bq-guide-section {
    padding: 16px 18px;
    border-bottom: 1px solid #dfe5e8;
}

.bq-guide-section:last-child {
    border-bottom: 0;
}

.bq-guide-section h6 {
    margin: 0 0 10px;
    color: #243b46;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
}

.bq-guide-lead,
.bq-guide-check-section p {
    margin: 0 0 10px;
    color: #52636c;
    font-size: 13px;
}

.bq-guide-grid {
    display: grid;
    gap: 18px;
}

.bq-guide-grid-folder {
    grid-template-columns: minmax(360px, .9fr) minmax(380px, 1.1fr);
    align-items: start;
}

.bq-folder-example {
    min-height: 190px;
    padding: 13px 15px;
    margin: 0;
    border: 1px solid #cad4da;
    border-radius: 4px;
    background: #f5f7f8;
    color: #253b45;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.bq-guide-copy {
    min-width: 0;
}

.bq-guide-list {
    padding-left: 20px;
    margin: 0;
    color: #3e5059;
    font-size: 13px;
}

.bq-guide-list li {
    margin-bottom: 7px;
}

.bq-guide-list li:last-child {
    margin-bottom: 0;
}

.bq-format-line,
.bq-guide-warning {
    padding: 9px 11px;
    margin-top: 10px;
    border-left: 3px solid #7c98a5;
    background: #f5f7f8;
    color: #3d5059;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.bq-guide-warning {
    border-left-color: #dd9b20;
    background: #fff8e8;
    color: #654b19;
}

.bq-guide-table-wrap {
    margin-bottom: 10px;
    border: 1px solid #d6dde1;
}

.bq-guide-table {
    min-width: 720px;
    margin: 0;
    font-size: 12px;
}

.bq-guide-table th {
    border-top: 0;
    background: #edf2f4;
    color: #2e434d;
    vertical-align: middle;
}

.bq-guide-table th span {
    color: #687a83;
    font-size: 11px;
    font-weight: 400;
}

.bq-guide-table td {
    color: #334750;
    vertical-align: top;
}

.bq-guide-table code,
.bq-guide-document-head code,
.bq-guide-section code {
    color: #174f77;
}

.bq-guide-total td {
    background: #f5f7f8;
    font-weight: 700;
}

.bq-guide-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.bq-guide-list-inline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 24px;
}

.bq-guide-document-head {
    display: flex;
    gap: 6px 14px;
    flex-wrap: wrap;
    padding: 8px 10px;
    margin-bottom: 10px;
    border: 1px solid #d5dde1;
    background: #f8fafb;
}

.bq-guide-document-head code {
    white-space: nowrap;
}

.bq-guide-table-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: -3px 0 10px;
    color: #5b6f79;
    font-size: 12px;
}

.bq-guide-table-note i {
    margin-top: 2px;
    color: #527b90;
}

.bq-guide-check-section {
    background: #f7faf8;
}

.bq-guide-checks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 14px;
    margin-bottom: 10px;
}

.bq-guide-checks span {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: #315744;
    font-size: 13px;
}

.bq-guide-checks i {
    color: #198754;
}

.bq-app input[type="checkbox"] {
    width: 17px;
    height: 17px;
}

@media (max-width: 1200px) {
    .bq-source-grid {
        grid-template-columns: minmax(280px, 1.5fr) minmax(220px, 1fr);
    }

    .bq-source-actions {
        grid-column: 1 / -1;
    }

    .bq-detail-layout {
        grid-template-columns: 1fr 1fr;
    }

    .bq-detail-section:last-child {
        grid-column: 1 / -1;
        border-top: 1px solid #dce3e7;
    }

    .bq-summary-band {
        grid-template-columns: repeat(3, minmax(100px, 1fr));
    }

    .bq-stat:nth-child(3) {
        border-right: 0;
    }

    .bq-stat:nth-child(-n+3) {
        border-bottom: 1px solid #dde3e8;
    }
}

@media (max-width: 768px) {
    .bq-source-grid,
    .bq-filter-row,
    .bq-detail-layout {
        display: block;
    }

    .bq-source-grid > *,
    .bq-filter-row > * {
        margin-bottom: 9px;
    }

    .bq-source-actions {
        align-items: stretch;
    }

    .bq-source-actions .btn {
        width: auto;
        min-width: 0;
        flex: 1 1 0;
    }

    .bq-upload-row {
        align-items: stretch;
        flex-direction: column;
    }

    .bq-upload-actions {
        justify-content: flex-start;
    }

    .bq-file-browser-dialog {
        width: calc(100vw - 12px);
        margin: 6px auto;
    }

    .bq-guide-dialog {
        width: calc(100vw - 12px);
        margin: 6px auto;
    }

    .bq-guide-body {
        max-height: calc(100vh - 126px);
    }

    .bq-guide-grid-folder,
    .bq-guide-columns,
    .bq-guide-list-inline,
    .bq-guide-checks {
        grid-template-columns: 1fr;
    }

    .bq-guide-section {
        padding: 14px 12px;
    }

    .bq-guide-notice {
        padding: 11px 12px;
    }

    .bq-file-browser-body {
        height: calc(100vh - 92px);
        min-height: 360px;
    }

    .bq-section-heading,
    .bq-batch-actions,
    .bq-progress-header {
        align-items: stretch;
        flex-direction: column;
    }

    .bq-progress-actions {
        justify-content: space-between;
    }

    .bq-summary-band {
        grid-template-columns: repeat(2, minmax(100px, 1fr));
    }

    .bq-stat {
        border-bottom: 1px solid #dde3e8;
    }

    .bq-stat:nth-child(2n) {
        border-right: 0;
    }

    .bq-stat:nth-last-child(-n+2) {
        border-bottom: 0;
    }

    .bq-detail-section {
        border-right: 0;
        border-bottom: 1px solid #dce3e7;
    }

    .bq-detail-section:last-child {
        border-bottom: 0;
    }

    .bq-batch-buttons {
        justify-content: flex-start;
    }
}
