/* --- Global Styles --- */
body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    margin: 0; /* ensure no default body margin/padding */
    padding: 0;
}

/* Make sure .container doesn't conflict with other pages */
.container {
    max-width: 1200px;
    margin: 0 auto; /* center the container on large screens */
    padding-left: 15px;
    padding-right: 15px;
}

/* Navbar Tweaks */
.navbar-brand {
    font-weight: 600;
    font-size: 1.4rem;
}

/* Footer Tweaks */
footer.bg-primary {
    /* (No extra styles specified here in your original file) */
}

/* --- About Page --- */
body.about-page {
    background-color: #f4f7fb;
    color: #1f2933;
}

.about-page .about-shell {
    padding: 42px 0 54px;
}

.about-page .about-hero {
    max-width: 820px;
    margin-bottom: 30px;
}

.about-page .about-kicker {
    margin-bottom: 8px;
    color: #0d6efd;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.about-page .about-hero h1,
.about-page .about-section-header h2 {
    color: #172033;
    font-weight: 700;
    letter-spacing: 0;
}

.about-page .about-hero h1 {
    margin-bottom: 14px;
    font-size: 2.45rem;
}

.about-page .about-hero p {
    max-width: 760px;
    color: #52606d;
    font-size: 1.08rem;
    line-height: 1.65;
}

.about-page .about-cta {
    border-radius: 8px;
    font-weight: 600;
}

.about-page .tag-group,
.about-page .strategy-grid,
.about-page .decision-grid {
    display: grid;
    gap: 18px;
}

.about-page .tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 880px;
}

.about-page .strategy-grid article,
.about-page .flow-node {
    background-color: #ffffff;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.045);
}

.about-page .tag-group span {
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0.42rem 0.78rem;
}

.about-page .capability-tags span {
    background-color: #e7f1ff;
    color: #0a58ca;
}

.about-page .tech-tags {
    margin-top: 12px;
}

.about-page .tech-tags span {
    background-color: #ffffff;
    border: 1px solid #d8e2ef;
    color: #52606d;
    font-weight: 600;
}

.about-page .about-section {
    margin-top: 42px;
}

.about-page .about-section-header {
    max-width: 760px;
    margin-bottom: 18px;
}

.about-page .about-section-header h2 {
    font-size: 1.65rem;
}

.about-page .strategy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.about-page .strategy-grid article {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.about-page .strategy-grid h3 {
    color: #172033;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.about-page .strategy-grid .strategy-meta {
    color: #0a58ca;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.about-page .strategy-grid p {
    color: #52606d;
    line-height: 1.55;
    margin-bottom: 0;
}

.about-page .flow-diagram {
    max-width: 900px;
    padding: 4px 0 0;
}

.about-page .flow-row {
    display: grid;
    gap: 16px;
}

.about-page .flow-row-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.about-page .flow-node {
    padding: 18px;
    text-align: center;
}

.about-page .flow-node-wide {
    max-width: 560px;
    margin: 0 auto;
}

.about-page .flow-node span {
    display: block;
    color: #62748a;
    font-size: 0.78rem;
    font-weight: 700;
}

.about-page .flow-node strong {
    display: block;
    color: #172033;
}

.about-page .flow-arrow {
    color: #0d6efd;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    padding: 10px 0;
    text-align: center;
}

.about-page .flow-caption {
    max-width: 760px;
    margin: 18px 0 0;
    color: #62748a;
    font-size: 0.95rem;
    line-height: 1.55;
}

.about-page .decision-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.about-page .decision-grid article {
    border-top: 3px solid #0d6efd;
    padding-top: 14px;
}

.about-page .decision-grid h3 {
    color: #172033;
    font-size: 1rem;
    font-weight: 700;
}

.about-page .decision-grid p {
    color: #52606d;
    line-height: 1.55;
    margin-bottom: 0;
}

.about-page .about-cta-section {
    margin-top: 42px;
}

@media (max-width: 767.98px) {
    .about-page .about-shell {
        padding-top: 30px;
    }

    .about-page .about-hero h1 {
        font-size: 2rem;
    }

    .about-page .strategy-grid,
    .about-page .decision-grid,
    .about-page .flow-row-split {
        grid-template-columns: 1fr;
    }
}

/* Chart container for welcome page */
.chart-container {
    max-width: 600px; /* Instead of fixed 800px */
    width: 100%;
    height: auto;
    margin: 0 auto;   /* center the chart horizontally */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 400px; /* optional max-height for responsiveness */
}

/* Table header styling for welcome page */
.table thead th {
    background-color: #007bff;
    color: #fff;
}

/* Adjust .read-more-btn if needed */
.read-more-btn {
    background-color: #3399ff;
    font-size: 14px;
    display: block;
    width: fit-content;
    margin: 10px auto;
    padding: 8px 16px;
    border-radius: 4px;
}

/* --- Login Page Specific Styles --- */
/* Only apply these when the body has the class "login-page" */
body.login-page {
    background: linear-gradient(135deg, #f5f7fa, #e0eafc);
    font-family: 'Roboto', sans-serif;
}

.login-workspace {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 400px));
    justify-content: center;
    margin: clamp(2.5rem, 6vh, 4.5rem) auto 2.5rem;
    max-width: 880px;
    padding: 0 1rem;
}

