/* ========================================
   SHARED STYLES - style.css
   PardonPedia
   ======================================== */

/* ========================================
   DC.JS CHART OVERRIDES
   ======================================== */

.dc-chart g.row text {
    fill: #333;
    font-size: 10px;
    font-weight: 300;
}

.dc-chart g.row text.count-label {
    fill: #333;
    font-size: 10px;
    font-weight: 400;
    pointer-events: none;
}

.dc-chart svg {
    overflow: visible;
}

/* ========================================
   LOADING OVERLAY
   ======================================== */

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.2s ease;
}

.loading-hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-visible {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 16px solid #edf2f7;
    border-top: 16px solid var(--primary-blue, #1a365d);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   CLEAR/RESET BUTTON
   ======================================== */

.clear-button {
    background-color: transparent;
    border: none;
    padding: 4px 12px;
    margin-right: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-blue, #2b6cb0);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clear-button:hover {
    text-decoration: underline;
}

/* ========================================
   DOWNLOAD CSV BUTTON
   ======================================== */

#name-search-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

#name-search-wrap {
    position: relative;
    width: 281px;
}

#name-search-input {
    width: 100%;
    padding: 5px 28px 5px 10px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

#name-search-input:focus {
    border-color: #888;
}

#name-search-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    line-height: 1;
}

#name-search-icon:hover {
    color: #333;
}

#name-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
}

.name-search-item {
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.name-search-item:hover,
.name-search-item.active {
    background-color: #eef4ff;
}

.name-match {
    background: none;
    font-weight: 700;
    color: #1a365d;
}

.download-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: transparent;
    border: 1px solid var(--accent-blue, #2b6cb0);
    border-radius: 3px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-blue, #2b6cb0);
    white-space: nowrap;
    flex-shrink: 0;
}

.download-button svg {
    vertical-align: middle;
}

.download-button:hover {
    background-color: var(--accent-blue, #2b6cb0);
    color: white;
}

/* ========================================
   FILTER BOXES (Active Filters Display)
   ======================================== */

.filter-boxes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.filter-box {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 5px;
    background-color: #fff;
}

.filter-box-title {
    font-size: 9px;
    margin-bottom: 1px;
    color: var(--primary-blue, #1a365d);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-box-values {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.filter-value-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-value-badge:hover {
    background-color: #ffe0e0;
    border-color: #c88;
}

.filter-value-close {
    color: #888;
    font-size: 10px;
    margin-left: 1px;
}

.filter-value-badge:hover .filter-value-close {
    color: #c00;
}

/* ========================================
   CHART UI COMPONENTS
   ======================================== */

.chart-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-blue, #1a365d);
    margin-bottom: 0px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-title-text {
    /* inherits from .chart-title */
}

.chart-title-count {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted, #718096);
    text-transform: none;
    letter-spacing: 0;
    min-width: 30px;
    text-align: right;
}

.chart-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.chart-search-container {
    position: relative;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.chart-search {
    width: 100%;
    padding: 6px 28px 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.chart-search:focus {
    outline: none;
    border-color: var(--accent-blue, #2b6cb0);
}

.chart-search::placeholder {
    color: #999;
}

.chart-search-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 18px;
    pointer-events: none;
}

.chart-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    display: none;
}

.chart-search-clear:hover {
    color: #333;
}

.chart-search:not(:placeholder-shown)~.chart-search-icon,
.chart-search-container.has-selection .chart-search-icon {
    display: none;
}

.chart-search:not(:placeholder-shown)~.chart-search-clear,
.chart-search-container.has-selection .chart-search-clear {
    display: block;
}

.chart-search.has-selection {
    border: 2px solid var(--primary-blue, #1a365d);
    background-color: #fff;
}

.chart-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.chart-search-item {
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}

.chart-search-item:last-child {
    border-bottom: none;
}

.chart-search-item:hover,
.chart-search-item.selected {
    background-color: rgba(43, 108, 176, 0.1);
}

.chart-search-item .item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 10px;
}

.chart-search-item .item-count {
    color: #666;
    font-size: 12px;
    flex-shrink: 0;
}

/* ========================================
   PARDON RECORD CARD STYLES
   ======================================== */

.record {
    display: flex;
    flex-direction: column;
    position: relative;
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
    padding: 12px 0;
    transition: background-color 0.15s ease;
    border-radius: 4px;
}

.record:hover {
    background-color: rgba(255, 255, 255, 0.7);
    padding-left: 6px;
}

.record-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 4px 2px 4px;
}

.record-header-tags {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.record-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark, #1a202c);
}

.record-date {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted, #718096);
}

.record-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 4px 4px 4px;
}

.record-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.record-tag-clemency {
    background-color: #ebf4ff;
    color: #2b6cb0;
    border: 1px solid #bee3f8;
}

.record-tag-president {
    background-color: #f0fff4;
    color: #276749;
    border: 1px solid #c6f6d5;
}

.record-tag-occupation {
    background-color: #faf5ff;
    color: #553c9a;
    border: 1px solid #e9d8fd;
}

.record-tag-relationship {
    background-color: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.record-tag-topic {
    background-color: #e6fffa;
    color: #234e52;
    border: 1px solid #b2f5ea;
}

#pardon-detail {
    transition: opacity 80ms ease;
}

#pardon-detail.fading {
    opacity: 0;
}

.pardon-detail-inner {
    width: 100%;
}

.pardon-detail-main {
    min-width: 0;
}

.detail-content-split {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 0;
    border: 1px solid var(--border-color, #cbd5e0);
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

.detail-content-split--single {
    grid-template-columns: minmax(0, 1fr);
}

.detail-column {
    padding: 18px 20px;
}

.detail-column-background {
    display: flex;
    flex-direction: column;
}

.detail-column + .detail-column {
    border-left: 1px solid var(--border-color, #cbd5e0);
}

.detail-column-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 17px;
    font-weight: 550;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5a5f64;
}

.detail-column-heading-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    background: #efeee9;
    color: #797872;
}

.detail-primary-link {
    flex-shrink: 0;
    border: 1px solid #dfd9d9;
    border-radius: 8px;
    background: #efe9ea;
    color: #83413d;
    padding: 7px 12px;
    font-size: 14px;
    font-weight: 700;
}

.detail-primary-link:hover {
    text-decoration: none;
    background: #e8dddd;
}

.detail-date-sep {
    margin: 0 6px;
}

.detail-background-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.detail-background-thumb {
    width: 129px;
    height: 129px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #c9c6bf;
    background: #ecece9;
    flex-shrink: 0;
}

.detail-background-copy {
    min-width: 0;
}

.detail-background-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark, #1a202c);
    margin-bottom: 4px;
}

.detail-background-summary {
    font-size: 15px;
    line-height: 1.45;
    color: #2f3238;
}

.detail-background-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #315f9f;
}

