.state-page {
    max-width: 1200px;
    margin: 1.5em auto;
    padding: 0 1em;
    font-family: system-ui, -apple-system, sans-serif;
}

.state-page-header {
    margin-bottom: 1.5em;
}

.state-page-title {
    color: #00004d;
    font-size: 2.4em;
    margin-bottom: 0.25em;
}

.state-page-summary {
    color: #555;
    font-size: 1.05em;
    margin: 0 0 0.5em;
}

.state-page-intro {
    color: #444;
    line-height: 1.55;
    margin-bottom: 1em;
}

.state-page-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-top: 0.75em;
}

.count-pill {
    background: #f0f3fa;
    color: #00004d;
    padding: 0.4em 0.85em;
    border-radius: 999px;
    font-size: 0.85em;
    border: 1px solid #d8dff0;
}

.count-pill em {
    font-style: normal;
    font-weight: 700;
    margin-left: 0.3em;
}

.state-page-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em;
    border-bottom: 2px solid #e2e2ea;
    margin: 1em 0 1.5em;
}

.state-tab {
    background: transparent;
    color: #4b5563;
    border: 0;
    padding: 0.65em 1.1em;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.state-tab:hover {
    color: #00004d;
}

.state-tab.active {
    color: #00004d;
    border-bottom-color: #00004d;
    font-weight: 600;
}

.state-section {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 1.25em;
    margin-bottom: 1em;
}

.state-section[hidden] {
    display: none;
}

.state-section h2 {
    color: #00004d;
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 1em;
}

.section-content .loading,
.section-content .empty {
    color: #777;
    font-style: italic;
    padding: 0.5em 0;
}

.section-content .error {
    color: #b91c1c;
    background: #fff1f1;
    padding: 0.6em 1em;
    border-radius: 6px;
}

.section-search {
    width: 100%;
    max-width: 400px;
    padding: 0.5em 0.75em;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95em;
    margin-bottom: 1em;
    box-sizing: border-box;
}

.full-page-link {
    color: #00004d;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.full-page-link:hover {
    text-decoration: underline;
}

.result-count {
    color: #6b7280;
    font-size: 0.9em;
    margin: 0 0 0.5em;
}

/* Facility cards (merged programs + inspections) */
.facility-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6em;
    margin-bottom: 1em;
}

.facility-toolbar .section-search {
    margin-bottom: 0;
    flex: 1;
    min-width: 220px;
}

.facility-group {
    margin-bottom: 1.5em;
}

.facility-group-heading {
    color: #00004d;
    font-size: 1.05em;
    margin: 0 0 0.6em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #e2e2ea;
}

.facility-group-heading .count {
    color: #6b7280;
    font-weight: 400;
    font-size: 0.92em;
}

.facility-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75em;
}

.facility-card {
    background: #fff;
    border: 1px solid #d8dff0;
    border-left: 4px solid #00004d;
    border-radius: 6px;
    padding: 0.85em 1em;
    transition: box-shadow 0.15s;
}

.facility-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.facility-card-header {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
    margin-bottom: 0.3em;
}

.facility-card-name {
    color: #00004d;
    font-size: 1em;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.facility-card-address {
    color: #4b5563;
    font-size: 0.85em;
    line-height: 1.35;
    margin-bottom: 0.25em;
}

.facility-card-operator {
    color: #6b7280;
    font-size: 0.8em;
    font-style: italic;
    margin-bottom: 0.4em;
}

.facility-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 0.85em;
    font-size: 0.78em;
    color: #6b7280;
    margin-top: 0.4em;
    padding-top: 0.4em;
    border-top: 1px dashed #eef0f4;
}

.facility-card-address-missing {
    color: #9ca3af;
    font-style: italic;
}

.facility-card-address-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.facility-card-address-list li {
    padding-left: 1em;
    position: relative;
    line-height: 1.4;
}

.facility-card-address-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #6b7280;
}

.facility-card-address-list li + li {
    margin-top: 0.2em;
}

.facility-card-years {
    color: #4b5563;
    font-size: 0.85em;
    margin-top: 0.2em;
    font-weight: 500;
}

