/* FILE: css/study_detail.css */

.page-wrap {
    margin: 20px;
}

.back-link {
    color: #337ab7;
    text-decoration: none;
}

.study-title {
    margin-top: 15px;
    margin-bottom: 5px;
    color: #333;
}

.study-meta {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.source-link {
    color: #337ab7;
    font-weight: bold;
    text-decoration: none;
}

.source-link:hover {
    text-decoration: underline;
}

.summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0 20px 0;
}

.summary-card {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 4px solid #337ab7;
    border-radius: 3px;
    padding: 12px 16px;
    min-width: 140px;
}

.summary-card .number {
    font-size: 22px;
    font-weight: bold;
    color: #333;
}

.summary-card .label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

.case-subtitle {
    color: #555;
    margin: 4px 0 12px 0;
    line-height: 1.5;
}

.case-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 4px 18px;
    margin-bottom: 14px;
}

.compact-summary {
    gap: 8px;
    margin: 14px 0 18px 0;
}

.compact-summary .summary-card {
    min-width: 110px;
    padding: 9px 12px;
}

.compact-summary .summary-card .number {
    font-size: 18px;
}

.compact-summary .summary-card .label {
    font-size: 11px;
}

.entity-note {
    color: #777;
    font-size: 12px;
    margin: -4px 0 12px 0;
}

.entity-note code {
    background: #f4f4f4;
    border: 1px solid #ddd;
    padding: 1px 4px;
    font-family: monospace;
}

.long-text {
    max-width: 780px;
    white-space: normal;
}

.text-block {
    background: #fafafa;
    border: 1px solid #e2e2e2;
    padding: 10px 12px;
    line-height: 1.55;
    margin-top: 6px;
}

.tab-container {
    margin-top: 20px;
    border: 1px solid #ccc;
    background: #fff;
}

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    background-color: #f1f1f1;
    border-bottom: 1px solid #ccc;
}

.tab-nav button {
    background-color: inherit;
    border: none;
    border-top: 3px solid transparent;
    border-right: 1px solid #ddd;
    outline: none;
    cursor: pointer;
    padding: 10px 13px;
    font-size: 13px;
    font-weight: bold;
    color: #555;
    box-sizing: border-box;
    line-height: 1.25;
    white-space: nowrap;
}

.tab-nav button:hover {
    background-color: #ddd;
}

.tab-nav button.active {
    background-color: #fff;
    border-top-color: #337ab7;
    color: #337ab7;
}

.tab-content {
    display: none;
    padding: 20px;
    line-height: 1.6;
}

.tab-content h4 {
    margin-top: 0;
    color: #337ab7;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th,
.data-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background-color: #f9f9f9;
}

.muted-small {
    font-size: 12px;
    color: #777;
}

.file-ref {
    color: #555;
    word-break: break-word;
}

.empty-state {
    background: #fafafa;
    border: 1px dashed #ccc;
    padding: 14px;
    color: #555;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    background: #eef5fb;
    color: #337ab7;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.note-box {
    background: #fffdf0;
    border: 1px solid #eadb8f;
    padding: 12px 14px;
    margin: 12px 0;
}

.file-ref {
    color: #555;
    word-break: break-word;
}

.id-code {
    font-family: monospace;
    background: #f4f4f4;
    border: 1px solid #ddd;
    padding: 1px 4px;
    white-space: nowrap;
}

.kv-list {
    display: grid;
    grid-template-columns: minmax(160px, 220px) 1fr;
    gap: 0;
    border: 1px solid #ddd;
    margin-top: 8px;
}

.kv-row {
    display: contents;
}

.kv-label {
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    padding: 7px 9px;
    font-weight: bold;
    color: #555;
}

.kv-value {
    border-bottom: 1px solid #ddd;
    padding: 7px 9px;
}

.kv-row:last-child .kv-label,
.kv-row:last-child .kv-value {
    border-bottom: none;
}

.result-section {
    margin: 18px 0 26px 0;
}

.result-section h5 {
    font-size: 16px;
    color: #333;
    background: #f3f6f8;
    border: 1px solid #d8e1e8;
    border-left: 4px solid #337ab7;
    padding: 9px 12px;
    margin: 0 0 10px 0;
}

.result-card-list {
    display: grid;
    gap: 12px;
}

.result-card {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    padding: 12px 14px;
}

.result-card-muted {
    background: #fbfbfb;
    border-color: #e3e3e3;
}

.result-card-title {
    font-size: 15px;
    font-weight: bold;
    color: #222;
    margin-bottom: 5px;
}

.result-badges {
    margin: 4px 0 7px 0;
}

.result-badge {
    display: inline-block;
    background: #eef5fb;
    border: 1px solid #c9dceb;
    color: #315f84;
    border-radius: 3px;
    padding: 2px 6px;
    margin: 2px 3px 2px 0;
    font-size: 12px;
    font-weight: bold;
}

.muted-badge {
    background: #f5f5f5;
    border-color: #ddd;
    color: #666;
}

.positive-badge {
    background: #eef9ef;
    border-color: #b8dfbd;
    color: #2d6b34;
}

.negative-badge {
    background: #f7f7f7;
    border-color: #ddd;
    color: #666;
}

.result-context-line {
    color: #555;
    margin: 6px 0;
}

