/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    background-color: #e7e7e7;
    margin: 0;
    padding: 0;
    color: #333;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

.new_line {
    flex-basis: 100%;
    display: flex;
    justify-content: center;
}

/* Navbar */
.navbar {
    background-color: #104F55;
    color: #fff;
    padding: 20px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
}

/* Main Container */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1800px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
}

/* Results Page Layout */
.results-page {
    display: grid;
    grid-template-columns: (4, 1fr); /* Single column for small screens */
    gap: 20px;
    width: 100%;
    max-width: 1800;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Card Styles */
.card, .wide-card, .results-description-card, .results-details-card, .results-stock-card, .results-key-personnel-card {
    width: 90%;
    max-width: 600px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s ease-in-out;
    margin-top:30px;
    margin-bottom: 20px;
    background-color: #fff;
    color: #333;
    box-sizing: border-box;
}

/* Full-width top summary card */
.card.summary-card {
    width: 100%;
    max-width: none;
    text-align: left;
}

/* Ensure results cards are flexible */
.results-description-card, .results-details-card, .results-stock-card, .results-key-personnel-card {
    width: 100%;
    max-width: 100%;
    min-height: 500px;
    max-height: 500px;
    overflow-y: auto;
    margin: 0 auto;
    text-align: left;
}

.card-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.card-row .card {
    flex: 1 1 300px;
    max-width: 350px;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    text-align: center;
}

.card .button {
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background-color: #643b50;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.card .button:hover {
    background-color: #522e41;
}



/* Centered Table Styling */
.centered-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 10px 0;
}
.centered-table th, .centered-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    white-space: nowrap;
}
.centered-table th {
    background-color: #104F55;
    color: white;
}
.centered-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Adjust name column for flexible width without excessive wrapping */
.name-column {
    white-space: nowrap;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Buttons */
.button {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #704C5E;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease-in-out;
    border: 2px solid transparent;
    box-sizing: border-box;
}
.button:hover {
    background-color: #704C5E;
    border: 2px solid #fff;
}

/* Home Button */
.home-button {
    display: block;
    margin-top: 30px;
    margin-bottom: 30px;
    text-align: center;
}

/* Footer */
.footer {
    background-color: #104F55;
    color: white;
    text-align: center;
    padding: 20px;
    position: relative;
    bottom: 0;
    width: 100%;
    font-size: 14px;
}



/* Responsive Design */
@media (min-width: 428px) {
    .container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .results-page {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    .card {
        width: 30%;
        margin: 10px;
    }
}

/* Stock Chart Styling */
.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    text-align: center;
}

.chart-container img {
    max-width: 100%;
    height: auto;
}

.chart-controls {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    text-align: center;
    margin-bottom: 20px;
}
.chart-controls .button {
    margin: 5px;
    padding: 10px 15px;
    background-color: #104F55;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}
.chart-controls .button:hover {
    background-color: #0c3a3f;
}




/* Styling for the Financial Analysis Charting */
.toggle-content.hidden {
  display: none;
}

.toggle-icon.rotate {
  transform: rotate(-90deg);
}


/* styling for the company comparison page */

body {
  font-family: 'Roboto', sans-serif;
  background-color: #eeeeee;
  color: #222;
}

.container.comparison-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: block;
  gap: 2rem;
}

.metric-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
  width: 90%;
  max-width: 1000px;
  box-sizing: border-box;
  margin: 20px auto;
}

.metric-card h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

.centered-table {
  width: 100%;
  border-collapse: collapse;
}

.centered-table th,
.centered-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.95rem;
}

.centered-table th {
  background-color: #f9f9f9;
  font-weight: 500;
  color: #333;
}

form.form-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
}

select {
  padding: 0.3rem 0.6rem;
  font-size: 0.95rem;
}

canvas {
  margin-top: 1rem;
  max-height: 300px;
}

/* Boethius styling */
.metric-card .input-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: flex-start;
  margin-top: 15px;
}

.metric-card textarea {
  width: 100%;
  padding: 10px;
  resize: vertical;
  min-height: 60px;
  border-radius: var(--radius);
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 0.8rem;
 }


.metric-card textarea: focus {
  resize: none;
}

.button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.left-button-item {
  display: flex;
  align-items: center; 
  gap: 8px;
}

.right-button-item {
  display: flex;
  justify-content: flex-end;
  flex-grow: 1;
}

.metric-card button {
  padding: 5px 10px;
  border-radius: var(--radius);
  border: 1px solid #aaa;
  background-color: var(--bg-card);
  cursor: pointer;
  font-family: inherit;
}

.conversationContainer {
  max-height: 300px;
  overflow-y: scroll;
}