.facility-card-capacity {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em 1em;
    color: #4b5563;
    font-size: 0.85em;
    margin-top: 0.25em;
}

.facility-card-capacity strong {
    color: #00004d;
}

/* Details panel rows */
.detail-row {
    color: #374151;
    font-size: 0.88em;
    margin-bottom: 0.35em;
    line-height: 1.45;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-row strong {
    color: #00004d;
    margin-right: 0.3em;
}

.detail-row.detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em 0.75em;
    margin-top: 0.5em;
    padding-top: 0.5em;
    border-top: 1px dashed #eef0f4;
}

/* Per-facility news list inside expand panel */
.facility-news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65em;
}

.facility-news-item {
    padding: 0.5em 0.6em;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.88em;
}

.facility-news-title {
    display: block;
    color: #00004d;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.35;
}

.facility-news-title:hover {
    text-decoration: underline;
}

.facility-news-meta {
    color: #6b7280;
    font-size: 0.85em;
    margin-top: 0.2em;
}

.facility-news-summary {
    margin: 0.35em 0 0;
    color: #374151;
    line-height: 1.45;
    font-size: 0.92em;
}

.stat-violation {
    color: #b91c1c;
    font-weight: 600;
}

/* Expand toggles */
.facility-card.is-expandable {
    cursor: default;
}

.facility-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    margin-top: 0.6em;
    padding-top: 0.5em;
    border-top: 1px dashed #eef0f4;
}

.facility-expand-btn {
    background: #f0f3fa;
    color: #00004d;
    border: 1px solid #d8dff0;
    border-radius: 4px;
    padding: 0.32em 0.65em;
    cursor: pointer;
    font-size: 0.78em;
    font-weight: 600;
}

.facility-expand-btn:hover {
    background: #e3e9f7;
}

.facility-expand-btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

.facility-card-panels {
    margin-top: 0.5em;
}

.facility-panel {
    margin-top: 0.4em;
    padding: 0.6em 0.7em;
    background: #fafbfd;
    border: 1px solid #e8ecf3;
    border-radius: 5px;
}

/* Inspection records — match the visual language of /xx-reports/ pages */
.inspection-record-list {
    display: flex;
    flex-direction: column;
    gap: 0.65em;
}

.inspection-box {
    border-radius: 4px;
    border: 1px solid #dddddd;
    overflow: hidden;
}

.inspection-box-clean {
    background: #ffffff;
}

.inspection-box-violation {
    background: #ff6600;
    border-color: #d35400;
}

.inspection-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75em;
    padding: 0.7em 0.9em;
    cursor: pointer;
    list-style: none;
    transition: background-color 0.15s;
    font-size: 0.92em;
    overflow: hidden;
}

.inspection-header::-webkit-details-marker {
    display: none;
}

.inspection-header::before {
    content: '▸';
    color: inherit;
    font-size: 0.85em;
    transition: transform 0.15s;
}

.inspection-box[open] > .inspection-header::before {
    transform: rotate(90deg);
}

.inspection-box-clean .inspection-header {
    color: #1f2937;
    border-bottom: 1px solid transparent;
}

.inspection-box-clean[open] .inspection-header {
    border-bottom-color: #dddddd;
    background: #f8fafc;
}

.inspection-box-violation .inspection-header {
    color: #ffffff;
    font-weight: 700;
}

.inspection-box-violation[open] .inspection-header {
    background: #ed5800;
}

.inspection-summary-date {
    font-weight: 700;
    flex: 0 0 auto;
    white-space: nowrap;
}

.inspection-summary-type {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inspection-summary-findings {
    flex: 0 0 auto;
    font-size: 0.8em;
    font-weight: 700;
    padding: 0.18em 0.6em;
    border-radius: 3px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.95);
    color: #b91c1c;
}

.inspection-box-clean .inspection-summary-findings {
    background: #d1fae5;
    color: #065f46;
}

.inspection-content {
    padding: 0.85em 1em;
    background: #ffffff;
    color: #1f2937;
}

