.bac-dashboard-wrap {
    max-width: 1000px;
    margin: 30px auto;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.bac-plan-box {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.bac-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.bac-tab-btn {
    padding: 10px 16px;
    border: none;
    background: #111827;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
}

.bac-tab-btn:hover {
    background: #000000;
    color: #ffffff;
}

.bac-tab-btn.active {
    background: #0891b2;
    color: #ffffff;
}

.bac-tab-content {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}
.bac-upload-form {
    background: #fff;
    border: 1px solid #dcdcdc;
    padding: 16px;
    border-radius: 10px;
    margin-top: 15px;
}

.bac-btn {
    background: #2563eb;
    color: #fff;
    border: 0;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.bac-btn:hover {
    opacity: 0.92;
}

.bac-help-text {
    color: #666;
    font-size: 13px;
}

.bac-message {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 600;
}

.bac-message-success {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.bac-message-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.bac-help-text {
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
}
.bac-history-box {
    background: #fff;
    border: 1px solid #dcdcdc;
    padding: 16px;
    border-radius: 10px;
    margin-top: 20px;
}

.bac-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.bac-history-table th,
.bac-history-table td {
    border: 1px solid #e5e7eb;
    padding: 10px;
    text-align: left;
    font-size: 14px;
}

.bac-history-table th {
    background: #f8fafc;
}
.bac-report-toggle {
    background: #2563eb;
    color: #fff;
    border: 0;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.bac-report-box {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 14px;
    margin: 8px 0;
}

.bac-match-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 0;
}

.bac-match-item:last-child {
    border-bottom: none;
}

.bac-match-meta {
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
}

.bac-match-text {
    background: #fff7cc;
    border-right: 4px solid #f59e0b;
    padding: 10px;
    border-radius: 6px;
    line-height: 1.8;
}
.bac-highlight {
    background: #ffeb3b;
    color: #000;
    padding: 2px 4px;
    border-radius: 4px;
}

.bac-full-text {
    margin-bottom: 20px;
}

.bac-text-content {
    background: #ffffff;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    line-height: 1.9;
    max-height: 400px;
    overflow-y: auto;
}
.bac-highlight-full {
    background: #fff3a3;
    color: #000;
    display: block;
    padding: 12px;
    border-radius: 6px;
    line-height: 2;
}

.bac-highlight {
    background: #ffeb3b;
    color: #000;
    padding: 2px 4px;
    border-radius: 4px;
}

.bac-report-page {
    max-width: 1100px;
    margin: 20px auto;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 22px;
}
.bac-report-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.bac-report-page-actions {
    display: flex;
    gap: 10px;
}
.bac-print-btn,
.bac-pdf-btn,
.bac-word-btn,
.bac-close-btn,
.bac-report-popup-link {
    background: #2563eb;
    color: #fff !important;
    border: 0;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.bac-pdf-btn{background:#0ea5e9;}
.bac-word-btn{background:#7c3aed;}
.bac-close-btn { background: #475569; }
.bac-report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.bac-report-summary-box {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
}
.bac-report-source-list {
    display: grid;
    gap: 10px;
}
.bac-report-source-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
}
.bac-report-source-title { font-weight: 700; margin-bottom: 6px; }
.bac-report-source-meta { font-size: 13px; color: #334155; }
.bac-report-document-page {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 16px;
    line-height: 2;
}
.bac-report-document-page p { margin: 0 0 16px; }
.bac-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 14px;
}
.bac-page-link {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    text-decoration: none;
    color: #1e293b;
    background: #fff;
}
.bac-page-link.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.bac-highlight-full {
    background: #fff3a3;
    color: #111827;
    padding: 0 2px;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
.bac-highlight-related {
    background: #dbeafe;
    color: #111827;
    padding: 0 2px;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
@media print {
    .bac-report-page-actions, .bac-pagination { display:none !important; }
    .bac-report-page { border:0; margin:0; max-width:none; }
}


.bac-history-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;}
.bac-refresh-btn{background:#0f172a;color:#fff !important;border-radius:10px;padding:10px 16px;font-weight:700;text-decoration:none;display:inline-block;}
.bac-status-processing{color:#7f1d1d;font-weight:700;display:block;}
.bac-status-note{color:#991b1b;font-size:12px;margin-top:4px;}
.bac-status-processed{color:#166534;font-weight:700;}
.bac-sim-placeholder{color:#94a3b8;font-weight:700;}
.bac-preformatted{white-space:pre-wrap; word-break:break-word; font-family:inherit; line-height:1.9;}
.bac-print-only{display:none;}
.bac-screen-only{display:block;}
.bac-report-document-page{overflow-wrap:anywhere;}
.bac-report-document-page table{width:100% !important;border-collapse:collapse !important;table-layout:auto !important;display:table !important;}
.bac-report-document-page td,.bac-report-document-page th{border:1px solid #cbd5e1;padding:6px 8px;vertical-align:top;}
.bac-document-box .bac-report-document-page{white-space:pre-wrap;font-variant-ligatures:none;}
@media print {
  html,body{background:#fff !important;}
  body *{visibility:hidden !important;}
  .bac-report-page, .bac-report-page *{visibility:visible !important;}
  .bac-report-page{position:absolute;left:0;top:0;width:100% !important;max-width:none !important;margin:0 !important;padding:0 !important;border:0 !important;background:#fff !important;}
  .bac-report-page-actions, .bac-pagination, .bac-screen-only{display:none !important;}
  .bac-print-only{display:block !important;}
  .bac-report-summary-box:not(.bac-document-box),.bac-report-source-item{break-inside:avoid;page-break-inside:avoid;}
  .bac-document-box{break-inside:auto !important;page-break-inside:auto !important;}
  .bac-document-box h3{break-after:avoid-page;page-break-after:avoid;}
  .bac-report-document-page{break-inside:auto !important;page-break-inside:auto !important;}
  .bac-print-page{page-break-after:always;break-after:page;min-height:auto !important;}
  .bac-print-page:last-child{page-break-after:auto;break-after:auto;}
  .bac-report-document-page{width:100% !important;max-width:none !important;border:0 !important;padding:0 !important;margin:0 !important;}
  .bac-report-page-head,.bac-report-summary-grid,.bac-report-summary-box{width:100% !important;max-width:none !important;}
}

.bac-report-document-page table.bac-docx-table{width:100% !important;border-collapse:collapse !important;table-layout:fixed !important;margin:12px 0;white-space:normal !important;}
.bac-report-document-page table.bac-docx-table td,.bac-report-document-page table.bac-docx-table th{border:1px solid #94a3b8 !important;padding:8px !important;vertical-align:top !important;white-space:pre-wrap !important;overflow-wrap:anywhere !important;}
.bac-report-document-page p{margin:0 0 14px !important;}
.bac-highlight-full,.bac-highlight-related{font-weight:700 !important;border-bottom:3px solid #eab308;}
.bac-highlight-related{border-bottom-color:#60a5fa;}
@media print {
  .bac-highlight-full,.bac-highlight-related{-webkit-print-color-adjust:exact !important;print-color-adjust:exact !important;color:#000 !important;background:#fff3a3 !important;border-bottom:3px solid #eab308 !important;}
  .bac-highlight-related{background:#dbeafe !important;border-bottom-color:#60a5fa !important;}
  .bac-report-document-page table.bac-docx-table{width:100% !important;border-collapse:collapse !important;table-layout:fixed !important;}
  .bac-report-document-page table.bac-docx-table td,.bac-report-document-page table.bac-docx-table th{border:1px solid #000 !important;padding:6px !important;white-space:pre-wrap !important;overflow-wrap:anywhere !important;}
}

.bac-highlight-source-0{background:#fff3a3 !important;border-bottom-color:#eab308 !important;}
.bac-highlight-source-1{background:#c7f9cc !important;border-bottom-color:#22c55e !important;}
.bac-highlight-source-2{background:#bfdbfe !important;border-bottom-color:#3b82f6 !important;}
.bac-highlight-source-3{background:#fecdd3 !important;border-bottom-color:#f43f5e !important;}
.bac-highlight-source-4{background:#e9d5ff !important;border-bottom-color:#8b5cf6 !important;}
.bac-highlight-source-5{background:#fde68a !important;border-bottom-color:#f59e0b !important;}
@media print {
  .bac-highlight-source-0{background:#fff3a3 !important;border-bottom-color:#eab308 !important;}
  .bac-highlight-source-1{background:#c7f9cc !important;border-bottom-color:#22c55e !important;}
  .bac-highlight-source-2{background:#bfdbfe !important;border-bottom-color:#3b82f6 !important;}
  .bac-highlight-source-3{background:#fecdd3 !important;border-bottom-color:#f43f5e !important;}
  .bac-highlight-source-4{background:#e9d5ff !important;border-bottom-color:#8b5cf6 !important;}
  .bac-highlight-source-5{background:#fde68a !important;border-bottom-color:#f59e0b !important;}
}

.bac-open-source-link{text-decoration:underline;font-weight:600;}
.bac-dir-rtl{direction:rtl;text-align:right;}
.bac-dir-ltr{direction:ltr;text-align:left;}
.bac-dir-rtl .bac-report-summary-grid,.bac-dir-rtl .bac-report-page-head{direction:rtl;}
.bac-dir-ltr .bac-report-summary-grid,.bac-dir-ltr .bac-report-page-head{direction:ltr;}
.bac-dir-rtl .bac-report-document-page,.bac-dir-rtl .bac-match-item,.bac-dir-rtl .bac-report-source-item{direction:rtl;text-align:right;}
.bac-dir-ltr .bac-report-document-page,.bac-dir-ltr .bac-match-item,.bac-dir-ltr .bac-report-source-item{direction:ltr;text-align:left;}
.bac-dir-rtl .bac-report-document-page table,.bac-dir-rtl .bac-docx-table{direction:rtl;}
.bac-dir-ltr .bac-report-document-page table,.bac-dir-ltr .bac-docx-table{direction:ltr;}
@media print{.bac-dir-rtl,.bac-dir-rtl *{direction:rtl !important;text-align:right !important;} .bac-dir-ltr,.bac-dir-ltr *{direction:ltr !important;text-align:left !important;} .bac-dir-rtl table td,.bac-dir-rtl table th{text-align:right !important;} .bac-dir-ltr table td,.bac-dir-ltr table th{text-align:left !important;}}

.bac-report-page{unicode-bidi:plaintext;}
.bac-dir-rtl{direction:rtl !important;text-align:right !important;unicode-bidi:embed;}
.bac-dir-ltr{direction:ltr !important;text-align:left !important;unicode-bidi:embed;}
.bac-dir-rtl .bac-report-summary-box,.bac-dir-rtl .bac-document-box,.bac-dir-rtl .bac-match-text,.bac-dir-rtl .bac-match-meta,.bac-dir-rtl .bac-report-source-meta,.bac-dir-rtl .bac-report-source-title,.bac-dir-rtl p,.bac-dir-rtl h2,.bac-dir-rtl h3,.bac-dir-rtl h4,.bac-dir-rtl td,.bac-dir-rtl th{direction:rtl !important;text-align:right !important;unicode-bidi:embed;}
.bac-dir-ltr .bac-report-summary-box,.bac-dir-ltr .bac-document-box,.bac-dir-ltr .bac-match-text,.bac-dir-ltr .bac-match-meta,.bac-dir-ltr .bac-report-source-meta,.bac-dir-ltr .bac-report-source-title,.bac-dir-ltr p,.bac-dir-ltr h2,.bac-dir-ltr h3,.bac-dir-ltr h4,.bac-dir-ltr td,.bac-dir-ltr th{direction:ltr !important;text-align:left !important;unicode-bidi:embed;}
.bac-highlight-full,.bac-highlight-related{display:inline !important;box-decoration-break:clone !important;-webkit-box-decoration-break:clone !important;padding:0 .08em !important;line-height:inherit !important;}
.bac-open-source-link{display:inline-block !important;position:relative;z-index:5;pointer-events:auto !important;}
.bac-source-link-wrap{display:inline-block !important;position:relative;z-index:5;}
@media print{.bac-open-source-link,.bac-source-link-wrap{pointer-events:auto !important;}}

.bac-match-item{position:relative;}
.bac-match-meta{position:relative;z-index:6;}
.bac-source-link-wrap-passages{display:inline !important;position:relative;z-index:50;}
.bac-open-source-link-passages{display:inline !important;position:relative;z-index:60;pointer-events:auto !important;cursor:pointer;text-decoration:underline !important;}
.bac-dir-rtl .bac-report-page, .bac-dir-rtl .bac-report-page *{direction:rtl !important;text-align:right !important;}
.bac-dir-ltr .bac-report-page, .bac-dir-ltr .bac-report-page *{direction:ltr !important;text-align:left !important;}
.bac-dir-rtl .bac-report-page-actions{flex-direction:row-reverse;}
.bac-dir-rtl .bac-report-summary-grid{direction:rtl !important;}
.bac-dir-ltr .bac-report-summary-grid{direction:ltr !important;}
@media print{ .bac-dir-rtl .bac-report-page, .bac-dir-rtl .bac-report-page *{direction:rtl !important;text-align:right !important;} .bac-dir-ltr .bac-report-page, .bac-dir-ltr .bac-report-page *{direction:ltr !important;text-align:left !important;} }

.bac-ai-score-box{
    background:#f8fafc;
    border:1px solid #dbeafe;
    border-radius:14px;
    padding:18px;
    margin:0 0 18px 0;
}
.bac-ai-score-number{
    font-size:38px;
    line-height:1;
    font-weight:800;
    color:#1d4ed8;
    margin-bottom:6px;
}
.bac-ai-score-label{
    font-size:18px;
    font-weight:700;
    color:#111827;
    margin-bottom:5px;
}
.bac-ai-score-note{
    color:#6b7280;
    font-size:13px;
    margin-bottom:12px;
}
.bac-ai-meter{
    height:14px;
    background:#e5e7eb;
    border-radius:999px;
    overflow:hidden;
}
.bac-ai-meter-fill{
    height:100%;
    background:linear-gradient(90deg,#22c55e 0%,#f59e0b 55%,#dc2626 100%);
    border-radius:999px;
}

.bac-auth-wrap {
    max-width: 520px;
    margin: 30px auto;
    padding: 22px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.bac-auth-form p {
    margin: 0 0 14px;
}

.bac-auth-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: #111827;
}

.bac-auth-form input[type="text"],
.bac-auth-form input[type="email"],
.bac-auth-form input[type="password"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #fff;
}

.bac-auth-form .bac-inline-check {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 500;
}

.bac-subscription-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 14px;
    margin: 0 0 20px;
}

.bac-subscription-current {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #14532d;
}

.bac-subscription-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.bac-subscribe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 9px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.2;
}

.bac-subscribe-btn:hover,
.bac-subscribe-btn:focus {
    color: #ffffff;
    opacity: 0.92;
}

.bac-subscribe-silver {
    background: #374151;
}

.bac-subscribe-golden {
    background: #b45309;
}

/* BAC reconstructed tables from OCR/plain PDF extraction */
.bac-report-document-page table.bac-reconstructed-table{
  width:100% !important;
  border-collapse:collapse !important;
  table-layout:fixed !important;
  margin:12px 0 !important;
  white-space:normal !important;
}
.bac-report-document-page table.bac-reconstructed-table td,
.bac-report-document-page table.bac-reconstructed-table th{
  border:1px solid #94a3b8 !important;
  padding:8px !important;
  vertical-align:top !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
}
.bac-report-document-page table.bac-reconstructed-table th{
  background:#f3f4f6 !important;
  font-weight:700 !important;
}
.bac-table-caption{
  font-weight:700 !important;
  margin:12px 0 4px 0 !important;
}
.bac-document-box .bac-report-document-page:has(table.bac-reconstructed-table){
  white-space:normal !important;
}
@media print{
  .bac-report-document-page table.bac-reconstructed-table{
    width:100% !important;
    border-collapse:collapse !important;
    table-layout:fixed !important;
    page-break-inside:auto !important;
    break-inside:auto !important;
  }
  .bac-report-document-page table.bac-reconstructed-table tr{
    page-break-inside:avoid !important;
    break-inside:avoid !important;
  }
  .bac-report-document-page table.bac-reconstructed-table td,
  .bac-report-document-page table.bac-reconstructed-table th{
    border:1px solid #000 !important;
    padding:6px !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
  }
}