.result-note {
    background: #fafafa;
    border: 1px solid #e2e2e2;
    padding: 9px 11px;
    margin: 8px 0;
    line-height: 1.55;
}

.result-meta-line {
    color: #666;
    font-size: 12px;
    margin-top: 8px;
}

.result-meta-line span {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 3px;
}

.sea-details {
    margin-top: 9px;
    font-size: 13px;
}

.sea-details summary,
.no-finding-details summary {
    cursor: pointer;
    color: #337ab7;
    font-weight: bold;
}

.compact-detail-table {
    margin-top: 8px;
}

.compact-detail-table th {
    width: 180px;
}

.no-finding-details {
    margin-top: 12px;
    background: #fcfcfc;
    border: 1px dashed #ccc;
    padding: 10px 12px;
}

.no-finding-details .result-card-list {
    margin-top: 10px;
}

.result-card .id-code {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.document-card-list {
    display: grid;
    gap: 14px;
    margin-top: 12px;
}

.document-card {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    padding: 14px;
}

.document-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.document-title {
    font-size: 16px;
    font-weight: bold;
    color: #222;
}

.document-subtitle {
    color: #666;
    font-size: 13px;
    margin-top: 3px;
}

.document-id-block {
    text-align: right;
    flex-shrink: 0;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.document-section h5 {
    margin: 0 0 6px 0;
    color: #337ab7;
    font-size: 13px;
    border-bottom: 1px solid #eee;
    padding-bottom: 3px;
}

.doc-meta-line {
    margin-top: 5px;
}

.mini-kv div {
    margin-bottom: 4px;
}

.analysis-card-list {
    display: grid;
    gap: 16px;
    margin-top: 12px;
}

.analysis-card {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    padding: 15px;
}

.analysis-card-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.analysis-title {
    font-size: 17px;
    font-weight: bold;
    color: #222;
}

.analysis-subtitle {
    margin-top: 4px;
}

.analysis-section {
    margin: 12px 0;
}

.analysis-section h5 {
    margin: 0 0 7px 0;
    color: #337ab7;
    font-size: 13px;
    border-bottom: 1px solid #eee;
    padding-bottom: 3px;
}

.analysis-input-tags {
    line-height: 1.9;
}

.analysis-comment {
    background: #fafafa;
    border: 1px solid #e2e2e2;
    padding: 12px 14px;
    line-height: 1.65;
    white-space: normal;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.overview-highlight {
    background: #f8fbff;
    border: 1px solid #c8dff2;
    border-left: 5px solid #337ab7;
    padding: 14px 16px;
    margin: 0 0 18px 0;
    border-radius: 3px;
}

.overview-highlight-title {
    font-size: 17px;
    font-weight: bold;
    color: #222;
    margin-bottom: 4px;
}

.overview-highlight-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.overview-highlight-body {
    background: #fff;
    border: 1px solid #e2edf7;
    padding: 12px 14px;
    line-height: 1.65;
}

.overview-full-analysis {
    margin-top: 10px;
}

.overview-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(300px, 0.9fr);
    gap: 16px;
    align-items: start;
}

.overview-panel {
    min-width: 0;
}

.overview-panel h5 {
    margin: 0 0 8px 0;
    color: #337ab7;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

@media (max-width: 900px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

.case-metadata-list {
    display: grid;
    gap: 16px;
    margin-top: 12px;
}

.case-metadata-card {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    padding: 15px;
}

.case-metadata-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.case-metadata-title {
    font-size: 17px;
    font-weight: bold;
    color: #222;
}

.case-metadata-subtitle {
    margin-top: 4px;
    color: #666;
    font-size: 13px;
}

.case-metadata-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(300px, 1.1fr);
    gap: 16px;
    align-items: start;
}

.case-metadata-section {
    margin: 12px 0;
}

.case-metadata-section h5 {
    margin: 0 0 7px 0;
    color: #337ab7;
    font-size: 13px;
    border-bottom: 1px solid #eee;
    padding-bottom: 3px;
}

.clinical-history-block {
    background: #fafafa;
    border: 1px solid #e2e2e2;
    padding: 12px 14px;
    line-height: 1.65;
}

.group-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    background: #fafafa;
    border: 1px solid #e2e2e2;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.group-composition {
    margin-top: 10px;
}

@media (max-width: 900px) {
    .case-metadata-grid {
        grid-template-columns: 1fr;
    }
}

.inline-ellipsis {
    display: inline;
}

.inline-expand {
    display: inline;
}

.inline-expand summary {
    display: inline;
    cursor: pointer;
    color: #337ab7;
    font-weight: bold;
    margin-left: 4px;
    list-style: none;
}

.inline-expand summary::-webkit-details-marker {
    display: none;
}

.inline-expand summary:hover {
    text-decoration: underline;
}

.inline-expand .show-less-label {
    display: none;
}

.inline-expand[open] .show-more-label {
    display: none;
}

.inline-expand[open] .show-less-label {
    display: inline;
}

.inline-expanded-text {
    display: inline;
}

.inline-toggle-button {
    background: none;
    border: none;
    padding: 0;
    margin-left: 4px;
    color: #337ab7;
    font-weight: bold;
    cursor: pointer;
    font: inherit;
}

.inline-toggle-button:hover {
    text-decoration: underline;
}

.overview-analysis-remainder {
    display: inline;
}