.inspection-details-block {
    background: #f9fafc;
    border: 1px solid #e6e9ee;
    border-radius: 4px;
    padding: 0.7em 0.85em;
    margin-bottom: 0.75em;
    font-size: 0.9em;
    line-height: 1.55;
}

.inspection-details-block strong {
    color: #00004d;
}

.inspection-details-block a {
    color: #1e40af;
    text-decoration: none;
}

.inspection-details-block a:hover {
    text-decoration: underline;
}

.inspection-summary-text {
    color: #374151;
    line-height: 1.55;
    margin-bottom: 0.75em;
    white-space: pre-wrap;
}

.violation-box {
    border: 1px solid #e6e9ee;
    border-radius: 4px;
    background: #fff;
    margin-top: 0.5em;
}

.violation-box[open] {
    background: #fff;
}

.deficiency-header {
    cursor: pointer;
    list-style: none;
    padding: 0.55em 0.85em;
    background: #fff5ec;
    color: #9a3412;
    font-weight: 600;
    font-size: 0.9em;
    border-radius: 4px 4px 0 0;
}

.deficiency-header::-webkit-details-marker {
    display: none;
}

.deficiency-header::before {
    content: '▸ ';
    transition: transform 0.15s;
    display: inline-block;
}

.violation-box[open] .deficiency-header::before {
    transform: rotate(90deg);
}

.deficiency-content {
    padding: 0.7em 0.9em;
    border-top: 1px solid #e6e9ee;
}

.finding-item {
    margin-bottom: 0.85em;
    padding-bottom: 0.65em;
    border-bottom: 1px dashed #eef0f4;
    font-size: 0.9em;
    line-height: 1.5;
}

.finding-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.finding-item strong {
    color: #00004d;
    display: inline-block;
    margin-right: 0.4em;
}

.finding-item p {
    margin: 0.2em 0 0;
    color: #374151;
    white-space: pre-wrap;
}

.finding-evidence {
    margin-top: 0.3em;
    color: #4b5563;
    font-size: 0.92em;
}

.finding-evidence em {
    color: #00004d;
    font-style: italic;
    margin-right: 0.3em;
}

.narrative-row {
    margin-bottom: 0.65em;
    font-size: 0.9em;
    line-height: 1.55;
}

.narrative-row:last-child {
    margin-bottom: 0;
}

.narrative-row strong {
    color: #00004d;
    display: inline-block;
    margin-right: 0.4em;
}

.narrative-row p {
    margin: 0.2em 0 0;
    color: #374151;
    white-space: pre-wrap;
}

/* Closed group: dampen the expand affordances slightly */
.facility-group-closed .facility-expand-btn {
    background: #eaeefa;
    color: #4a5b85;
    border-color: #cfd6e7;
}

.facility-group-closed .facility-panel {
    background: #f3f6fb;
    border-color: #d9e0ed;
}

/* Closed group: lighter blue palette */
.facility-group-closed .facility-group-heading {
    color: #6b8cc7;
    border-bottom-color: #d3dbeb;
}

.facility-group-closed .facility-card {
    background: #f6f8fc;
    border-color: #d3dbeb;
    border-left-color: #8fa8d4;
    opacity: 0.92;
}

.facility-group-closed .facility-card-name {
    color: #4a5b85;
}

.facility-group-closed .facility-card-address,
.facility-group-closed .facility-card-operator {
    color: #6b7c9d;
}

/* Other lists */
.news-list,
.lawsuit-list,
.legislation-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news-item,
.lawsuit-item,
.legislation-item {
    padding: 0.85em 0;
    border-bottom: 1px solid #f0f2f6;
}

.news-item:last-child,
.lawsuit-item:last-child,
.legislation-item:last-child {
    border-bottom: 0;
}

.news-title,
.lawsuit-name,
.legislation-name {
    color: #00004d;
    font-weight: 600;
    font-size: 1.05em;
}

.news-meta,
.lawsuit-meta,
.legislation-meta {
    color: #6b7280;
    font-size: 0.85em;
    margin-top: 0.2em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7em;
}

/* News */
.news-item-header {
    display: flex;
    align-items: baseline;
    gap: 0.6em;
    flex-wrap: wrap;
}