/* Responsive styling */
@media (max-width: 1280px) {
    .results-page {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Mobile Fixes */
@media (max-width: 600px) {
    .results-page {
        grid-template-columns: 1fr;
    }
    .card {
        width: 95%;
        max-width: 100%;
    }
}


/* --- Summary Card (top of company page) ------------------------------ */

.summary-card {
  width: 100%;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.summary-title {
  margin: 0;
}

.summary-sub {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-top: 4px;
}

.summary-warning {
  font-size: 0.9rem;
  padding: 6px 10px;
  border: 1px solid #c9792a;
  border-radius: 6px;
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-block .label {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-bottom: 6px;
}

.summary-block .big {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
}

.summary-block .small {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-top: 6px;
}

/* Responsive */
@media (max-width: 1200px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-warning {
    white-space: normal;
  }
}

@media (max-width: 650px) {
  .summary-header {
    flex-direction: column;
    align-items: stretch;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
}


/* --- Homepage layout ------------------------------------------------ */

.homepage-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    width: 100%;
    max-width: 1400px;
    margin: 30px auto;
    align-items: start;
    box-sizing: border-box;
}

.homepage-left,
.homepage-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-title {
    width: 100%;
    max-width: 1400px;
    margin: 30px auto 10px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.page-title h1 {
    margin-bottom: 10px;
}

.page-title .subtitle {
    max-width: 900px;
    line-height: 1.6;
}

/* Performance cards on homepage */
.performance-card {
    width: 100%;
    max-width: none;
    margin: 0;
    text-align: left;
}

.performance-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

/* Right-hand homepage cards */
.homepage-right .home-card {
    width: 100%;
    max-width: none;
    margin: 0;
    text-align: left;
}

.homepage-right .home-card h3 {
    margin-top: 0;
}

.homepage-right .home-card .button {
    margin-top: 16px;
}
.home-intel-card .card-header-row {
    align-items: center;
    gap: 12px;
}
.home-intel-card .card-header-row .button {
    margin-top: 0;
}
.homepage-insight-list,
.homepage-link-list {
    display: grid;
    gap: 10px;
}
.homepage-insight-item {
    border-top: 1px solid #edf0f1;
    padding-top: 10px;
}
.homepage-insight-item:first-child {
    border-top: 0;
    padding-top: 0;
}
.homepage-insight-item h4 {
    font-size: 0.98rem;
    line-height: 1.3;
    margin: 7px 0 5px;
}
.homepage-insight-item h4 a {
    color: #183f46;
    text-decoration: none;
}
.homepage-insight-item h4 a:hover {
    text-decoration: underline;
}
.homepage-insight-item p {
    color: #5f6b73;
    font-size: 0.9rem;
    line-height: 1.42;
    margin: 0;
}
.homepage-link-list a {
    border-top: 1px solid #edf0f1;
    color: #183f46;
    display: grid;
    gap: 3px;
    padding-top: 10px;
    text-decoration: none;
}
.homepage-link-list a:first-child {
    border-top: 0;
    padding-top: 0;
}
.homepage-link-list a:hover span {
    text-decoration: underline;
}
.homepage-link-list span {
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.28;
}
.homepage-link-list small {
    color: #68747a;
    font-size: 0.78rem;
    font-weight: 700;
}
.home-dashboard {
    display: grid;
    gap: 18px;
    margin: 24px auto 36px;
    max-width: 1440px;
    padding: 0 10px;
    width: 100%;
}
.home-dashboard-header {
    align-items: end;
    border-bottom: 1px solid #dfe7e9;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding-bottom: 12px;
}
.home-dashboard-header h1 {
    color: #183f46;
    font-size: 1.7rem;
    margin: 0;
}
.home-header-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}
.home-header-metrics span {
    background: #f4f7f7;
    border: 1px solid #dfe7e9;
    border-radius: 8px;
    color: #526168;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 7px 10px;
}
.home-header-metrics strong {
    color: #183f46;
    font-size: 1rem;
    margin-right: 4px;
}
.home-attention-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.75fr);
}
.home-activity-grid,
.home-market-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-panel {
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(24, 63, 70, 0.08);
    margin: 0;
    max-width: none;
    min-width: 0;
    text-align: left;
    width: 100%;
}
.home-panel .card-header-row {
    align-items: center;
    border-bottom: 1px solid #edf0f1;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 10px;
}
.home-panel .card-header-row h2 {
    color: #183f46;
    font-size: 1.08rem;
    margin: 0;
}
.home-panel .card-header-row .button {
    margin-top: 0;
}
.home-lead-item {
    display: grid;
    gap: 9px;
}
.home-lead-item h3 {
    font-size: 1.28rem;
    line-height: 1.25;
    margin: 0;
}
.home-lead-item h3 a,
.home-secondary-item,
.home-update-list a,
.home-workbench-list a,
.home-evidence-strip a,
.home-queue-metrics a {
    color: #183f46;
    text-decoration: none;
}
.home-lead-item h3 a:hover,
.home-secondary-item:hover span,
.home-update-list a:hover span,
.home-workbench-list a:hover span,
.home-evidence-strip a:hover span,
.home-queue-metrics a:hover span {
    text-decoration: underline;
}
.home-lead-item p {
    color: #526168;
    font-size: 0.98rem;
    line-height: 1.48;
    margin: 0;
    max-width: 88ch;
}
.home-lead-footer {
    align-items: center;
    color: #68747a;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.84rem;
    font-weight: 700;
    gap: 10px;
}
.home-secondary-grid {
    border-top: 1px solid #edf0f1;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
    padding-top: 14px;
}
.home-secondary-item,
.home-update-list a,
.home-workbench-list a,
.home-evidence-strip a {
    border: 1px solid #edf0f1;
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 10px;
}
.home-secondary-item span,
.home-update-list span,
.home-workbench-list span,
.home-evidence-strip span {
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.28;
}
.home-secondary-item small,
.home-update-list small,
.home-workbench-list small,
.home-evidence-strip small {
    color: #68747a;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
}
.home-queue-metrics {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 14px;
}
.home-queue-metrics a {
    background: #f4f7f7;
    border: 1px solid #dfe7e9;
    border-radius: 8px;
    display: grid;
    gap: 2px;
    padding: 12px;
}
.home-queue-metrics strong {
    font-size: 1.45rem;
    line-height: 1;
}
.home-queue-metrics span {
    color: #68747a;
    font-size: 0.78rem;
    font-weight: 800;
}
.home-watchlist-list.homepage-link-list a {
    border: 1px solid #edf0f1;
    border-radius: 8px;
    padding: 10px;
}
.home-update-list,
.home-workbench-list {
    display: grid;
    gap: 9px;
}
.home-evidence-strip {
    border-top: 1px solid #edf0f1;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
    padding-top: 14px;
}
.home-market-grid .mini-toggle {
    justify-content: flex-end;
}
.home-market-grid .performance-table {
    font-size: 0.88rem;
}
.home-market-grid .performance-table th,
.home-market-grid .performance-table td {
    padding: 9px 8px;
}
@media (max-width: 1100px) {
    .home-attention-grid,
    .home-activity-grid,
    .home-market-grid {
        grid-template-columns: 1fr;
    }
    .home-dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .home-header-metrics {
        justify-content: flex-start;
    }
}
@media (max-width: 700px) {
    .home-secondary-grid,
    .home-evidence-strip,
    .home-queue-metrics {
        grid-template-columns: 1fr;
    }
}

.home-board {
    display: grid;
    gap: 12px;
    margin: 16px auto 24px;
    max-width: 1440px;
    padding: 0 8px;
    width: 100%;
}
.home-board-header {
    align-items: end;
    border-bottom: 1px solid #dfe7e9;
    display: flex;
    justify-content: space-between;
    padding-bottom: 8px;
}
.home-board-header h1 {
    color: #183f46;
    font-size: 1.45rem;
    margin: 0;
}
.home-job-strip {
    background: #f8faf9;
    border: 1px solid #dfe7e9;
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(260px, 1.4fr) minmax(360px, 1fr) auto;
    min-width: 0;
    padding: 10px;
}
.home-job-current {
    align-items: center;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
}
.home-job-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.home-job-state {
    border-radius: 7px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    padding: 5px 7px;
    text-transform: uppercase;
}
.home-job-state-running {
    background: #e6f4ea;
    color: #225c31;
}
.home-job-state-scheduled {
    background: #eef3f4;
    color: #183f46;
}
.home-job-state-waiting {
    background: #f7ebd7;
    color: #76501b;
}
.home-job-state-paused {
    background: #f8d7da;
    color: #7a2630;
}
.home-job-state-idle {
    background: #f3f0e8;
    color: #6e5c2d;
}
.home-job-title {
    color: #183f46;
    font-size: 0.86rem;
    font-weight: 850;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.home-job-meta {
    color: #68747a;
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}
.home-job-link {
    color: #0b5c73;
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 850;
    text-decoration: none;
}
.home-job-link:hover {
    text-decoration: underline;
}
.home-job-counts {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-width: 0;
}
.home-job-counts span {
    background: #ffffff;
    border: 1px solid #e6ecee;
    border-radius: 7px;
    color: #68747a;
    font-size: 0.76rem;
    font-weight: 800;
    min-width: 0;
    padding: 5px 7px;
}
.home-job-counts strong,
.home-job-counts em {
    color: #183f46;
    font-style: normal;
}
.home-job-counts em {
    display: block;
    font-size: 0.7rem;
    margin-top: 2px;
}
.home-job-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 6px;
}
.home-tile-grid {
    align-items: start;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-investment-tile {
    grid-column: 1 / -1;
}
.home-tile {
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(24, 63, 70, 0.08);
    display: grid;
    gap: 8px;
    margin: 0;
    max-width: none;
    min-width: 0;
    padding: 12px;
    text-align: left;
    width: 100%;
}
.home-tile .eyebrow,
.home-board-header .eyebrow {
    margin: 0 0 4px;
}
.home-tile-header {
    align-items: center;
    border-bottom: 1px solid #edf0f1;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding-bottom: 7px;
}
.home-tile-header h2 {
    color: #183f46;
    font-size: 1rem;
    line-height: 1.2;
    margin: 0;
}
.home-tile-header .button {
    flex: 0 0 auto;
    margin-top: 0;
}
.home-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.home-tab {
    background: #f4f7f7;
    border: 1px solid #dfe7e9;
    border-radius: 7px;
    color: #526168;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 6px 8px;
}
.home-tab.active {
    background: #183f46;
    border-color: #183f46;
    color: #ffffff;
}
.home-tab-panel {
    display: none;
}
.home-tab-panel.active {
    display: block;
}
.compact-tabs {
    margin-bottom: 8px;
}
.home-investment-tile .home-compact-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.home-investment-tile .home-compact-list a {
    align-items: flex-start;
    display: grid;
}
.home-investment-tile .performance-table {
    font-size: 0.82rem;
}
.home-investment-tile .performance-table th,
.home-investment-tile .performance-table td {
    padding: 7px 8px;
}
.home-gain-lead {
    align-items: center;
    background: #f4f7f7;
    border: 1px solid #dfe7e9;
    border-radius: 8px;
    color: #183f46;
    display: flex;
    gap: 14px;
    padding: 14px;
    text-decoration: none;
}
.home-gain-lead:hover strong,
.home-compact-list a:hover strong,
.home-project-list a:hover strong {
    text-decoration: underline;
}
.home-gain-percent {
    color: #225c31;
    flex: 0 0 auto;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}
.home-gain-lead span:last-child,
.home-compact-list a > span:first-child,
.home-project-list a > span:first-child {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.home-gain-lead strong,
.home-compact-list strong,
.home-project-list strong {
    color: #183f46;
    font-size: 0.94rem;
    line-height: 1.28;
}
.home-gain-lead small,
.home-compact-list small,
.home-project-list small {
    color: #68747a;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
}
.home-compact-list,
.home-project-list {
    display: grid;
    gap: 6px;
}
.home-compact-list a,
.home-project-list a {
    align-items: center;
    border: 1px solid #edf0f1;
    border-radius: 8px;
    color: #183f46;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-width: 0;
    padding: 8px;
    text-decoration: none;
}
.home-return-pair {
    flex: 0 0 auto;
    text-align: right;
}
.home-return-pair strong {
    color: #225c31;
}
.home-score-pill {
    align-items: center;
    background: #eef3f4;
    border: 1px solid #d8e0e2;
    border-radius: 8px;
    color: #183f46;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.9rem;
    font-weight: 800;
    justify-content: center;
    min-width: 42px;
    padding: 6px 8px;
}
.home-news-badge {
    background: #e3f5e7;
    border: 1px solid #b7ddbf;
    border-radius: 7px;
    color: #225c31;
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    margin-right: 6px;
    padding: 2px 6px;
}
.home-projects-tile {
    gap: 10px;
}
.home-project-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.home-project-list a {
    align-items: flex-start;
    display: grid;
}
@media (max-width: 1180px) {
    .home-investment-tile .home-compact-list,
    .home-project-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .home-job-strip {
        grid-template-columns: 1fr;
    }
    .home-job-current {
        align-items: flex-start;
    }
    .home-job-title,
    .home-job-meta {
        white-space: normal;
    }
    .home-job-counts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-investment-tile .home-compact-list,
    .home-tile-grid,
    .home-project-list {
        grid-template-columns: 1fr;
    }
    .home-tile-header {
        align-items: flex-start;
    }
}
@media (max-width: 560px) {
    .home-gain-lead,
    .home-compact-list a {
        align-items: flex-start;
        flex-direction: column;
    }
    .home-return-pair {
        text-align: left;
    }
}

/* Performance tables */
.performance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.performance-table th,
.performance-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e2e2e2;
    text-align: left;
}

.performance-table th {
    background-color: #104F55;
    color: #fff;
    font-weight: 500;
}

.performance-table tbody tr:hover {
    background-color: #f7f7f7;
}

/* Responsive homepage */
@media (max-width: 1000px) {
    .homepage-layout {
        grid-template-columns: 1fr;
    }
}


.thesis-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.thesis-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.thesis-tab {
    border: 1px solid #d9d9d9;
    background: #f5f5f5;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.9rem;
}

.thesis-tab.active {
    background: #ffffff;
    border-color: #999;
    font-weight: 500;
}

.thesis-panel {
    display: none;
}

.thesis-panel.active {
    display: block;
}

.toggle-rows-btn {
    margin-top: 10px;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

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

.mini-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mini-toggle-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    color: #666;
    border-bottom: 1px solid transparent;
}

.mini-toggle-btn.active {
    color: #111;
    font-weight: 500;
    border-bottom: 1px solid #999;
}

.toggle-panel {
    display: none;
}

.toggle-panel.active {
    display: block;
}

.thesis-card {
    margin-top: 20px;
    margin-left: 0;
}

.logout-form {
    display: inline;
    margin: 0;
}

.logout-link {
    border-radius: 7px;
    padding: 0.42rem 0.5rem;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    line-height: 1.2;
}
.logout-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}


.auth-page {
    min-height: calc(100vh - 180px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    background: #ffffff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.auth-heading {
    margin-bottom: 1.5rem;
}

.auth-heading h1 {
    margin: 0 0 0.4rem;
    font-size: 1.7rem;
    font-weight: 500;
}

.auth-heading p {
    margin: 0;
    color: #666666;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-field label {
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem;
    border: 1px solid #c8c8c8;
    border-radius: 4px;
    font: inherit;
    background: #fafafa;
}

.auth-field input:focus {
    outline: none;
    border-color: #555555;
    background: #ffffff;
}

.auth-submit {
    padding: 0.8rem 1rem;
    border: 0;
    border-radius: 4px;
    background: #333333;
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

.auth-submit:hover {
    background: #111111;
}

.auth-error {
    margin-bottom: 1.2rem;
    padding: 0.75rem;
    border-left: 3px solid #9b2c2c;
    background: #f8eeee;
    color: #6f2020;
    font-size: 0.9rem;
}
/* Research workbench */
.workbench-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}
.workbench-shell.narrow { width: min(760px, calc(100% - 32px)); }
.workbench-hero, .workbench-card {
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
.workbench-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 28px;
    margin-bottom: 22px;
}
.workbench-hero h1, .workbench-card h1, .workbench-card h2 { margin-top: 0; color: #183f46; }
.eyebrow {
    color: #704C5E;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.workbench-grid, .board-grid, .workspace-primary-grid, .workspace-bottom-grid {
    display: grid;
    gap: 18px;
}
.workbench-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.board-grid, .workspace-bottom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workspace-primary-grid {
    align-items: start;
    grid-template-columns: minmax(360px, 1.1fr) minmax(300px, 0.9fr);
    margin-bottom: 18px;
}
.workspace-side-stack {
    display: grid;
    gap: 18px;
}
.workbench-card { padding: 22px; text-align: left; }
.card-meta, .muted, .list-item span { color: #68747a; font-size: 0.9rem; }
.metrics-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.metrics-row span {
    background: #eef3f4;
    border-radius: 8px;
    color: #183f46;
    padding: 6px 10px;
}
.button.secondary {
    background-color: #ffffff;
    border-color: #c8d0d2;
    color: #183f46;
    border-radius: 3px;
}
.button.secondary:hover {
    background-color: #eef3f4;
    border-color: #183f46;
    color: #183f46;
}
.compact-button, .discreet-button {
    border-radius: 7px;
    font-size: 0.78rem;
    padding: 6px 10px;
}
.discreet-button {
    background-color: #eef3f4;
    color: #183f46;
}
.action-group { display: flex; gap: 10px; flex-wrap: wrap; }
.section-heading-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}
.workspace-action-list {
    display: grid;
    gap: 10px;
}
.workspace-action-list .button {
    justify-content: center;
    text-align: center;
}
.note-item {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}
.note-item-main { flex: 1 1 auto; }
.note-item-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    justify-content: flex-end;
}
.workbench-form label { display: block; font-weight: 700; margin-bottom: 6px; }
.workbench-form input, .workbench-form textarea, .workbench-form select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c8d0d2;
    border-radius: 8px;
    padding: 10px;
}
.workbench-form .checkbox-row {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    margin: 6px 16px 6px 0;
}
.workbench-form .checkbox-row input[type="checkbox"] {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    width: auto;
}
.workbench-form .checkbox-row input[type="radio"] {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    width: auto;
}
.query-scope-options {
    border: 1px solid #d8e0e2;
    border-radius: 8px;
    margin: 0 0 10px;
    padding: 10px 12px;
}
.query-scope-options legend {
    color: #183f46;
    font-weight: 700;
    padding: 0 4px;
}
.query-source-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}
.scope-lookup-field[hidden] {
    display: none;
}
.query-options-disclosure {
    border: 1px solid #d8e0e2;
    border-radius: 8px;
    margin: 8px 0 10px;
    padding: 10px 12px;
}
.query-options-disclosure summary {
    color: #183f46;
    cursor: pointer;
    font-weight: 700;
}
.query-options-disclosure[open] summary {
    margin-bottom: 10px;
}
.regwatch-stat-row {
    justify-content: flex-start;
    margin-bottom: 14px;
    text-align: left;
}
.regwatch-filter-form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto;
}
.regwatch-filter-form p {
    margin: 0;
}
.regwatch-briefing-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 18px;
}
.regwatch-briefing-tile {
    background: #ffffff;
    border: 1px solid #d8e0e2;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    padding: 14px 16px;
}
.regwatch-briefing-tile span,
.regwatch-briefing-tile small {
    color: #68747a;
    display: block;
    font-size: 0.82rem;
}
.regwatch-briefing-tile strong {
    color: #183f46;
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.85rem;
    line-height: 1.15;
    margin: 4px 0;
}
.regwatch-control-panel {
    margin-bottom: 18px;
}
.regwatch-control-panel .query-panel-header {
    margin-bottom: 12px;
}
.regwatch-filter-disclosure summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
}
.regwatch-filter-disclosure summary::-webkit-details-marker {
    display: none;
}
.regwatch-filter-disclosure summary strong {
    color: #183f46;
    display: block;
    font-size: 1.05rem;
}
.regwatch-filter-disclosure .regwatch-filter-form {
    margin-top: 14px;
}
.regwatch-control-panel .regwatch-poll-all-form {
    border-top: 1px solid #edf0f1;
    margin-top: 16px;
    padding-top: 14px;
}
.regwatch-feed-panel {
    padding-bottom: 12px;
}
.regwatch-publication-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}
.regwatch-publication-card {
    background: #fbfcfc;
    border: 1px solid #dfe7e9;
    border-radius: 8px;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 15px 16px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.regwatch-publication-card:hover {
    border-color: #b8c8cc;
    box-shadow: 0 4px 12px rgba(16, 79, 85, 0.08);
}
.regwatch-publication-topline,
.regwatch-publication-footer {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    min-width: 0;
}
.regwatch-publication-card .compact-source-badges {
    flex: 1 1 auto;
    justify-content: flex-start;
    max-width: 100%;
    min-width: 0;
}
.regwatch-publication-date {
    color: #68747a;
    flex: 0 0 auto;
    font-size: 0.84rem;
    font-weight: 700;
}
.regwatch-publication-summary {
    line-height: 1.48;
    margin: 0 0 12px;
    max-width: 78ch;
    overflow-wrap: anywhere;
}
.regwatch-publication-footer {
    border-top: 1px solid #edf0f1;
    padding-top: 11px;
}
.regwatch-list-title {
    font-size: 1.08rem;
    line-height: 1.28;
    margin: 9px 0 7px;
}
.regwatch-list-title a {
    color: #183f46;
    text-decoration: none;
}
.regwatch-list-title a:hover {
    text-decoration: underline;
}
.regwatch-publication-item .note-card-header {
    align-items: flex-start;
}
.regwatch-publication-item .note-card-header > div:first-child,
.regwatch-source-item .note-card-header > div:first-child,
.regwatch-watchlist-item .note-card-header > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}
.regwatch-publication-item .compact-source-badges,
.regwatch-source-item .compact-source-badges,
.regwatch-watchlist-item .compact-source-badges {
    flex: 0 1 auto;
    justify-content: flex-start;
    max-width: none;
    width: 100%;
}
.regwatch-analysis-sections {
    display: grid;
    gap: 12px;
}
.regwatch-analysis-sections h3,
.regwatch-detail-layout h3 {
    color: #183f46;
    margin-bottom: 6px;
}
.regwatch-analysis-section {
    background: #fbfcfc;
    border: 1px solid #dce5e7;
    border-left: 3px solid #8aa1a7;
    border-radius: 3px;
    padding: 12px 14px;
}
.regwatch-analysis-section-primary {
    background: #ffffff;
    border-left-color: #704C5E;
}
.regwatch-analysis-section h3 {
    color: #183f46;
    font-size: 0.86rem;
    letter-spacing: 0;
    line-height: 1.25;
    margin: 0 0 8px;
}
.regwatch-analysis-body {
    color: #243f45;
    font-size: 0.94rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.regwatch-analysis-body p,
.regwatch-analysis-body ul,
.regwatch-analysis-body ol {
    margin: 0;
}
.regwatch-analysis-list {
    white-space: normal;
}
.regwatch-analysis-list br {
    display: block;
    margin-bottom: 5px;
}
.regwatch-analysis-body:empty {
    display: none;
}
.regwatch-watchlist-form,
.regwatch-inline-watchlist-form {
    border-top: 1px solid #edf0f1;
    margin-top: 14px;
    padding-top: 14px;
}
.regwatch-inline-watchlist-form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(260px, 1.6fr) auto;
}
.regwatch-inline-watchlist-form p {
    margin: 0;
}
.regwatch-watchlist-filters {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.5fr) auto;
}
.regwatch-watchlist-filters p {
    margin: 0;
}
.regwatch-poll-all-form {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.regwatch-poll-all-form p {
    margin: 0;
    max-width: 220px;
}
.regwatch-source-manager,
.regwatch-source-directory {
    border-color: #d5dee1;
}
.regwatch-catalog-list {
    border: 1px solid #dfe7e9;
    border-radius: 8px;
    margin-top: 14px;
    overflow: hidden;
}
.regwatch-catalog-row {
    align-items: center;
    background: #fbfcfc;
    border-bottom: 1px solid #e5ecee;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px 14px;
}
.regwatch-catalog-row:last-child {
    border-bottom: 0;
}
.regwatch-catalog-row.is-added {
    background: #f6f8f8;
}
.regwatch-catalog-main {
    min-width: 0;
}
.regwatch-catalog-title {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}
.regwatch-catalog-title h3 {
    color: #183f46;
    font-size: 0.98rem;
    margin: 0;
}
.regwatch-catalog-title .compact-source-badges {
    flex: 0 0 auto;
    width: auto;
}
.regwatch-catalog-row p {
    font-size: 0.9rem;
    line-height: 1.35;
    margin: 4px 0 0;
}
.regwatch-catalog-action {
    align-items: center;
    display: flex;
    justify-content: flex-end;
}
.regwatch-catalog-action .button {
    margin: 0;
}
.regwatch-custom-source {
    margin-top: 14px;
}
.regwatch-source-form {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
}
.regwatch-source-form p {
    margin: 0;
}
.regwatch-source-description-field,
.regwatch-source-form .form-action-row {
    grid-column: 1 / -1;
}
.source-chip.source-chip-success {
    background: #e3f5e7;
    border-color: #b7ddbf;
    color: #225c31;
}
.source-chip,
.score-pill,
.citation-chip,
.evidence-pill,
.graph-chip,
.relationship-predicate,
.relationship-view-toggle,
.relationship-view-toggle a,
.query-metric-strip span,
.metrics-row span,
.retrieved-chunk-meta span {
    border-radius: 3px;
}
.inline-action-form {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}
.regwatch-detail-actions {
    align-items: center;
    border-bottom: 1px solid #edf0f1;
    border-top: 1px solid #edf0f1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
    padding: 12px 0;
}
.regwatch-detail-actions .button {
    margin: 0;
}
.regwatch-tracking-panel {
    margin-bottom: 12px;
}
.source-chip.importance-high {
    background: #fde8e8;
    border-color: #f3b4b4;
    color: #8a1f1f;
}
.source-chip.importance-medium {
    background: #fff4d8;
    border-color: #e6c46a;
    color: #6f4f00;
}
.source-chip.importance-low {
    background: #e3f5e7;
    border-color: #b7ddbf;
    color: #225c31;
}
.workbench-form .form-action-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 10px;
}
.submit-ack {
    color: #37535a;
    font-size: 0.94rem;
    font-weight: 700;
}
.button[disabled] {
    cursor: wait;
    opacity: 0.72;
}
.workbench-form textarea.expandable-textarea {
    min-height: 12rem;
    resize: vertical;
}
.workbench-form textarea.note-body-textarea {
    line-height: 1.5;
}
.list-item {
    border-top: 1px solid #ececec;
    padding: 14px 0;
}
.list-item:first-of-type { border-top: 0; }
.muted-panel { background: #f8f9f9; border-style: dashed; }
.message-stack { margin-bottom: 18px; }
.message { border-radius: 8px; padding: 10px 12px; background: #eef3f4; margin-bottom: 8px; }
.message.warning { background: #fff4d8; }
.message.success { background: #e3f5e7; }
.document-query-results {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
}
.query-answer-panel {
    position: sticky;
    top: 18px;
}
.query-panel-header {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}
.query-panel-header > :first-child {
    flex: 1 1 auto;
    min-width: 0;
}
.query-panel-header h2 {
    margin-bottom: 8px;
}
.query-metric-strip,
.source-chip-row,
.citation-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.query-metric-strip {
    justify-content: flex-end;
    text-align: right;
}
.source-chip-row,
.citation-chip-row,
.metrics-row,
.evidence-pill-row {
    justify-content: flex-start;
    text-align: left;
}
.query-panel-header > .score-pill {
    flex: 0 0 auto;
    margin-left: auto;
}
.query-metric-strip span,
.score-pill,
.citation-chip,
.source-chip {
    background: #eef3f4;
    border: 1px solid #d8e0e2;
    border-radius: 8px;
    color: #183f46;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 6px 9px;
    text-decoration: none;
}
.citation-chip:hover,
.source-chip:hover {
    background: #183f46;
    color: #ffffff;
    text-decoration: none;
}
.source-chip span {
    color: inherit;
    font-size: 0.78rem;
    margin-left: 4px;
}
.query-summary {
    line-height: 1.55;
    margin-top: 8px;
}
.query-warning-panel {
    background: #fff4d8;
    border: 1px solid #e6c46a;
    border-radius: 8px;
    color: #4d3f18;
    margin: 12px 0;
    padding: 10px 12px;
}
.query-warning-panel p {
    margin: 4px 0 0;
}
.citation-chip-row {
    border-top: 1px solid #edf0f1;
    margin-top: 16px;
    padding-top: 14px;
}
.query-evidence-panel {
    max-height: calc(100vh - 36px);
    overflow: auto;
}
.retrieved-chunk-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}
.retrieved-chunk-card {
    border: 1px solid #e2e8ea;
    border-radius: 8px;
    padding: 12px;
}
.retrieved-chunk-card:target {
    border-color: #704C5E;
    box-shadow: 0 0 0 3px rgba(112, 76, 94, 0.12);
}
.retrieved-chunk-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.retrieved-chunk-meta span {
    color: #68747a;
    font-size: 0.86rem;
}
.retrieved-source-title {
    color: #183f46;
    display: inline-block;
    font-weight: 700;
    margin-bottom: 4px;
}
.retrieved-chunk-card p {
    margin-bottom: 0;
}
@media (max-width: 760px) {
    .workbench-hero { align-items: flex-start; flex-direction: column; }
    .board-grid, .workspace-primary-grid, .workspace-bottom-grid, .document-query-results { grid-template-columns: 1fr; }
    .regwatch-briefing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .regwatch-filter-form,
    .regwatch-inline-watchlist-form,
    .regwatch-watchlist-filters,
    .regwatch-source-form { grid-template-columns: 1fr; }
    .regwatch-catalog-row { grid-template-columns: 1fr; }
    .regwatch-catalog-action { justify-content: flex-start; }
    .regwatch-publication-topline,
    .regwatch-publication-footer { align-items: flex-start; flex-direction: column; }
    .regwatch-publication-card .compact-source-badges,
    .regwatch-publication-card .source-chip-row,
    .regwatch-publication-card .note-item-actions {
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }
    .regwatch-publication-card .source-chip,
    .regwatch-publication-card .button {
        max-width: 100%;
        overflow-wrap: anywhere;
        white-space: normal;
    }
    .query-answer-panel { position: static; }
    .query-evidence-panel { max-height: none; }
    .note-item { flex-direction: column; }
    .note-item-actions { justify-content: flex-start; }
}
@media (max-width: 520px) {
    .regwatch-briefing-grid { grid-template-columns: 1fr; }
}

/* Research workspace: notes-first workflow */
.workspace-hero {
    margin-bottom: 14px;
}

.workspace-tabs {
    align-items: center;
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.workspace-tab {
    background: #ffffff;
    border: 1px solid #d8e0e2;
    border-radius: 999px;
    color: #183f46;
    font-weight: 700;
    padding: 8px 14px;
    text-decoration: none;
    white-space: nowrap;
}

.workspace-tab:hover,
.workspace-tab.active {
    background: #183f46;
    border-color: #183f46;
    color: #ffffff;
    text-decoration: none;
}

.workspace-research-grid {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(520px, 1.55fr) minmax(320px, 0.85fr);
    margin-bottom: 18px;
}

.workspace-context-pane {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.workspace-support-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(520px, 1.55fr) minmax(320px, 0.85fr);
}

.notes-workspace-pane {
    min-height: 680px;
    min-width: 0;
}

.source-context-card {
    min-width: 0;
    position: sticky;
    top: 18px;
}

.workspace-section-header {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.workspace-section-header.compact {
    align-items: center;
    margin-bottom: 10px;
}

.workspace-section-header h2 {
    margin-bottom: 6px;
}

.section-intro {
    color: #68747a;
    margin: 0;
    max-width: 620px;
}

.note-composer {
    background: #f8faf9;
    border: 1px solid #e1e7e8;
    border-radius: 12px;
    margin-bottom: 18px;
    padding: 14px;
}

.note-composer summary {
    cursor: pointer;
    display: inline-block;
    list-style: none;
    margin-top: 0;
}

.note-composer summary::-webkit-details-marker {
    display: none;
}

.note-form-grid {
    margin-top: 14px;
}

.workbench-form .helptext {
    color: #68747a;
    display: block;
    font-size: 0.82rem;
    margin-top: 4px;
}

.research-note-list {
    display: grid;
    gap: 14px;
}

.note-card,
.evidence-item-card {
    background: #ffffff;
    border: 1px solid #e6ecee;
    border-radius: 12px;
    padding: 16px;
}

.note-card:first-of-type,
.evidence-item-card:first-of-type {
    border-top: 1px solid #e6ecee;
}

.note-card p,
.evidence-item-card p {
    color: #22343a;
    line-height: 1.55;
    margin-bottom: 12px;
}

.note-card-header {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.evidence-pill-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.evidence-pill {
    background: #eef3f4;
    border-radius: 8px;
    color: #183f46;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 5px 10px;
}

.evidence-pill.empty {
    background: #f5f2f4;
    color: #704C5E;
}

.context-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 16px;
}

.source-actions {
    align-items: center;
    margin-top: 10px;
}

.source-actions form {
    margin: 0;
}

.source-summary-preview {
    margin-top: 10px;
}

.source-summary-preview summary {
    cursor: pointer;
    font-weight: 700;
}

.source-link {
    color: #183f46;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.source-link:hover {
    color: #541840;
}

.evidence-list,
.evidence-item-card,
.source-summary-preview,
.source-chunk-notes,
.chunk-note {
    min-width: 0;
}

.compact-source-card {
    padding: 0;
}

.compact-source-card:first-of-type {
    border-top: 1px solid #e6ecee;
}

.compact-source-summary {
    align-items: flex-start;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
    padding: 14px;
}

.compact-source-summary::-webkit-details-marker {
    display: none;
}

.compact-source-summary::after {
    color: #704C5E;
    content: "Open";
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 700;
}

.compact-source-card[open] .compact-source-summary::after {
    content: "Close";
}

.compact-source-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.compact-source-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-source-badges {
    align-items: flex-start;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    max-width: 46%;
}

.compact-source-detail {
    border-top: 1px solid #e6ecee;
    padding: 0 14px 14px;
}

.compact-job-status {
    margin-top: 0;
}

.compact-source-card .source-summary-preview {
    background: #f8faf9;
    border: 1px solid #e1e7e8;
    border-radius: 10px;
    padding: 10px 12px;
}

.compact-source-card .source-actions {
    flex-wrap: wrap;
}

.evidence-item-card,
.source-summary-preview,
.source-chunk-notes,
.chunk-note,
.source-link {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.claim-review-card {
    background: #ffffff;
    border: 1px solid #dfe7e9;
    border-radius: 6px;
    display: grid;
    gap: 14px;
    padding: 16px;
}

.claim-review-queue-panel {
    background: #f8faf9;
    border: 1px solid #dfe7e9;
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(240px, 1fr) minmax(260px, 0.9fr);
    margin-bottom: 14px;
    padding: 14px;
}

.claim-review-queue-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.claim-review-queue-copy h2 {
    color: #183f46;
    font-size: 1rem;
    margin: 0;
}

.claim-review-queue-copy p {
    color: #68747a;
    font-size: 0.86rem;
    font-weight: 700;
    margin: 0;
}

.claim-review-queue-form {
    align-items: end;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(180px, 1fr) auto;
    min-width: 0;
}

.claim-review-queue-form label {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.claim-review-queue-form input {
    min-width: 0;
    width: 100%;
}

.claim-review-job-list {
    border-top: 1px solid #dfe7e9;
    display: grid;
    gap: 6px;
    grid-column: 1 / -1;
    padding-top: 10px;
}

.claim-review-job-row {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(120px, 1fr) repeat(4, minmax(80px, auto));
}

.claim-review-job-row span,
.claim-review-job-row strong {
    background: #ffffff;
    border: 1px solid #e6ecee;
    border-radius: 6px;
    color: #183f46;
    font-size: 0.78rem;
    padding: 5px 7px;
}

.claim-review-job-row .claim-review-job-error {
    background: #fff4e5;
    border-color: #f1d6a9;
    color: #704c1f;
    grid-column: 1 / -1;
}

.claim-review-header {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.claim-review-header > div {
    min-width: 0;
}

.claim-review-header strong {
    color: #183f46;
    display: block;
    line-height: 1.35;
}

.claim-review-reason {
    background: #fff4e5;
    border: 1px solid #f1d6a9;
    border-radius: 4px;
    color: #704c1f;
    display: inline-block;
    font-size: 0.82rem;
    margin: 6px 0 0;
    padding: 3px 7px;
}

.claim-review-form {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

.claim-review-section {
    border: 1px solid #edf1f2;
    border-radius: 6px;
    display: grid;
    gap: 10px;
    padding: 12px;
}

.claim-review-section-title {
    color: #183f46;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.claim-review-grid,
.claim-review-decision,
.predicate-proposal-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.4fr) minmax(150px, 0.8fr);
}

.claim-review-form label,
.predicate-proposal-grid label {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.claim-review-form input,
.claim-review-form select,
.claim-review-form textarea {
    min-width: 0;
    width: 100%;
}

.claim-review-form textarea {
    resize: vertical;
}

.claim-review-form .span-2,
.predicate-proposal-grid .span-2 {
    grid-column: span 2;
}

.claim-review-form .span-3,
.predicate-proposal-grid .span-3 {
    grid-column: span 3;
}

.claim-review-form .span-all,
.predicate-proposal-grid .span-all {
    grid-column: 1 / -1;
}

.predicate-proposal {
    background: #f8fbfb;
    border-color: #c9dcdd;
}

.predicate-proposal summary {
    cursor: pointer;
    font-weight: 700;
}

.predicate-proposal-grid {
    margin-top: 12px;
}

.checkbox-line {
    align-items: center;
    display: flex !important;
    gap: 8px !important;
}

.checkbox-line input {
    width: auto;
}

.claim-review-actions {
    align-items: center;
    border-top: 1px solid #edf1f2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 12px;
}

@media (max-width: 900px) {
    .claim-review-queue-panel,
    .claim-review-queue-form,
    .claim-review-job-row {
        grid-template-columns: 1fr;
    }

    .claim-review-header {
        display: grid;
    }

    .claim-review-grid,
    .claim-review-decision,
    .predicate-proposal-grid {
        grid-template-columns: 1fr;
    }

    .claim-review-form .span-2,
    .claim-review-form .span-3,
    .claim-review-form .span-all,
    .predicate-proposal-grid .span-2,
    .predicate-proposal-grid .span-3,
    .predicate-proposal-grid .span-all {
        grid-column: 1;
    }

    .claim-review-actions {
        justify-content: flex-start;
    }
}

.button.primary-action {
    background: #704C5E;
    border-color: #704C5E;
    border-radius: 3px;
    color: #ffffff;
}

.button.primary-action:hover {
    background: #5d3d4e;
    border-color: #5d3d4e;
}

.button.ghost-button {
    background: #ffffff;
    border-color: #c8d0d2;
    border-radius: 3px;
    color: #183f46;
}

.button.ghost-button:hover {
    background: #eef3f4;
    border-color: #183f46;
    color: #183f46;
}

.button.text-danger,
.button.subtle-danger {
    background: transparent;
    border-color: #e1c7c7;
    color: #7A2E2E;
}

.button.text-danger:hover,
.button.subtle-danger:hover {
    background: #f8eeee;
    border-color: #7A2E2E;
    color: #7A2E2E;
}

.empty-state {
    background: #f8faf9;
    border: 1px dashed #d8e0e2;
    border-radius: 12px;
    padding: 16px;
}

.relationships-card {
    align-self: start;
}

.relationship-explorer {
    margin-top: 18px;
}

.entity-focus-form {
    align-items: end;
    background: #f8faf9;
    border: 1px solid #e1e7e8;
    border-radius: 14px;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto auto;
    margin: 14px 0 18px;
    padding: 14px;
}

.entity-focus-form label {
    color: #516168;
    display: grid;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.entity-focus-form input,
.entity-focus-form select {
    background: #ffffff;
    border: 1px solid #c8d0d2;
    border-radius: 9px;
    box-sizing: border-box;
    color: #183f46;
    min-width: 0;
    padding: 10px;
    width: 100%;
}

.focused-entity-banner {
    align-items: flex-start;
    background: linear-gradient(135deg, #183f46, #315f66);
    border-radius: 14px;
    color: #ffffff;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 18px;
}

.focused-entity-banner .eyebrow,
.focused-entity-banner .muted,
.focused-entity-banner p {
    color: #dcebed;
}

.focused-entity-banner h3 {
    color: #ffffff;
    font-size: 1.45rem;
    margin: 0 0 4px;
}

.relationship-flow-panel {
    align-items: stretch;
    background:
        linear-gradient(90deg, rgba(238, 243, 244, 0.6), rgba(255, 255, 255, 0.8) 48%, rgba(238, 243, 244, 0.6)),
        #f8faf9;
    border: 1px solid #e1e7e8;
    border-radius: 16px;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.72fr) minmax(220px, 1fr);
    margin-bottom: 16px;
    padding: 18px;
}

.flow-column {
    display: grid;
    align-content: start;
    gap: 10px;
}

.flow-column h3 {
    color: #704C5E;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    margin: 0;
    text-transform: uppercase;
}

.relation-edge-card {
    background: #ffffff;
    border: 1px solid #d8e0e2;
    border-radius: 14px;
    color: #183f46;
    cursor: pointer;
    display: grid;
    gap: 5px;
    font-weight: 800;
    padding: 11px 12px;
    text-align: left;
    width: 100%;
}

.relation-edge-card:hover {
    border-color: #183f46;
    box-shadow: 0 8px 18px rgba(24, 63, 70, 0.12);
    color: #541840;
}

.relation-edge-card span {
    color: #704C5E;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.relation-edge-card strong {
    overflow-wrap: anywhere;
}

.relation-edge-card.status-needs_review {
    border-color: #ead7ab;
}

.relation-edge-card.status-rejected {
    border-color: #e1c7c7;
    opacity: 0.88;
}

.flow-center {
    align-items: center;
    display: grid;
    justify-items: center;
    min-width: 0;
}

.focus-hub {
    align-items: center;
    background: #183f46;
    border: 8px solid #dcebed;
    border-radius: 999px;
    color: #ffffff;
    display: grid;
    justify-items: center;
    min-height: 190px;
    padding: 24px;
    text-align: center;
    width: 100%;
}

.focus-hub span,
.focus-hub small {
    color: #dcebed;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.focus-hub strong {
    color: #ffffff;
    font-size: clamp(1.2rem, 2.3vw, 2rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.relationship-action-panel {
    align-items: center;
    background: #fffaf1;
    border-bottom: 1px solid #ead7ab;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 12px 18px;
}

.relationship-action-panel p {
    color: #33474d;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.35;
    margin: 0;
    overflow-wrap: anywhere;
}

.relationship-action-buttons {
    display: grid;
    gap: 8px;
    grid-template-columns: max-content max-content;
}

.relationship-action-buttons .button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    margin: 0;
    min-height: 36px;
    padding: 8px 10px;
    white-space: nowrap;
}

.entity-picker-empty {
    display: grid;
    gap: 14px;
}

.entity-picker-empty h3 {
    color: #183f46;
    margin-bottom: 0;
}

.top-entity-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.top-entity-card {
    background: #ffffff;
    border: 1px solid #e1e7e8;
    border-radius: 12px;
    color: #183f46;
    display: grid;
    gap: 5px;
    padding: 12px;
    text-decoration: none;
}

.top-entity-card:hover {
    border-color: #183f46;
    color: #541840;
    text-decoration: none;
}

.top-entity-card span {
    color: #68747a;
    font-size: 0.86rem;
}

.focused-triples {
    margin-top: 12px;
}

.graph-search-bar {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    margin: 12px 0;
}

.graph-search-bar input,
.graph-advanced-filter select {
    background: #ffffff;
    border: 1px solid #c8d0d2;
    border-radius: 8px;
    box-sizing: border-box;
    color: #183f46;
    min-width: 0;
    padding: 8px 9px;
    width: 100%;
}

.graph-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 14px;
}

.graph-chip {
    background: #eef3f4;
    border: 1px solid #d8e0e2;
    border-radius: 999px;
    color: #183f46;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 10px;
    text-decoration: none;
}

.graph-chip:hover,
.graph-chip.active {
    background: #183f46;
    border-color: #183f46;
    color: #ffffff;
    text-decoration: none;
}

.entity-graph-list,
.relationship-triple-list {
    display: grid;
    gap: 10px;
}

.entity-graph-row {
    background: #ffffff;
    border: 1px solid #e6ecee;
    border-radius: 12px;
    display: grid;
    gap: 8px;
    padding: 12px;
}

.entity-graph-main {
    color: #183f46;
    display: grid;
    gap: 3px;
    text-decoration: none;
}

.entity-graph-main:hover {
    color: #541840;
    text-decoration: none;
}

.entity-graph-main span,
.entity-graph-counts {
    color: #68747a;
    font-size: 0.86rem;
}

.entity-graph-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.entity-graph-row p {
    color: #33474d;
    margin: 0;
}

.compact-link {
    flex: 0 0 auto;
    font-size: 0.82rem;
}

.graph-active-filter {
    background: #f5f2f4;
    border: 1px solid #e1d5dc;
    border-radius: 10px;
    color: #704C5E;
    margin: 0 0 12px;
    padding: 8px 10px;
}

.graph-more-filters {
    background: #f8faf9;
    border: 1px solid #e1e7e8;
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 10px;
}

.graph-more-filters summary {
    cursor: pointer;
    font-weight: 700;
}

.graph-advanced-filter {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    margin-top: 10px;
}

.graph-advanced-filter label {
    color: #516168;
    display: grid;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 5px;
    text-transform: uppercase;
}

.relationship-triple {
    background: #ffffff;
    border: 1px solid #dfe8ea;
    border-radius: 12px;
    padding: 12px;
}

.relationship-triple.status-needs_review {
    border-color: #ead7ab;
}

.relationship-triple.status-rejected {
    border-color: #e1c7c7;
    opacity: 0.88;
}

.triple-line {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.triple-line a {
    color: #183f46;
    font-weight: 800;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.triple-line a:hover {
    color: #541840;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.triple-line span {
    background: #183f46;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 6px 10px;
    text-align: center;
}

.triple-meta {
    color: #68747a;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.82rem;
    gap: 8px;
    margin-top: 8px;
}

.triple-meta span {
    background: #f2f5f5;
    border-radius: 999px;
    padding: 4px 8px;
}

.triple-evidence {
    margin-top: 8px;
}

.triple-evidence summary {
    color: #704C5E;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 700;
}

.triple-evidence blockquote {
    border-left: 3px solid #9bb9bd;
    color: #33474d;
    margin: 10px 0;
    padding: 2px 0 2px 12px;
}

.triple-evidence p {
    color: #33474d;
    line-height: 1.45;
    margin: 8px 0;
}

.relationship-control-bar {
    align-items: end;
    background: #f8faf9;
    border: 1px solid #e1e7e8;
    border-radius: 16px;
    display: grid;
    gap: 14px;
    grid-template-areas: "search browse actions";
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 260px) 184px;
    margin: 14px 0 18px;
    padding: 14px;
    width: 100%;
}

.relationship-control-bar label {
    color: #516168;
    display: grid;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 6px;
    letter-spacing: 0.04em;
    min-width: 0;
    text-transform: uppercase;
}

.relationship-control-field {
    max-width: 100%;
}

.relationship-control-search {
    grid-area: search;
}

.relationship-control-browse {
    grid-area: browse;
}

.relationship-control-actions {
    align-items: end;
    display: grid;
    gap: 8px;
    grid-area: actions;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
}

.relationship-control,
.relationship-control-button {
    box-sizing: border-box;
    min-height: 42px;
}

.relationship-control {
    background: #ffffff;
    border: 1px solid #c8d0d2;
    border-radius: 10px;
    color: #183f46;
    font-size: 0.95rem;
    min-width: 0;
    overflow: hidden;
    padding: 10px 11px;
    text-overflow: ellipsis;
    width: 100%;
    max-width: 100%;
}

.relationship-control-button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    margin: 0;
    padding: 10px 12px;
    width: 100%;
    white-space: nowrap;
}

.relationship-display-pane {
    background: #ffffff;
    border: 1px solid #d8e0e2;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(24, 63, 70, 0.08);
    display: grid;
    gap: 0;
    overflow: hidden;
    position: relative;
}

.relationship-display-header {
    align-items: center;
    background: linear-gradient(135deg, #f7faf9, #eef4f5);
    border-bottom: 1px solid #dfe8ea;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 18px;
}

.relationship-display-header h3 {
    color: #183f46;
    font-size: 1.35rem;
    margin: 0 0 4px;
    overflow-wrap: anywhere;
}

.relationship-display-header p {
    color: #516168;
    margin: 0;
}

.relationship-display-body {
    background: #ffffff;
    padding: 18px;
}

.relationship-toolbar {
    align-items: flex-end;
    display: grid;
    gap: 10px;
    justify-items: end;
}

.relationship-view-toggle {
    background: #ffffff;
    border: 1px solid #c8d0d2;
    border-radius: 999px;
    display: inline-flex;
    gap: 4px;
    padding: 4px;
}

.relationship-view-toggle a {
    border-radius: 999px;
    color: #183f46;
    font-size: 0.84rem;
    font-weight: 800;
    padding: 7px 12px;
    text-decoration: none;
}

.relationship-view-toggle a.active,
.relationship-view-toggle a:hover {
    background: #183f46;
    color: #ffffff;
    text-decoration: none;
}

.relationship-status-filter {
    justify-content: flex-end;
    margin: 0;
}

.relationship-table-wrap {
    border: 1px solid #dfe8ea;
    border-radius: 16px;
    overflow-x: auto;
}

.relationship-table {
    background: #ffffff;
    border-collapse: collapse;
    min-width: 780px;
    width: 100%;
}

.relationship-table th,
.relationship-table td {
    border-bottom: 1px solid #edf1f2;
    color: #33474d;
    padding: 13px 14px;
    text-align: left;
    vertical-align: top;
}

.relationship-table thead th {
    background: #f3f7f7;
    color: #183f46;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.relationship-subject-cell {
    background: #fbfdfd;
    border-right: 1px solid #edf1f2;
    min-width: 180px;
    width: 24%;
}

.relationship-subject-cell a,
.relationship-object-link {
    color: #183f46;
    font-weight: 850;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.relationship-subject-cell a:hover,
.relationship-object-link:hover {
    color: #541840;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.relationship-predicate {
    background: #eaf1f2;
    border-radius: 999px;
    color: #183f46;
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 850;
    padding: 6px 10px;
}

.relationship-table tr.status-needs_review .relationship-predicate {
    background: #f3ead4;
    color: #6b501b;
}

.relationship-table tr.status-rejected .relationship-predicate {
    background: #f2dddd;
    color: #7A2E2E;
}

.compact-evidence {
    margin: 0;
}

.relationship-graph-layout {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
}

.relationship-graph-canvas {
    background:
        radial-gradient(circle at top left, rgba(155, 185, 189, 0.22), transparent 32%),
        linear-gradient(135deg, #f7faf9, #ffffff);
    border: 1px solid #dfe8ea;
    border-radius: 16px;
    min-height: 560px;
    overflow: hidden;
    position: relative;
}

.relationship-pyvis-frame {
    background: #ffffff;
    border: 1px solid #dfe8ea;
    border-radius: 16px;
    display: block;
    height: 620px;
    width: 100%;
}

.relationship-graph-svg {
    display: block;
    height: 100%;
    min-height: 560px;
    width: 100%;
}

.relationship-graph-edge {
    cursor: pointer;
    stroke: #8baeb4;
    stroke-linecap: round;
    stroke-width: 2.2;
}

.relationship-graph-edge.status-needs_review {
    stroke: #c99b3b;
}

.relationship-graph-edge.status-rejected {
    stroke: #b56b6b;
    stroke-dasharray: 7 5;
}

.relationship-graph-edge.active,
.relationship-graph-edge:hover {
    stroke: #541840;
    stroke-width: 4;
}

.relationship-graph-edge-label {
    cursor: pointer;
    fill: #33474d;
    font-size: 12px;
    font-weight: 800;
    paint-order: stroke;
    stroke: #ffffff;
    stroke-linejoin: round;
    stroke-width: 5px;
}

.relationship-graph-node {
    cursor: pointer;
}

.relationship-graph-node circle {
    fill: #ffffff;
    stroke: #183f46;
    stroke-width: 2.5;
}

.relationship-graph-node.focus circle {
    fill: #183f46;
    stroke: #9bb9bd;
    stroke-width: 5;
}

.relationship-graph-node text {
    fill: #183f46;
    font-size: 12px;
    font-weight: 850;
    paint-order: stroke;
    stroke: #ffffff;
    stroke-linejoin: round;
    stroke-width: 4px;
}

.relationship-graph-node.focus text {
    fill: #183f46;
}

#relationship-arrow path {
    fill: #8baeb4;
}

.relationship-graph-detail {
    background: #ffffff;
    border: 1px solid #dfe8ea;
    border-radius: 16px;
    color: #33474d;
    min-height: 220px;
    padding: 16px;
}

.relationship-graph-detail h3 {
    color: #183f46;
    margin: 2px 0 8px;
    overflow-wrap: anywhere;
}

.relationship-graph-detail blockquote {
    border-left: 3px solid #9bb9bd;
    color: #33474d;
    margin: 12px 0;
    padding: 2px 0 2px 12px;
}

@media (max-width: 900px) {
    .workspace-research-grid,
    .workspace-support-grid {
        grid-template-columns: 1fr;
    }

    .source-context-card {
        position: static;
    }

    .notes-workspace-pane {
        min-height: auto;
    }

    .entity-focus-form,
    .relationship-control-bar,
    .relationship-flow-panel,
    .relationship-graph-layout,
    .graph-search-bar,
    .graph-advanced-filter,
    .triple-line {
        grid-template-columns: 1fr;
    }

    .relationship-control-bar {
        grid-template-areas:
            "search"
            "browse"
            "actions";
    }

    .relationship-control-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .focused-entity-banner {
        flex-direction: column;
    }

    .relationship-display-header {
        align-items: stretch;
        flex-direction: column;
    }

    .relationship-action-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .relationship-action-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .relationship-toolbar {
        justify-items: start;
    }

    .relationship-status-filter {
        justify-content: flex-start;
    }

    .relationship-table-wrap {
        border: 0;
        overflow-x: visible;
    }

    .relationship-table,
    .relationship-table thead,
    .relationship-table tbody,
    .relationship-table tr,
    .relationship-table th,
    .relationship-table td {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .relationship-table thead {
        display: none;
    }

    .relationship-table tr {
        background: #ffffff;
        border: 1px solid #dfe8ea;
        border-radius: 8px;
        box-sizing: border-box;
        margin-bottom: 12px;
        overflow: hidden;
    }

    .relationship-table th,
    .relationship-table td {
        border-bottom: 1px solid #edf1f2;
        box-sizing: border-box;
        padding: 10px 12px;
    }

    .relationship-table tr > :last-child {
        border-bottom: 0;
    }

    .relationship-subject-cell {
        border-right: 0;
        min-width: 0;
        width: 100%;
    }

    .relationship-subject-cell::before,
    .relationship-table td::before {
        color: #68747a;
        display: block;
        font-size: 0.72rem;
        font-weight: 900;
        letter-spacing: 0.06em;
        margin-bottom: 4px;
        text-transform: uppercase;
    }

    .relationship-subject-cell::before {
        content: "Entity";
    }

    .relationship-table td:nth-of-type(1)::before {
        content: "Relation";
    }

    .relationship-table td:nth-of-type(2)::before {
        content: "Object";
    }

    .relationship-table td:nth-of-type(3)::before {
        content: "Evidence";
    }

    .triple-line span {
        justify-self: start;
    }
}

@media (max-width: 560px) {
    .workspace-section-header,
    .note-card-header,
    .context-actions {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }


    .compact-source-summary {
        flex-direction: column;
    }

    .compact-source-badges {
        justify-content: flex-start;
        max-width: 100%;
    }

    .note-item-actions {
        justify-content: flex-start;
    }
}

.source-chip,
.score-pill,
.citation-chip,
.evidence-pill,
.graph-chip,
.relationship-predicate,
.relationship-view-toggle,
.relationship-view-toggle a,
.query-metric-strip span,
.metrics-row span,
.retrieved-chunk-meta span {
    border-radius: 3px;
}

.button,
.compact-button,
.discreet-button,
.logout-link {
    border-radius: 3px;
}

.workbench-shell .button {
    margin-top: 0;
}

.button,
button.button,
input.button,
.compact-button,
.discreet-button,
.logout-link {
    border-radius: 3px;
    box-shadow: none;
}

.button:focus-visible,
button.button:focus-visible,
input.button:focus-visible,
.compact-button:focus-visible,
.discreet-button:focus-visible,
.logout-link:focus-visible {
    outline: 2px solid rgba(112, 76, 94, 0.35);
    outline-offset: 2px;
}

.button:disabled,
button.button:disabled,
input.button:disabled,
.button[disabled],
.button[aria-disabled="true"],
.compact-button:disabled,
.compact-button[disabled],
.discreet-button:disabled,
.discreet-button[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

.button.primary-action:disabled,
.button.primary-action[disabled],
.button.secondary:disabled,
.button.secondary[disabled],
.button.ghost-button:disabled,
.button.ghost-button[disabled],
.button.text-danger:disabled,
.button.text-danger[disabled] {
    border-radius: 3px;
    transform: none;
}