.detail-background-link:hover {
    text-decoration: underline;
}

.detail-clemency-document-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.detail-clemency-doc-preview .record-warrant-canvas {
    border-radius: 6px;
}

.detail-clemency-document-copy {
    min-width: 0;
    padding-top: 3px;
}

.detail-clemency-document-meta {
    font-size: 14px;
    color: #6a6d71;
    margin-bottom: 2px;
}

.detail-clemency-document-source {
    font-weight: 600;
}

.detail-clemency-document-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #61666f;
    word-break: break-word;
    letter-spacing: 0.02em;
}

.detail-clemency-document-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #315f9f;
}

.detail-clemency-document-link:hover {
    text-decoration: underline;
}

.detail-clemency-doc-preview .record-warrant-canvas {
    background: #f7f3ea;
    border: 1px solid #c7c0b0;
    box-shadow: 0 1px 3px rgba(45, 39, 24, 0.14);
}

.detail-clemency-page-controls {
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 0;
}

.detail-clemency-document .warrant-nav-btn {
    border: none;
    padding: 0;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    color: #56606e;
    background: none;
}

.detail-clemency-document .warrant-nav-btn:hover:not(:disabled) {
    background: none;
    color: #2f4666;
    text-decoration: underline;
}

.detail-clemency-document .warrant-page-label {
    min-width: 0;
    font-size: 13px;
    color: #525b69;
}

@media (max-width: 1100px) {
    .detail-content-split {
        grid-template-columns: minmax(0, 1fr);
    }

    .detail-column + .detail-column {
        border-left: none;
        border-top: 1px solid var(--border-color, #cbd5e0);
    }
}

.record-warrant-link {
    display: block;
    line-height: 0;
}

.warrant-loading {
    width: 256px;
    height: 331px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
}

.warrant-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-top-color: #999;
    border-radius: 50%;
    animation: warrant-spin 0.7s linear infinite;
}

@keyframes warrant-spin {
    to { transform: rotate(360deg); }
}

.record-warrant-canvas {
    display: block;
    border: 1px solid #ccc;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: box-shadow 0.15s, opacity 0.15s;
}