/* Login card styling */
.login-card {
    max-width: 400px;
    margin: 0;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.login-card h2 {
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.login-card p {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

.login-card label {
    font-weight: 500;
}

/* Custom button for login */
.btn-custom {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
    transition: background-color 0.3s, border-color 0.3s;
}
.btn-custom:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Info section styling on login page */
.info-section {
    max-width: 400px;
    margin: 0;
    padding: 1.5rem;
    background-color: #eaf4fc;
    color: #172033;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}
.info-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}
.info-section .credential-helper {
    color: #5d6b7d;
    font-size: 0.85rem;
    line-height: 1.45;
    margin: 0 0 1rem;
}
.credential-group + .credential-group {
    border-top: 1px solid #cbdced;
    margin-top: 1rem;
    padding-top: 1rem;
}
.credential-group h3 {
    color: #465568;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}
.credential-group + .credential-group.credential-group-negative {
    background-color: #fff7f7;
    border-left: 3px solid #c94b4b;
    border-radius: 6px;
    border-top: 0;
    padding: 0.7rem 0.75rem 0.75rem;
}
.credential-group-negative h3 {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}
.negative-test-badge {
    background-color: #f8d7da;
    border-radius: 999px;
    color: #842029;
    flex: 0 0 auto;
    font-size: 0.66rem;
    padding: 0.2rem 0.45rem;
    text-transform: none;
}
.credential-row {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    min-height: 38px;
}
.credential-row + .credential-row {
    margin-top: 0.35rem;
}
.credential-row code {
    color: #172033;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}
.credential-copy {
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #9ebcdd;
    border-radius: 6px;
    color: #0a58ca;
    display: inline-flex;
    flex: 0 0 82px;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 0.35rem;
    justify-content: center;
    min-height: 32px;
    padding: 0.3rem 0.55rem;
}
.credential-copy:hover,
.credential-copy:focus-visible {
    background-color: #f5f9ff;
    border-color: #0d6efd;
}
.credential-copy.is-copied {
    background-color: #edf8f1;
    border-color: #198754;
    color: #146c43;
}
.credential-group-negative code {
    color: #9b2c2c;
}
.info-section .credential-note {
    color: #6b3f3f;
    font-size: 0.8rem;
    margin: 0.35rem 0 0;
}

@media (max-width: 767.98px) {
    .login-workspace {
        gap: 1.25rem;
        grid-template-columns: minmax(0, 400px);
        margin-top: 2rem;
    }
}

/* Footer styling (used on login page) */
.footer {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #0d6efd;
    border-radius: 0 0 10px 10px;
}
.footer a {
    color: #ffffff;
    margin: 0 10px;
    font-size: 24px;
    text-decoration: none;
    transition: color 0.3s;
}
.footer a:hover {
    color: #d4d4d4;
}

/* --- Folder and Test Case Styling --- */
.folder {
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.folder:hover {
    background-color: #e2e6ea;
}
.folder.open {
    color: #0d6efd;
    background-color: #e7f1ff;
}
.folder .arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    margin-right: 5px;
}
.folder, .test-title {
    cursor: pointer; 
}

/* Test case elements: add subtle background and border for readability */
.test-case {
    margin: 5px 0;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.test-case:hover {
    background-color: #f1f1f1;
    transform: scale(1.01);
}

/* Test title adjustments */
.test-title {
    font-weight: 500;
}

/* --- Modal Enhancements --- */
.modal-card {
    animation: fadeInModal 0.3s;
}
@keyframes fadeInModal {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-title-bold {
    font-size: 1.5rem;
    font-weight: bold;
}
.modal-body {
    background-color: #fafafa;
    padding: 20px;
}
.modal-section {
    margin-bottom: 15px;
}

/* --- Test Library Page --- */
.test-library-page {
    background-color: #f5f7fb;
}

.test-library-shell {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.test-library-intro {
    max-width: 980px;
    margin: 0 auto 2rem;
    text-align: left;
}

.test-library-intro .section-kicker {
    color: #0d6efd;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.test-library-intro h1 {
    color: #172033;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.test-library-intro p {
    color: #5b6472;
    font-size: 1.05rem;
    margin: 0;
}

.test-library-suites {
    display: grid;
    gap: 1rem;
    margin: 0 auto;
    max-width: 980px;
}

.test-suite-card {
    background: #ffffff;
    border: 1px solid #dde4ef;
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.suite-toggle {
    align-items: flex-start;
    background: transparent;
    border: 0;
    color: #172033;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1fr auto;
    padding: 1.25rem;
    text-align: left;
    width: 100%;
}

.suite-toggle:hover,
.suite-toggle:focus {
    background-color: #f8fbff;
}

.suite-toggle:focus-visible,
.test-case-row:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.25);
    outline-offset: -3px;
}

.suite-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.suite-title {
    color: #172033;
    font-size: 1.1rem;
    font-weight: 700;
}

.suite-id {
    background: #e7f1ff;
    border-radius: 999px;
    color: #0a58ca;
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 700;
    min-width: 2.8rem;
    padding: 0.22rem 0.55rem;
    text-align: center;
}

.suite-count {
    background: #e7f1ff;
    border-radius: 999px;
    color: #0a58ca;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
}

.suite-summary {
    color: #5b6472;
    grid-column: 1;
    line-height: 1.45;
}

.suite-state {
    color: #0d6efd;
    font-size: 0.9rem;
    font-weight: 700;
    grid-column: 2;
    grid-row: 1 / span 2;
    white-space: nowrap;
}

.suite-panel {
    border-top: 1px solid #e8edf5;
    padding: 0.5rem;
}

.test-case-list {
    display: grid;
    gap: 0.5rem;
}

.test-case-row {
    align-items: baseline;
    background: #ffffff;
    border: 1px solid #e5eaf1;
    border-radius: 8px;
    color: #1f2937;
    display: flex;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    text-align: left;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    width: 100%;
}

.test-case-row:hover,
.test-case-row:focus {
    background-color: #f8fbff;
    border-color: #b9cff3;
}

.case-id {
    background: #e7f1ff;
    border-radius: 999px;
    color: #0a58ca;
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 700;
    min-width: 3.8rem;
    padding: 0.22rem 0.55rem;
    text-align: center;
    white-space: nowrap;
}

.case-title {
    color: #1f2937;
    font-weight: 600;
}

.test-case-modal-title {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    line-height: 1.3;
}

.test-case-modal-title .case-title {
    flex: 1 1 auto;
    min-width: 0;
}

body.test-library-page #testCaseModal .modal-content {
    border: 0;
    border-radius: 8px;
    border-top: 4px solid #0d6efd;
    overflow: hidden;
}

body.test-library-page #testCaseModal .modal-header {
    background-color: #f8fbff;
    border-bottom: 1px solid #d8e2ef;
}

body.test-library-page #testCaseModal .modal-body {
    background-color: #ffffff;
}

.test-case-modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.test-library-page .modal-section strong {
    color: #222222;
}

.test-library-page .modal-section-muted {
    background-color: #f9f9f9;
    border-radius: 4px;
    padding: 8px;
}

@media (max-width: 575.98px) {
    .suite-toggle {
        grid-template-columns: 1fr;
    }

    .suite-state {
        grid-column: 1;
        grid-row: auto;
    }
}
.modal-section i {
    margin-right: 5px;
}
.steps-section {
    background-color: #f7f7f7;
    padding: 10px;
    border-radius: 5px;
}

/* --- Footer Enhancements --- */
.footer-custom {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: #0d6efd;
    border-radius: 0 0 10px 10px;
}
.footer-custom a {
    color: #ffffff;
    margin: 0 15px;
    font-size: 28px;
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer-custom a:hover {
    color: #d4d4d4;
}

.table.table-bordered.text-center.align-middle th,
.table.table-bordered.text-center.align-middle td {
  vertical-align: middle !important;
}

/* --- Homepage QA Portfolio Layout --- */
body.home-page {
    font-family: Arial, sans-serif;
    background-color: #f4f7fb;
    color: #1f2933;
}

.home-page .home-hero {
    padding: 40px 0 20px;
}

.home-page .hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr);
    gap: 32px;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    padding: 36px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.home-page .section-kicker {
    margin-bottom: 8px;
    color: #0d6efd;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.home-page .hero-panel h1,
.home-page .section-header h2 {
    margin-bottom: 12px;
    color: #172033;
    font-weight: 700;
    letter-spacing: 0;
}

.home-page .hero-panel h1 {
    font-size: 2.6rem;
}

.home-page .hero-description {
    max-width: 720px;
    margin-bottom: 24px;
    color: #52606d;
    font-size: 1.08rem;
    line-height: 1.65;
}

.home-page .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.home-page .hero-actions .btn,
.home-page #dashboardLinks .btn,
.home-page .test-cases-toggle {
    background-color: #ffffff;
    border: 1px solid #0d6efd;
    border-radius: 8px;
    color: #0d6efd;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.home-page .hero-actions .btn:hover,
.home-page .hero-actions .btn:focus,
.home-page #dashboardLinks .btn:hover,
.home-page #dashboardLinks .btn:focus,
.home-page .test-cases-toggle:hover,
.home-page .test-cases-toggle:focus {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
    text-decoration: none;
}

.home-page .hero-actions .btn:focus-visible,
.home-page #dashboardLinks .btn:focus-visible,
.home-page .test-cases-toggle:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

.home-page .hero-highlights {
    display: grid;
    gap: 12px;
}

.home-page .hero-highlights div {
    background-color: #f8fbff;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    padding: 16px;
}

.home-page .hero-highlights span,
.home-page .metric-label {
    display: block;
    color: #62748a;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.home-page .hero-highlights strong {
    display: block;
    margin-top: 4px;
    color: #172033;
    font-size: 1rem;
}

.home-page .dashboard-section {
    padding: 12px 0 46px;
}

.home-page .section-header {
    max-width: 760px;
    margin: 0 auto 22px;
    text-align: center;
}

.home-page .section-header p {
    line-height: 1.6;
}

.home-page .metric-row {
    margin-bottom: 34px;
}

.home-page .metric-card,
.home-page .dashboard-card {
    height: 100%;
    background-color: #ffffff;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.home-page .metric-card {
    padding: 18px 14px;
}

.home-page .metric-value,
.home-page #summaryStatus {
    margin-top: 6px;
    color: #172033;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.2;
}

.home-page .dashboard-card {
    padding: 24px;
}

.home-page .result-summary-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-page .suite-summary-card {
    display: flex;
    flex-direction: column;
}

.home-page .dashboard-card h3 {
    margin-bottom: 14px;
    color: #172033;
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
}

.home-page .details-header {
    margin-top: 4px;
}

.home-page .chart-container {
    max-width: 360px;
    min-height: 265px;
    height: 265px;
}

.home-page #suiteSummaries > div {
    max-width: 420px;
}

.home-page #suiteSummaries .border {
    border-color: #d8e2ef !important;
    border-radius: 8px !important;
    background-color: #f8fbff;
}

.home-page .results-card {
    max-width: 1080px;
    margin: 0 auto;
}

.home-page .table-heading {
    margin-bottom: 14px;
    text-align: center;
}

.home-page .table-heading h3 {
    margin-bottom: 6px;
}

.home-page .test-cases-toggle {
    margin-top: 16px;
}

.home-page .table {
    margin-bottom: 0;
    background-color: #ffffff;
}

.home-page .table thead th {
    background-color: #0d6efd;
}

@media (max-width: 991.98px) {
    .home-page .hero-panel {
        grid-template-columns: 1fr;
        padding: 28px;
    }

    .home-page .hero-panel h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 575.98px) {
    .home-page .home-hero {
        padding-top: 24px;
    }

    .home-page .hero-panel {
        padding: 22px;
    }

    .home-page .hero-panel h1 {
        font-size: 1.9rem;
    }

    .home-page .hero-actions .btn {
        width: 100%;
    }

    .home-page .dashboard-card {
        padding: 18px;
    }

    .home-page .chart-container {
        min-height: 245px;
        height: 245px;
    }
}

/* --- AI Pull Request Review Refinement --- */
body.ai-review-page {
    background-color: #f4f7fb;
    color: #1f2933;
}

.ai-review-page .ai-kicker {
    color: #0d6efd;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.ai-review-page .ai-wide-container {
    max-width: 1320px;
}

.ai-review-page .ai-review-intro {
    background-color: #ffffff;
    border-bottom: 1px solid #d8e2ef;
    padding: 30px 0 26px;
}

.ai-review-page .ai-review-intro h1 {
    color: #172033;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.ai-review-page .ai-review-intro p:last-child {
    color: #52606d;
    line-height: 1.55;
    margin: 0;
    max-width: 830px;
}

.ai-review-page .ai-report-shell {
    padding: 26px 0 50px;
}

.ai-review-page .ai-review-selector {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    max-width: 760px;
}

.ai-review-page .ai-review-selector label {
    color: #344054;
    flex: 0 0 auto;
    font-size: 0.9rem;
    font-weight: 700;
}

.ai-review-page .ai-review-selector .form-select {
    border-color: #b8c6d9;
    border-radius: 6px;
    min-height: 40px;
}

.ai-review-page .ai-state-panel {
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    display: flex;
    gap: 14px;
    min-height: 92px;
    padding: 22px;
}

.ai-review-page .ai-state-panel h2 {
    color: #172033;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.ai-review-page .ai-state-unavailable {
    border-left: 4px solid #d39e00;
}

.ai-review-page .ai-state-unavailable i {
    color: #8a6500;
    font-size: 1.35rem;
}

.ai-review-page .ai-state-panel > p {
    margin: 0;
}

.ai-review-page .pr-review {
    background-color: #ffffff;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.ai-review-page .pr-review-header {
    padding: 24px 26px 20px;
}

.ai-review-page .pr-title-row {
    align-items: flex-start;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.ai-review-page .pr-number {
    color: #62748a;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.ai-review-page .pr-title-row h2 {
    color: #172033;
    font-size: 1.55rem;
    font-weight: 700;
    margin-bottom: 7px;
    overflow-wrap: anywhere;
}

.ai-review-page .pr-meta {
    color: #62748a;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.88rem;
    gap: 6px;
    margin: 0;
}

.ai-review-page .ai-risk-badge {
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
    white-space: nowrap;
}

.ai-review-page .ai-risk-low {
    background-color: #dff4e8;
    border-color: #a3cfbb;
    color: #146c43;
}

.ai-review-page .ai-risk-medium {
    background-color: #fff3cd;
    border-color: #ffe69c;
    color: #755600;
}

.ai-review-page .ai-risk-high {
    background-color: #f8d7da;
    border-color: #f1aeb5;
    color: #842029;
}

.ai-review-page .ai-risk-unknown {
    background-color: #e9ecef;
    border-color: #ced4da;
    color: #495057;
}

.ai-review-page .pr-change-stats {
    align-items: center;
    border-bottom: 1px solid #e4e9f1;
    border-top: 1px solid #e4e9f1;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 20px 0 16px;
    padding: 11px 0;
}

.ai-review-page .pr-change-stats div {
    align-items: baseline;
    border-right: 1px solid #e4e9f1;
    display: flex;
    gap: 7px;
    margin-right: 18px;
    padding-right: 18px;
}

.ai-review-page .pr-change-stats div:last-child {
    border-right: 0;
}

.ai-review-page .pr-change-stats dt {
    color: #62748a;
    font-size: 0.8rem;
    font-weight: 600;
}

.ai-review-page .pr-change-stats dd {
    color: #172033;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.ai-review-page .pr-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.ai-review-page .pr-review-actions .btn {
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
}

.ai-review-page .pr-tabs {
    background-color: #f8fafc;
    border-bottom: 1px solid #d8e2ef;
    border-top: 1px solid #d8e2ef;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 0 20px;
}

.ai-review-page .pr-tab {
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    color: #52606d;
    flex: 0 0 auto;
    font-weight: 600;
    padding: 13px 15px 11px;
}

.ai-review-page .pr-tab:hover,
.ai-review-page .pr-tab:focus {
    color: #0a58ca;
}

.ai-review-page .pr-tab:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.28);
    outline: 0;
}

.ai-review-page .pr-tab.active {
    border-bottom-color: #0d6efd;
    color: #0a58ca;
}

.ai-review-page .pr-tab-content {
    padding: 0 26px 8px;
}

.ai-review-page .pr-tab-panel[hidden] {
    display: none;
}

.ai-review-page .review-section {
    border-bottom: 1px solid #e4e9f1;
    padding: 24px 0;
}

.ai-review-page .review-section:last-child {
    border-bottom: 0;
}

.ai-review-page .review-section h2,
.ai-review-page .report-metadata h2,
.ai-review-page .analysis-process h2 {
    color: #172033;
    font-size: 1.08rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.ai-review-page .review-section-heading {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
}

.ai-review-page .review-section-heading h2 {
    margin-bottom: 3px;
}

.ai-review-page .review-section-heading p,
.ai-review-page .section-context {
    color: #62748a;
    font-size: 0.86rem;
    line-height: 1.5;
    margin: 0;
}

.ai-review-page .review-section-heading-actions {
    gap: 20px;
}

.ai-review-page .review-link,
.ai-review-page .metadata-links a,
.ai-review-page .review-text-toggle {
    color: #0d6efd;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
}

.ai-review-page .review-link:hover,
.ai-review-page .metadata-links a:hover,
.ai-review-page .review-text-toggle:hover {
    text-decoration: underline;
}

.ai-review-page .review-text-toggle {
    background: transparent;
    border: 0;
    padding: 5px 0 0;
}

.ai-review-page .summary-copy,
.ai-review-page .readable-copy {
    color: #344054;
    line-height: 1.62;
    margin: 0;
    max-width: 900px;
}

.ai-review-page .summary-collapsed {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.ai-review-page .review-list,
.ai-review-page .test-impact-list {
    border: 1px solid #dfe5ed;
    border-radius: 6px;
    overflow: hidden;
}

.ai-review-page .review-row,
.ai-review-page .test-impact-row {
    align-items: start;
    border-bottom: 1px solid #e4e9f1;
    display: grid;
    gap: 16px;
    grid-template-columns: 150px minmax(0, 1fr);
    padding: 15px 16px;
}

.ai-review-page .review-row:last-child,
.ai-review-page .test-impact-row:last-child {
    border-bottom: 0;
}

.ai-review-page .review-row h3,
.ai-review-page .test-impact-row h3 {
    color: #172033;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.ai-review-page .review-row p,
.ai-review-page .test-impact-row p {
    color: #52606d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    overflow-wrap: anywhere;
}

.ai-review-page .review-finding-badge,
.ai-review-page .review-item-label {
    font-size: 0.75rem;
    font-weight: 700;
}

.ai-review-page .review-finding-badge {
    border-radius: 999px;
    justify-self: start;
    padding: 0.28rem 0.58rem;
    white-space: nowrap;
}

.ai-review-page .review-finding-review {
    background-color: #fff3cd;
    color: #755600;
}

.ai-review-page .review-finding-high {
    background-color: #f8d7da;
    color: #842029;
}

.ai-review-page .review-finding-medium {
    background-color: #fff3cd;
    color: #755600;
}

.ai-review-page .review-finding-info {
    background-color: #e7f1ff;
    color: #0a58ca;
}

.ai-review-page .review-item-label {
    color: #62748a;
    display: block;
    margin-bottom: 3px;
}

.ai-review-page .changed-files-list {
    border: 1px solid #dfe5ed;
    border-radius: 6px;
    overflow: hidden;
}

.ai-review-page .changed-file-row {
    align-items: center;
    border-bottom: 1px solid #e4e9f1;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    min-height: 44px;
    padding: 9px 13px;
}

.ai-review-page .changed-file-row:last-child {
    border-bottom: 0;
}

.ai-review-page .changed-file-identity {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.ai-review-page .changed-file-identity code {
    color: #172033;
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.ai-review-page .changed-file-status {
    background-color: #edf2f7;
    border-radius: 999px;
    color: #52606d;
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.48rem;
    text-transform: capitalize;
}

.ai-review-page .changed-file-stats {
    display: flex;
    flex: 0 0 auto;
    font-family: monospace;
    font-size: 0.84rem;
    gap: 12px;
}

.ai-review-page .test-impact-row {
    align-items: flex-start;
    display: flex;
    gap: 12px;
}

.ai-review-page .test-impact-row > div {
    flex: 1 1 auto;
    min-width: 0;
}

.ai-review-page .ai-test-id,
.ai-review-page .ai-priority-badge {
    align-self: start;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    justify-self: start;
    padding: 0.3rem 0.58rem;
    white-space: nowrap;
}

.ai-review-page .ai-test-id {
    background-color: #e7f1ff;
    color: #0a58ca;
}

.ai-review-page .ai-priority-high {
    background-color: #f8d7da;
    color: #842029;
}

.ai-review-page .ai-priority-medium {
    background-color: #fff3cd;
    color: #755600;
}

.ai-review-page .ai-priority-low {
    background-color: #dff4e8;
    color: #146c43;
}

.ai-review-page .ai-priority-unknown {
    background-color: #e9ecef;
    color: #495057;
}

.ai-review-page .detail-columns {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-review-page .limitations-section {
    border-left: 3px solid #d39e00;
    padding-left: 18px;
}

.ai-review-page .review-bullet-list {
    color: #52606d;
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 1.2rem;
}

.ai-review-page .report-metadata {
    background-color: #f8fafc;
    border: 1px solid #dfe5ed;
    border-radius: 6px;
    margin-top: 24px;
    padding: 20px;
}

.ai-review-page .metadata-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.ai-review-page .report-metadata-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
}

.ai-review-page .report-metadata-grid dt {
    color: #62748a;
    font-size: 0.72rem;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.ai-review-page .report-metadata-grid dd {
    color: #172033;
    font-size: 0.88rem;
    margin: 0;
    overflow-wrap: anywhere;
}

.ai-review-page .analysis-process {
    border-top: 1px solid #e4e9f1;
    margin-top: 24px;
    padding: 24px 0 16px;
}

.ai-review-page .analysis-process ol {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
}

.ai-review-page .analysis-process li {
    color: #344054;
    font-size: 0.82rem;
    font-weight: 700;
}

.ai-review-page .analysis-process li:not(:last-child)::after {
    color: #0d6efd;
    content: "→";
    margin-left: 8px;
}

.ai-review-page .analysis-process p {
    color: #62748a;
    font-size: 0.88rem;
    line-height: 1.55;
    margin: 0;
    max-width: 960px;
}

.ai-review-page .ai-empty-state,
.ai-review-page .ai-empty-item {
    color: #62748a;
    font-style: normal;
    line-height: 1.5;
    margin: 0;
}

.ai-review-page .review-list > .ai-empty-state,
.ai-review-page .test-impact-list > .ai-empty-state,
.ai-review-page .changed-files-list > .ai-empty-state {
    padding: 16px;
}

@media (max-width: 767.98px) {
    .ai-review-page .ai-review-intro h1 {
        font-size: 1.7rem;
    }

    .ai-review-page .pr-title-row,
    .ai-review-page .review-section-heading-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .ai-review-page .pr-change-stats div {
        border-right: 0;
        flex: 1 1 45%;
        margin: 4px 0;
        padding-right: 10px;
    }

    .ai-review-page .report-metadata-grid,
    .ai-review-page .detail-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ai-review-page .review-row,
    .ai-review-page .test-impact-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 575.98px) {
    .ai-review-page .ai-review-selector {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }

    .ai-review-page .pr-review-header,
    .ai-review-page .pr-tab-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .ai-review-page .pr-review-actions .btn {
        width: 100%;
    }

    .ai-review-page .changed-file-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .ai-review-page .report-metadata-grid,
    .ai-review-page .detail-columns {
        grid-template-columns: 1fr;
    }

    .ai-review-page .analysis-process ol {
        align-items: flex-start;
        flex-direction: column;
    }

    .ai-review-page .analysis-process li:not(:last-child)::after {
        content: "↓";
        margin-left: 7px;
    }
}