.news-type-badge {
    background: #ddeafe;
    color: #1e3a8a;
    padding: 0.15em 0.55em;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.news-type-badge.type-lawsuit { background: #fee2e2; color: #991b1b; }
.news-type-badge.type-arrest { background: #fef3c7; color: #92400e; }
.news-type-badge.type-closure { background: #fce7f3; color: #831843; }
.news-type-badge.type-expose { background: #ede9fe; color: #5b21b6; }
.news-type-badge.type-event { background: #dcfce7; color: #166534; }

.news-title {
    color: #00004d;
    text-decoration: none;
}

.news-title:hover {
    text-decoration: underline;
}

.news-summary,
.lawsuit-summary,
.legislation-summary {
    margin: 0.4em 0 0;
    color: #374151;
    font-size: 0.92em;
    line-height: 1.5;
}

/* Lawsuits & Legislation */
.lawsuit-header,
.legislation-header {
    display: flex;
    align-items: center;
    gap: 0.6em;
    flex-wrap: wrap;
}

.lawsuit-header h3,
.legislation-header h3 {
    margin: 0;
    font-size: 1.05em;
}

.bill-number {
    background: #eef0f4;
    color: #1f2937;
    padding: 0.15em 0.5em;
    border-radius: 4px;
    font-size: 0.85em;
    margin-right: 0.4em;
}

.status-pill,
.position-pill {
    padding: 0.15em 0.6em;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: capitalize;
    background: #f3f4f6;
    color: #374151;
}

.status-pill.status-filed { background: #dbeafe; color: #1e40af; }
.status-pill.status-settled { background: #d1fae5; color: #065f46; }
.status-pill.status-dismissed { background: #fee2e2; color: #991b1b; }
.status-pill.status-ruling { background: #ede9fe; color: #5b21b6; }
.status-pill.status-appeal { background: #fef3c7; color: #92400e; }
.status-pill.status-passed_house,
.status-pill.status-passed_senate { background: #cffafe; color: #155e75; }
.status-pill.status-signed,
.status-pill.status-enacted { background: #d1fae5; color: #065f46; }
.status-pill.status-vetoed,
.status-pill.status-dead { background: #fee2e2; color: #991b1b; }

.position-pill.position-support { background: #d1fae5; color: #065f46; }
.position-pill.position-oppose { background: #fee2e2; color: #991b1b; }
.position-pill.position-watch { background: #fef3c7; color: #92400e; }

.lawsuit-facilities,
.legislation-sponsors {
    color: #4b5563;
    font-size: 0.9em;
    margin-top: 0.3em;
}

.lawsuit-sources a,
.legislation-links a {
    color: #1e40af;
    margin-right: 0.6em;
    font-size: 0.88em;
}

.legislation-links {
    margin-top: 0.4em;
}


/* Document toggle / grid */
.docs-block {
    margin-top: 0.6em;
}

.docs-toggle {
    background: #f0f3fa;
    color: #00004d;
    border: 1px solid #d8dff0;
    border-radius: 4px;
    padding: 0.35em 0.7em;
    cursor: pointer;
    font-size: 0.85em;
}

.docs-toggle:hover {
    background: #e3e9f7;
}

.docs-target {
    margin-top: 0.5em;
}

.docs-empty {
    color: #6b7280;
    font-style: italic;
    font-size: 0.9em;
}

.state-doc-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6em;
}

.state-doc-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4em;
    padding: 0.6em;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    text-decoration: none;
    color: #1f2937;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.state-doc-item a:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #00004d;
}

.state-doc-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.state-doc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100px;
    background: #eef0f4;
    border-radius: 4px;
    color: #00004d;
    font-weight: 700;
    font-size: 1.1em;
}

.state-doc-title {
    font-size: 0.82em;
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
}

/* Submit news button */
.news-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6em;
    align-items: center;
    margin-bottom: 1em;
}

.news-toolbar .section-search {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.submit-news-btn {
    display: inline-block;
    background: #00004d;
    color: #fff;
    padding: 0.5em 1em;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92em;
    white-space: nowrap;
}

.submit-news-btn:hover {
    background: #1a1a66;
    color: #fff;
}