.record-warrant-link:hover .record-warrant-canvas {
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    opacity: 0.88;
}

.warrant-page-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.warrant-nav-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-dark, #1a202c);
    line-height: 1.4;
}

.warrant-nav-btn:hover:not(:disabled) {
    background: #f0f0f0;
}

.warrant-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.warrant-page-label {
    font-size: 12px;
    color: var(--text-muted, #666);
    min-width: 40px;
    text-align: center;
}

.record-offense {
    margin: 2px 4px 2px 4px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-dark, #1a202c);
    line-height: 1.4;
}

.record-sentenced {
    margin: 1px 4px 2px 4px;
    font-size: 13px;
    font-weight: 400;
    color: #666;
    line-height: 1.4;
}

.record-count {
    font-size: 22px;
    font-weight: 600;
}

.page-givebacks .record-count {
    font-size: 18px;
}

.record-filters {
    font-size: 18px;
    font-weight: 500;
    opacity: 0.7;
}

/* Court documents table (pardon detail panel) */
.detail-court-docs {
    margin-top: 10px;
}

.detail-court-docs-scroll {
    overflow-x: auto;
    margin-top: 4px;
    -webkit-overflow-scrolling: touch;
}

.detail-court-docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dark, #1a202c);
}

.detail-court-docs-table td {
    padding: 6px 8px 6px 0;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color, #cbd5e0);
}

.detail-court-docs-table tbody tr:last-child td {
    border-bottom: none;
}

.detail-court-docs-table td:nth-child(3) {
    min-width: 120px;
}

.detail-court-docs-table a {
    color: var(--accent-blue, #0066cc);
    font-weight: 500;
    text-decoration: none;
}

.detail-court-docs-table a:hover {
    text-decoration: underline;
}

/* ========================================
   REOFFENDERS TABLE
   ======================================== */

.re-col-subhead {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted, #718096);
    margin-left: 4px;
}

.reoffenders-table thead th {
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    color: #2a3240;
    background: #f5f6f4;
    border-bottom: 2px solid var(--border-color);
    padding: 10px 14px;
    vertical-align: bottom;
    position: sticky;
    top: 0;
    z-index: 4;
}

.reoffenders-table td {
    border-bottom: 1px solid #e9ecef;
    padding: 16px 14px;
    vertical-align: top;
    line-height: 1.45;
}

.reoffenders-table tbody tr:last-child td {
    border-bottom: none;
}

/* Strong separator between person groups */
.reoffenders-table tbody tr.re-group-start td {
    border-top: 2px solid #b0bec5;
    background-color: #fff;
}

.reoffenders-table tbody tr.re-group-start:first-child td {
    border-top: none;
}

/* Within-group rows (same person, multiple stories) */
.reoffenders-table tbody tr:not(.re-group-start) td {
    background-color: #f7f9fb;
}

/* Column widths */
.re-col-name   { width: 160px; }
.re-col-source { width: auto; }
.re-col-crime  { width: 40%; }

.re-cell-crime {
    font-size: 13px;
    color: #4a5568;
}

.re-crime-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.re-crime-block + .re-crime-block {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.re-crime-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9aa5b4;
}

.re-crime-value {
    font-size: 13px;
    color: #374151;
    line-height: 1.45;
}

.re-cell-name {
    font-weight: 700;
    color: #202733;
    font-size: 16px;
    vertical-align: top;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.re-name-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.re-jan6-pill {
    display: inline-block;
    align-self: flex-start;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1a365d;
    background: #bee3f8;
    border-radius: 999px;
    padding: 2px 8px;
    line-height: 1.6;
    white-space: nowrap;
}

.re-crime-jan6-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.re-name-text {
    /* name link sits below the pill */
}

.re-pardon-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: #aab4c4;
    text-underline-offset: 2px;
}

.re-pardon-link:hover {
    color: var(--accent-blue, #0066cc);
    text-decoration-color: var(--accent-blue, #0066cc);
}

.re-cell-charges {
    font-size: 14px;
    color: #333;
}

.re-source-cell-wrap {
    position: relative;
}

.re-source-cell-wrap--has-pill {
    padding-top: 24px;
}

.re-after-pill {
    display: inline-block;
    position: absolute;
    top: 0;
    right: 0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 2px 8px;
    line-height: 1.6;
    white-space: nowrap;
}

.re-after-yes {
    color: #1a365d;
    background: #bee3f8;
}

.re-after-no {
    color: #374151;
    background: #e5e7eb;
}

/* Source card */
.re-source-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.re-source-card--has-thumb {
    display: grid;
    grid-template-columns: 144px 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
    align-items: start;
}

.re-source-card--has-thumb .re-source-thumb-wrap {
    grid-column: 1;
    grid-row: 1;
}

.re-source-card--has-thumb .re-source-card-body {
    grid-column: 2;
    grid-row: 1;
}

.re-source-card--has-thumb .re-source-excerpt {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0;
}

.re-source-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.re-source-thumb-wrap {
    flex-shrink: 0;
}

.re-source-thumb {
    display: block;
    width: 144px;
    height: 97px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color, #cbd5e0);
    background: #edf2f7;
}

.re-source-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent-blue, #0066cc);
    line-height: 1.4;
}

a.re-source-title {
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 2px;
    transition: text-decoration-color 0.1s;
}

a.re-source-title:hover {
    text-decoration-color: var(--accent-blue, #0066cc);
}

.re-source-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted, #718096);
    line-height: 1.4;
}

.re-source-sep {
    color: #c0c8d4;
    font-size: 12px;
}

.re-source-publisher {
    font-weight: 600;
    color: #4a5568;
}

.re-source-date {
    white-space: nowrap;
}

.re-source-excerpt {
    margin: 0;
    padding: 6px 10px;
    border-left: 3px solid #cbd5e0;
    font-size: 13px;
    color: #4a5568;
    line-height: 1.5;
    font-style: italic;
}

.re-placeholder {
    color: #b0bac6;
    font-style: italic;
}

/* ========================================
   MOBILE OVERRIDES (≤768px)
   ======================================== */

@media (max-width: 768px) {
    /* Allow detail content to flow naturally */
    #pardon-detail {
        overflow-y: visible;
        height: auto;
    }

    /* Warrant canvas: cap width so it doesn't overflow narrow screens */
    .record-warrant-canvas,
    .warrant-loading {
        max-width: 100%;
        height: auto;
    }

    /* Background thumbnail: smaller on mobile */
    .detail-background-thumb {
        width: 80px;
        height: 80px;
    }

    /* Record count sizing */
    .record-count {
        font-size: 17px;
    }

    /* Filter badges wrap nicely */
    .filter-boxes-container {
        gap: 4px;
    }

    /* Givebacks: ensure table panel scrolls horizontally */
    #givebacks-table-panel {
        overflow: visible;
    }

    .givebacks-table {
        min-width: 560px;
    }

    /* ---- Results header: wrap to two lines ---- */
    #results-header-top {
        flex-wrap: wrap;
        gap: 6px;
    }

    .results-header-source {
        white-space: normal;
    }

    /* ---- Reoffenders: card layout ---- */

    /* Convert table elements to block so rows stack vertically */
    .reoffenders-table,
    .reoffenders-table tbody,
    .reoffenders-table tr,
    .reoffenders-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    /* Hide column headers — labels come from .re-crime-label inside cells */
    .reoffenders-table thead {
        display: none;
    }

    /* Reset min-width so no horizontal scroll */
    .reoffenders-table {
        min-width: 0;
    }

    /* Remove scroll constraint on the wrapper */
    .reoffenders-table-scroll {
        overflow-x: visible;
    }

    /* Base cell reset */
    .reoffenders-table td {
        border: none;
        border-bottom: 1px solid #e9ecef;
        padding: 12px 14px;
    }

    .reoffenders-table td:last-child {
        border-bottom: none;
    }

    /* Person group separator */
    .reoffenders-table tr.re-group-start {
        margin-top: 12px;
        border-top: 2px solid #b0bec5;
        background: none;
    }

    .reoffenders-table tr.re-group-start:first-child {
        margin-top: 0;
        border-top: none;
    }

    /* Name cell: subtle banner background */
    .reoffenders-table .re-cell-name {
        background: #f0f4f8;
        border-bottom: 1px solid #d0d8e4 !important;
        font-size: 15px;
    }

    /* Rowspan is ignored in block mode — name cell only shows on first row,
       subsequent rows of the same person still render without it, which is fine */

    /* Show thumbnail on mobile (card layout has room for it) */
    .re-source-thumb-wrap {
        display: block;
    }

    .re-source-thumb {
        width: 120px;
        height: 80px;
    }

    .re-source-card--has-thumb {
        grid-template-columns: 120px 1fr;
    }

    /* Crime cell: tinted so it reads as a secondary section */
    .reoffenders-table .re-cell-crime {
        background: #f8fafc;
    }
}
