/* ── The Dirt Dashboard ─────────────────────────────── */

:root {
    --primary: #2c5f8a;
    --primary-light: #5b8fb9;
    --primary-dark: #1a3d5c;
    --accent: #3498db;
    --danger: #e74c3c;
    --danger-bg: #fdeaea;
    --warning: #f39c12;
    --warning-bg: #fef5e7;
    --success: #27ae60;
    --success-bg: #e8f8f0;
    --info: #7f8c8d;
    --info-bg: #f0f1f2;
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --bg-sidebar: #1e2a38;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --text-inverse: #ecf0f1;
    --border: #dce1e8;
    --border-light: #eef1f5;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-sm: 4px;
    --sidebar-width: 220px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-inverse);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.version {
    font-size: 11px;
    opacity: 0.5;
    font-family: var(--font-mono);
}

.sidebar-tag {
    font-size: 11px;
    opacity: 0.65;
    margin-top: 2px;
}

.nav-links {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-links li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.07);
}

.nav-count {
    margin-left: auto;
    min-width: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.nav-links li.active a {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-left-color: var(--accent);
}

.nav-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.sidebar-stats {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.mini-stat {
    text-align: center;
}

.mini-stat-link {
    color: inherit;
    text-decoration: none;
    border-radius: 12px;
    padding: 6px 4px;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.mini-stat-link:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-1px);
}

.mini-stat-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.mini-stat-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    opacity: 0.5;
    letter-spacing: 0.5px;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ── Main Content ────────────────────────────────────────── */

.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    max-width: 1400px;
}

/* ── Page Header ─────────────────────────────────────────── */

.page-header {
    margin-bottom: 24px;
}

.page-header-split {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-subtitle {
    color: var(--text-light);
    margin-top: 4px;
    font-size: 13px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.parcel-count {
    color: var(--text-light);
    font-size: 13px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

/* ── Stats Grid ──────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-grid-sm {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-card-danger { border-left-color: var(--danger); }
.stat-card-warn { border-left-color: var(--warning); }

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ── Filter Bar ──────────────────────────────────────────── */

.filter-bar {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.filter-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 120px;
}

.filter-group label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    font-weight: 600;
}

.filter-group input,
.filter-group select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
    background: #fff;
    color: var(--text);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44,95,138,0.1);
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-danger {
    background: rgba(161, 56, 46, 0.94);
    color: #fff;
}

.btn-danger:hover {
    background: #7f281f;
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-light);
    padding: 2px 6px;
    line-height: 1;
}
.btn-icon:hover { color: var(--danger); }
.btn-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-light);
    line-height: 1;
}

/* ── Charts ──────────────────────────────────────────────── */

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.chart-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.chart-card-wide {
    grid-column: 1 / -1;
}

/* ── Data Table ──────────────────────────────────────────── */

.table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    margin-bottom: 24px;
}

.table-container h3 {
    padding: 16px 20px 0;
    font-size: 14px;
    font-weight: 600;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: var(--bg);
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(44,95,138,0.03);
}

.data-table-sm { font-size: 12px; }
.data-table-sm td, .data-table-sm th { padding: 6px 10px; }

.num { text-align: right; font-family: var(--font-mono); font-size: 12px; }
.col-check { width: 36px; text-align: center; }
.col-nickname { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-owner { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-location { max-width: 260px; }
.col-concern { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-light); }

.cell-subtle {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.parcel-link {
    color: var(--primary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
}
.parcel-link:hover { text-decoration: underline; }

.col-owner {
    max-width: 220px;
}

.col-location {
    min-width: 220px;
}

.col-concern {
    max-width: 290px;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ── Risk Badge ──────────────────────────────────────────── */

.risk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 24px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #fff;
    padding: 0 8px;
}

.risk-badge.risk-critical { background: var(--danger); }
.risk-badge.risk-warning { background: var(--warning); }
.risk-badge.risk-low { background: var(--success); }

.completion-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 28px;
    border-radius: 14px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.completion-complete {
    background: var(--success-bg);
    color: var(--success);
}

.completion-in-progress {
    background: var(--warning-bg);
    color: var(--warning);
}

.completion-thin {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ── Flag Counts ─────────────────────────────────────────── */

.flag-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    padding: 0 5px;
    margin-right: 3px;
}

.flag-count.flag-critical { background: var(--danger); }
.flag-count.flag-warning { background: var(--warning); }
.flag-count.flag-info { background: var(--info); }

.note-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    padding: 0 5px;
}

/* ── Flags List ──────────────────────────────────────────── */

.flags-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flag-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.flag-item.flag-critical { background: var(--danger-bg); border-left: 3px solid var(--danger); }
.flag-item.flag-warning { background: var(--warning-bg); border-left: 3px solid var(--warning); }
.flag-item.flag-info { background: var(--info-bg); border-left: 3px solid var(--info); }

.flag-severity {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.flag-category {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    white-space: nowrap;
}

.flag-message { flex: 1; }

.flag-source {
    font-size: 11px;
    color: var(--text-light);
    font-style: italic;
}

.flag-parcel {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.severity-group { margin-bottom: 20px; }
.severity-group h4 {
    font-size: 13px;
    margin-bottom: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}
.severity-critical h4 { background: var(--danger-bg); color: var(--danger); }
.severity-warning h4 { background: var(--warning-bg); color: var(--warning); }
.severity-info h4 { background: var(--info-bg); color: var(--info); }

.risk-detail-section { margin-top: 32px; }
.risk-detail-section > h3 { font-size: 16px; margin-bottom: 16px; }

/* ── Tabs ────────────────────────────────────────────────── */

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    padding: 10px 18px;
    border: none;
    background: none;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.15s;
}

.tab:hover { color: var(--text); }
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* ── Detail Grid ─────────────────────────────────────────── */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.detail-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.detail-section h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading-row h3 {
    margin-bottom: 0;
}

.section-note {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

.detail-section-wide {
    grid-column: span 2;
}

.detail-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    gap: 12px;
}

.detail-row.stacked {
    align-items: flex-start;
    flex-direction: column;
}

.detail-label {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}

.detail-value {
    font-size: 13px;
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

.detail-value-left {
    text-align: left;
}

.address-note {
    color: var(--text-light);
    line-height: 1.6;
}

.detail-row-total {
    border-top: 2px solid var(--border);
    padding-top: 8px;
    margin-top: 4px;
}

.detail-row-total .detail-value {
    font-weight: 700;
    font-size: 14px;
}

.source-link {
    margin-top: 16px;
}

.source-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.source-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow);
    color: var(--text);
    text-decoration: none;
    border-left: 3px solid var(--primary);
}

.source-card:hover {
    transform: translateY(-1px);
}

.source-card-title {
    font-size: 13px;
    font-weight: 700;
}

.source-card-meta {
    font-size: 12px;
    color: var(--text-light);
}

/* ── Map ─────────────────────────────────────────────────── */

.map-container {
    height: calc(100vh - 140px);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

.detail-map {
    height: 300px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.map-marker-icon {
    background: none !important;
    border: none !important;
}

.marker-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    color: #fff;
    background: #c38b2f;
    border-color: rgba(255,255,255,0.9);
}

.marker-score {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-mono);
}

.marker-symbol {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.marker-owned {
    background: var(--primary-dark);
    border-radius: 10px;
}

.marker-pipeline {
    background: #b67c2f;
}

.marker-dot.risk-critical {
    box-shadow: 0 0 0 3px rgba(182, 77, 54, 0.36), 0 2px 6px rgba(0,0,0,0.3);
}

.marker-dot.risk-warning {
    box-shadow: 0 0 0 2px rgba(195, 139, 47, 0.26), 0 2px 6px rgba(0,0,0,0.3);
}

.map-legend {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.legend-owned {
    background: var(--primary-dark);
    border-radius: 4px;
}

.legend-pipeline {
    background: #b67c2f;
}

.legend-critical {
    background: #f6efe4;
    border: 2px solid #b64d36;
}

/* Map Sidebar */
.map-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(24, 31, 39, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1190;
}

.map-sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.map-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 92vw);
    height: 100vh;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    z-index: 1200;
    transition: transform 0.25s ease;
    overflow-y: auto;
    transform: translateX(100%);
}

.map-sidebar.open { transform: translateX(0); }

.map-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.map-sidebar-header h3 { font-size: 16px; }

.sidebar-parcel { padding: 20px; }
.sidebar-risk {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.risk-label { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; color: var(--text-light); }

.sidebar-parcel h4 { font-size: 18px; margin-bottom: 4px; }
.sidebar-map-number { font-family: var(--font-mono); font-size: 13px; color: var(--text-light); margin-bottom: 16px; }

.sidebar-details { margin-bottom: 20px; }
.sidebar-details .detail-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    align-items: flex-start;
}

.sidebar-details .detail-label {
    min-width: 108px;
}

.sidebar-details .detail-value {
    flex: 1;
    text-align: left;
    overflow-wrap: anywhere;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Legal ───────────────────────────────────────────────── */

.legal-summary {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: var(--sp-lg);
    margin-bottom: var(--sp-xl);
    border-left: 4px solid var(--info);
}
.legal-summary-critical {
    border-left-color: var(--clr-critical);
    background: var(--clr-critical-bg);
}

.legal-severity {
    font-weight: 700;
    font-size: var(--fs-base);
}
.severity-0 { color: var(--success); }
.severity-1 { color: var(--info); }
.severity-2 { color: var(--warning); }
.severity-3 { color: var(--danger); }

.legal-note { font-size: var(--fs-sm); color: var(--text); margin-top: var(--sp-sm); }

.status-badge-sm { font-size: var(--fs-xs); }

.cases-list { display: flex; flex-direction: column; gap: 12px; }

.case-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--border);
}

.case-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.case-number { font-family: var(--font-mono); font-weight: 700; font-size: 13px; color: var(--primary); }
.case-status { font-size: 12px; font-weight: 600; color: var(--text-light); }
.case-caption { font-size: 14px; margin-bottom: 8px; }
.case-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-light); flex-wrap: wrap; }
.case-judgment { color: var(--danger); font-weight: 600; }
.case-link { font-size: 12px; color: var(--primary); display: inline-block; margin-top: 8px; }

/* ── Comps ───────────────────────────────────────────────── */

.comps-source { font-size: 12px; color: var(--text-light); margin-top: 8px; }

/* ── Signals ─────────────────────────────────────────────── */

.signals-list { display: flex; flex-direction: column; gap: 10px; }

.signal-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--info);
}
.signal-card.signal-obituary { border-left-color: var(--warning); }
.signal-card.signal-estate { border-left-color: var(--warning); }
.signal-card.signal-legal_signal { border-left-color: var(--danger); }

.signal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}
.signal-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.signal-confidence { font-size: 11px; color: var(--text-light); }
.signal-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.signal-snippet { font-size: 12px; color: var(--text-light); margin-bottom: 6px; }
.signal-link { font-size: 12px; color: var(--primary); }
.signal-note { font-size: 11px; color: var(--text-light); font-style: italic; margin-top: 4px; }

.signal-disclaimer {
    background: var(--warning-bg);
    color: var(--text);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
}

/* ── Notes ───────────────────────────────────────────────── */

.notes-input {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.notes-input textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
}

.notes-input textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44,95,138,0.1);
}

.notes-list { display: flex; flex-direction: column; gap: 10px; }

.note-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--accent);
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.note-author { font-weight: 600; }
.note-text { font-size: 13px; white-space: pre-wrap; }

/* ── Compare ─────────────────────────────────────────────── */

.compare-selector {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.compare-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.compare-inputs {
    display: flex;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.compare-table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    margin-bottom: 24px;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.compare-table th,
.compare-table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
}

.compare-label-col {
    width: 180px;
    font-weight: 600;
    color: var(--text-light);
    font-size: 12px;
    background: var(--bg);
    position: sticky;
    left: 0;
    z-index: 1;
}

.compare-data-col {
    min-width: 200px;
    text-align: center;
}

.compare-data-col a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.compare-section-header td {
    background: var(--bg);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    padding: 12px 14px;
}

.compare-total-row td {
    font-weight: 700;
    border-top: 2px solid var(--border);
}

.highlight-best {
    background: rgba(39, 174, 96, 0.08);
}

/* ── Compare Bar (floating) ──────────────────────────────── */

.compare-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-dark);
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    font-weight: 600;
    z-index: 150;
    transition: all 0.2s;
}

.compare-bar.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); }
.compare-bar .btn { padding: 6px 14px; }

/* ── Images ──────────────────────────────────────────────── */

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.image-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.visual-quicklook {
    margin-top: 24px;
}

.visual-quicklook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.visual-panel {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.visual-panel-primary {
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.visual-panel-head,
.image-card-head {
    padding: 14px 16px 10px;
}

.visual-kicker,
.image-card-eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
}

.visual-panel h4,
.image-card h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text);
}

.visual-panel-image,
.image-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    background: rgba(80, 64, 47, 0.06);
}

.visual-panel-copy,
.image-card-copy {
    margin: 0;
    padding: 12px 16px 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-light);
}

.image-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px 16px;
}

/* ── Empty State ─────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state p { margin: 8px 0; }
.empty-state a { color: var(--primary); }

.text-muted { color: var(--text-light); font-size: 13px; }

.liens-section { margin-top: 24px; }
.liens-section h3 { font-size: 14px; margin-bottom: 8px; }

.checklist {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 16px 0 8px;
}

.check-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.check-option input {
    margin: 0;
}

.result-metrics {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.metric-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--bg);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.result-meta {
    margin-top: 10px;
    color: var(--text-light);
    font-size: 13px;
}

.result-log {
    font-size: 11px;
    max-height: 220px;
    overflow: auto;
    margin-top: 8px;
    white-space: pre-wrap;
}

.dossier-actions {
    flex-wrap: wrap;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
    .sidebar { width: 60px; }
    .sidebar-header .logo,
    .sidebar-header .sidebar-tag,
    .sidebar-header .version,
    .nav-links li a span:not(.nav-icon),
    .sidebar-stats,
    .sidebar-footer { display: none; }
    .sidebar-header { justify-content: center; padding: 16px 8px; }
    .nav-links li a { justify-content: center; padding: 12px 8px; }
    .content { margin-left: 60px; padding: 16px; }
    .detail-section-wide { grid-column: span 1; }
    .page-header-split { flex-direction: column; }
}

/* The Dirt theme override */

:root {
    /* ── Brand palette ── */
    --primary: #2b5545;
    --primary-light: #3d7a63;
    --primary-dark: #1b3a2e;
    --accent: #c17a2f;
    --danger: #c53030;
    --danger-bg: #fff5f5;
    --warning: #b7791f;
    --warning-bg: #fffff0;
    --success: #2f855a;
    --success-bg: #f0fff4;
    --info: #718096;
    --info-bg: #f7fafc;

    /* ── Surfaces ── */
    --bg: #f5f4f1;
    --bg-card: #ffffff;
    --bg-sidebar: #141a17;
    --bg-muted: #fafaf8;
    --text: #1a1d1b;
    --text-light: #6b7272;
    --text-muted: #94928d;
    --text-inverse: #eef0ee;
    --border: #e2e0db;
    --border-light: #eeedea;

    /* ── Effects ── */
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --overlay-light: rgba(0,0,0,0.04);
    --overlay-medium: rgba(0,0,0,0.08);

    /* ── Layout ── */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 999px;
    --sidebar-width: 240px;

    /* ── Spacing scale ── */
    --sp-xs: 4px;
    --sp-sm: 8px;
    --sp-md: 12px;
    --sp-lg: 16px;
    --sp-xl: 24px;
    --sp-2xl: 32px;
    --sp-3xl: 40px;

    /* ── Typography scale ── */
    --fs-xs: 10px;
    --fs-sm: 12px;
    --fs-base: 14px;
    --fs-md: 16px;
    --fs-lg: 18px;
    --fs-xl: 24px;
    --fs-2xl: 32px;
    --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, system-ui, sans-serif;
    --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, system-ui, sans-serif;
    --font-mono: "Cascadia Code", Consolas, monospace;

    /* ── Semantic status colors ── */
    --clr-critical: #c53030;
    --clr-critical-bg: #fff5f5;
    --clr-done: #2f855a;
    --clr-done-bg: #f0fff4;
    --clr-open: #718096;
    --clr-open-bg: #f7fafc;
}

body {
    background: #f5f4f1;
    color: var(--text);
    letter-spacing: 0.005em;
}

.content {
    padding: 28px 36px 40px;
    max-width: none;
}

.sidebar {
    background: #141a17;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-header {
    align-items: flex-start;
    gap: 12px;
    padding: 22px 16px 16px;
}

.brand-lockup {
    display: flex;
    gap: 12px;
    align-items: center;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex: none;
}

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 4px;
}

.sidebar .eyebrow {
    color: rgba(255,255,255,0.4);
    margin-bottom: 2px;
    font-size: 10px;
}

.logo {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
}

.sidebar-tag {
    font-size: 12px;
    opacity: 0.5;
    margin-top: 3px;
}

.version {
    margin-left: auto;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    opacity: 0.7;
    font-size: 10px;
}

.nav-links {
    padding: 14px 0;
}

.nav-links li a {
    margin: 1px 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 0;
    font-weight: 500;
    font-size: 13.5px;
}

.nav-links li a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.nav-links li.active a {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-icon {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
}

.nav-links li.active .nav-icon {
    color: var(--accent);
}

.sidebar-stats {
    gap: 6px;
    padding: 14px 16px;
}

.mini-stat {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 8px 4px;
}

.sidebar-footer {
    padding: 14px 16px 20px;
}

.sidebar-footer-copy {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 10px;
}

.btn {
    border-radius: 8px;
    padding: 9px 16px;
    font-weight: 600;
    letter-spacing: 0;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
    transform: none;
}

.btn-primary {
    background: var(--primary);
    box-shadow: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: #f8f8f6;
    border-color: #ccc;
}

.page-header,
.filter-bar,
.table-container,
.stat-card,
.detail-section,
.add-form-card,
.add-status-card,
.chart-card,
.compare-selector,
.compare-table-wrapper,
.legal-summary,
.liens-section,
.recent-section,
.risk-detail-section,
.empty-state {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.page-header,
.workspace-hero,
.filter-bar,
.table-container,
.compare-selector,
.compare-table-wrapper,
.chart-card,
.risk-detail-section,
.empty-state,
.recent-section {
    border-radius: var(--radius);
}

.page-header {
    padding: 20px 22px;
}

.workspace-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    padding: 28px 30px;
    margin-bottom: 20px;
    background: var(--primary-dark);
    color: #fff;
    box-shadow: var(--shadow);
    border: none;
}

.workspace-hero .eyebrow {
    color: rgba(255,255,255,0.5);
}

.workspace-hero .page-subtitle {
    color: rgba(255,255,255,0.65);
}

.workspace-hero h2,
.page-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    font-weight: 700;
    color: inherit;
    letter-spacing: -0.03em;
}

.page-header h2 {
    color: var(--text);
}

.workspace-hero-copy {
    max-width: 700px;
}

.workspace-hero-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-start;
}

.hero-chip {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.col-status-cell {
    min-width: 112px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.stats-grid {
    gap: 12px;
}

.stat-card {
    border-left: 3px solid var(--primary);
    padding: 16px 18px;
    position: relative;
}

.stat-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.stat-link:hover {
    box-shadow: var(--shadow-lg);
}

.stat-card-owned {
    border-left-color: #3182ce;
}

.stat-card::before {
    display: none;
}

.stat-card-warn {
    border-left-color: var(--warning);
}

.stat-card-danger {
    border-left-color: var(--danger);
}

.stat-value {
    margin-top: 4px;
    font-size: 1.75rem;
    color: var(--text);
    font-weight: 700;
}

.stat-label {
    margin-top: 4px;
    letter-spacing: 0.06em;
    line-height: 1.35;
    font-size: 11px;
}

.desk-control {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr) minmax(280px, 0.95fr);
    gap: 12px;
    margin: 16px 0 20px;
}

.desk-column {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.desk-column-primary {
    background: var(--bg-card);
}

.desk-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.focus-list {
    display: grid;
    gap: 10px;
}

.focus-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    background: var(--bg);
    border: 1px solid var(--border-light);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.focus-row:hover {
    background: #eeedea;
    border-color: var(--border);
}

.focus-row-copy {
    min-width: 0;
    flex: 1;
}

.focus-row-topline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.focus-row-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.focus-row-subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text);
}

.focus-row-meta {
    margin-top: 6px;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-light);
}

.focus-row-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.focus-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.action-stack,
.coverage-stack,
.territory-list {
    display: grid;
    gap: 10px;
}

.action-link {
    display: block;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    background: var(--bg);
    border: 1px solid var(--border-light);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.action-link:hover {
    background: #eeedea;
    border-color: var(--border);
}

.action-link-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.action-link-copy {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-light);
}

.coverage-row {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border-light);
}

.coverage-row-topline {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.coverage-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.coverage-value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.coverage-bar {
    position: relative;
    width: 100%;
    height: 8px;
    margin-top: 10px;
    border-radius: 999px;
    background: rgba(80, 64, 47, 0.08);
    overflow: hidden;
}

.coverage-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

.coverage-copy {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-light);
}

.territory-list {
    margin-top: 12px;
}

.territory-list-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 2px;
}

.territory-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border-light);
}

.territory-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.territory-copy {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-light);
}

.territory-cash {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.holdings-hero {
    background: #1e3d32;
}

.holdings-control {
    margin-top: 12px;
}

.holdings-focus-row {
    align-items: flex-start;
}

.holdings-badge-stack {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.focus-row-note {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-light);
}

.stage-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.stage-stable {
    background: rgba(47, 77, 62, 0.1);
    color: #335746;
}

.stage-watch {
    background: rgba(185, 132, 48, 0.14);
    color: #8e5f17;
}

.stage-live {
    background: rgba(44, 95, 138, 0.12);
    color: #275a83;
}

.stage-done {
    background: rgba(90, 95, 104, 0.12);
    color: #5d5f68;
}

.focus-pill-watch {
    background: rgba(185, 132, 48, 0.14);
    color: #8e5f17;
}

.mix-group + .mix-group {
    margin-top: 16px;
}

.mix-list {
    display: grid;
    gap: 8px;
}

.mix-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border-light);
}

.mix-row-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.mix-row-value {
    min-width: 28px;
    text-align: center;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.holdings-table-wrap {
    margin-top: 18px;
}

.holdings-table td {
    vertical-align: top;
}

.holdings-table .num {
    white-space: nowrap;
}

.holdings-table .cell-subtle {
    max-width: 240px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.trash-hero {
    background: #6b2b23;
}

.trash-table-wrap {
    margin-top: 18px;
}

.trash-table td {
    vertical-align: top;
}

.trash-title {
    font-weight: 700;
    color: var(--primary-dark);
}

.row-action-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.row-action-stack .btn {
    width: 100%;
    justify-content: center;
}

.ops-hero {
    background: #192722;
}

.ops-health-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.ops-health-card,
.ops-bottom-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.ops-health-label,
.ops-card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-light);
}

.ops-health-value {
    margin-top: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.ops-health-copy,
.ops-card-copy,
.ops-panel-copy,
.ops-note {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-light);
}

.ops-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.85fr) minmax(280px, 0.95fr);
}

.ops-stack {
    display: grid;
    gap: 10px;
}

.ops-card {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border-light);
}

.ops-card-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ops-card-path {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.55;
    color: var(--text);
    word-break: break-word;
}

.ops-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

.ops-bottom-panel h3 {
    margin-bottom: 10px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0;
}

.filter-bar {
    padding: 18px 20px;
}

.filter-form {
    gap: 14px;
}

.filter-group label,
.form-group label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-light);
}

input,
select,
textarea {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 85, 69, 0.12);
    outline: none;
}

.table-container {
    overflow-x: auto;
}

.table-container-quiet {
    padding: 4px 0 0;
}

.data-table thead th {
    background: #fafaf8;
    color: var(--text-light);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.data-table thead th.sortable a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.data-table thead th.sortable.asc a::after,
.data-table thead th.sortable.desc a::after {
    font-size: 10px;
    color: var(--primary-dark);
}

.data-table thead th.sortable.asc a::after {
    content: "↑";
}

.data-table thead th.sortable.desc a::after {
    content: "↓";
}

.data-table tbody tr {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.data-table tbody tr:hover {
    background: rgba(154, 79, 47, 0.05);
}

.parcel-link {
    color: var(--primary);
    font-weight: 600;
}

.completion-link {
    color: inherit;
    text-decoration: none;
}

.cell-subtle,
.page-subtitle,
.text-muted,
.form-help {
    color: var(--text-light);
}

.completion-badge,
.flag-count,
.note-badge,
.metric-pill {
    border-radius: 6px;
    padding: 4px 10px;
    font-weight: 600;
}

.completion-badge {
    border: 1px solid var(--border);
    background: var(--bg);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}

.status-owned {
    background: rgba(44, 95, 138, 0.12);
    color: var(--primary-dark);
    border-color: rgba(44, 95, 138, 0.2);
}

.status-contract {
    background: rgba(100, 86, 170, 0.12);
    color: #4b3b92;
    border-color: rgba(100, 86, 170, 0.2);
}

.status-research,
.status-prospect {
    background: rgba(181, 122, 34, 0.14);
    color: #85550d;
    border-color: rgba(181, 122, 34, 0.18);
}

.status-passed {
    background: rgba(120, 132, 144, 0.12);
    color: #5c6772;
    border-color: rgba(120, 132, 144, 0.18);
}

.parcel-row.status-owned {
    box-shadow: inset 3px 0 0 #3182ce;
}

.parcel-row.status-research,
.parcel-row.status-prospect {
    box-shadow: inset 3px 0 0 var(--warning);
}

.completion-complete {
    background: rgba(69, 110, 69, 0.12);
    color: #2f5f36;
}

.completion-in-progress {
    background: rgba(181, 122, 34, 0.14);
    color: #85550d;
}

.completion-thin {
    background: rgba(161, 56, 46, 0.12);
    color: #8e332b;
}

.detail-grid,
.image-grid,
.charts-row {
    gap: 16px;
}

.detail-section,
.add-form-card,
.add-status-card,
.chart-card,
.recent-section,
.risk-detail-section {
    border-radius: var(--radius);
}

.detail-section h3,
.add-form-card h3,
.add-status-card h3,
.chart-card h3,
.recent-section h3,
.risk-detail-section h3 {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-table {
    margin-top: 12px;
}

.detail-row {
    border-bottom: 1px solid var(--border-light);
}

.tabs {
    gap: 0;
    margin-bottom: 18px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}

.tab {
    border-radius: 0;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-light);
    padding: 10px 16px;
    font-weight: 600;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    background: none;
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.image-card,
.source-card,
.case-card,
.signal-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.signal-disclaimer {
    border-radius: var(--radius-sm);
    border: 1px solid #e9d5a0;
    background: #fefce8;
}

.check-option {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.check-option:hover {
    border-color: var(--primary-light);
}

.check-option:has(input:checked) {
    border-color: var(--primary);
    background: #f0fff4;
}

.check-hint {
    display: inline-block;
    margin-left: 4px;
    font-style: normal;
    font-size: 0.82em;
    font-weight: 400;
    color: var(--text-light, #6b7280);
}

/* ── Signals tab — geographic plausibility split ───────────── */
.signals-section-header {
    margin: 16px 0 4px 0;
    font-size: 1em;
}
.signals-section-blurb {
    margin: 0 0 12px 0;
    font-size: 0.88em;
}
.signals-section-unlikely {
    margin-top: 20px;
    padding: 10px 14px;
    background: rgba(150, 150, 150, 0.06);
    border: 1px dashed rgba(150, 150, 150, 0.35);
    border-radius: 6px;
}
.signals-section-unlikely > summary {
    cursor: pointer;
    color: var(--text-light, #6b7280);
    font-size: 0.9em;
    padding: 2px 0;
    list-style: disclosure-closed;
}
.signals-section-unlikely[open] > summary {
    list-style: disclosure-open;
    margin-bottom: 10px;
}
.signal-demoted {
    opacity: 0.78;
}
.signal-geo {
    display: inline-block;
    padding: 1px 7px;
    margin-left: 6px;
    font-size: 0.72em;
    font-weight: 600;
    border-radius: 999px;
    letter-spacing: 0.02em;
}
.signal-geo-local    { color: #1f5c32; background: #d4edda; border: 1px solid #a3d9b1; }
.signal-geo-neighbor { color: #6b4f00; background: #fff3cd; border: 1px solid #ffe28a; }
.signal-geo-distant  { color: #71272a; background: #ffe1e1; border: 1px solid #ffb1b1; }

/* ── Legal tab — case cards with timelines + PDF attachments ───────────── */
.cases-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.cases-summary { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.78em;
    font-weight: 600;
    border-radius: 999px;
    letter-spacing: 0.02em;
    background: rgba(150, 150, 150, 0.12);
    border: 1px solid rgba(150, 150, 150, 0.3);
    color: var(--text-light, #6b7280);
}
.chip-tax-sale {
    color: #8a1c1c;
    background: #ffe1e1;
    border-color: #ff7676;
}
.chip-tax-sale-inline {
    color: #8a1c1c;
    background: #ffe1e1;
    border-color: #ff7676;
    font-size: 0.72em;
    padding: 2px 7px;
    margin-left: 6px;
}
.chip-docs {
    color: #1f5c32;
    background: #d4edda;
    border-color: #a3d9b1;
}

.case-card {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
}
.case-card-tax-sale {
    border-left: 4px solid #b04040;
    background: #fffafa;
}

.case-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.case-header-left, .case-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.case-number {
    font-family: ui-monospace, monospace;
    font-size: 1.02em;
    font-weight: 600;
}
.case-status {
    padding: 2px 8px;
    font-size: 0.78em;
    font-weight: 600;
    border-radius: 4px;
    background: #f3f4f6;
    color: #374151;
}
.case-status.status-active   { color: #8a4f00; background: #fff3cd; }
.case-status.status-closed   { color: #374151; background: #e5e7eb; }
.case-status.status-disposed { color: #374151; background: #e5e7eb; }
.case-status.status-unknown  { color: #6b7280; background: #f3f4f6; }

.match-conf {
    padding: 2px 7px;
    font-size: 0.72em;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.04em;
    background: #f3f4f6;
    color: #6b7280;
}
.match-conf-high   { color: #1f5c32; background: #d4edda; }
.match-conf-medium { color: #8a4f00; background: #fff3cd; }
.match-conf-low    { color: #71272a; background: #ffe1e1; }

.case-caption {
    font-size: 0.95em;
    margin: 4px 0 8px 0;
    color: #374151;
}
.case-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.85em;
    color: var(--text-light, #6b7280);
    margin-bottom: 10px;
}
.case-meta strong { color: #374151; font-weight: 600; }
.case-judgment { color: #8a1c1c; font-weight: 600; }

.case-body { margin: 8px 0 0 0; }
.case-subpanel {
    margin: 8px 0;
    padding: 0;
    background: rgba(150, 150, 150, 0.04);
    border: 1px solid rgba(150, 150, 150, 0.22);
    border-radius: 6px;
    overflow: hidden;
}
/* Drop the native disclosure marker so we can own the look. */
.case-subpanel > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    font-weight: 500;
    color: #374151;
    padding: 10px 14px;
    background: rgba(44, 95, 138, 0.04);
    border-bottom: 1px solid transparent;
    user-select: none;
    transition: background-color 120ms, border-color 120ms;
}
.case-subpanel > summary::-webkit-details-marker { display: none; }
/* Custom chevron that rotates 90° when the panel is open. */
.case-subpanel > summary::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid #6b7280;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    transition: transform 150ms ease-out;
    flex-shrink: 0;
}
.case-subpanel[open] > summary::before { transform: rotate(90deg); }
.case-subpanel > summary:hover,
.case-subpanel > summary:focus-visible {
    background: rgba(44, 95, 138, 0.12);
    color: #1a3c5a;
    outline: none;
}
.case-subpanel > summary:hover::before,
.case-subpanel > summary:focus-visible::before { border-left-color: #2c5f8a; }
.case-subpanel[open] > summary {
    border-bottom-color: rgba(150, 150, 150, 0.22);
}
/* Padding around the expanded content, since we moved summary's padding
   onto the summary itself. */
.case-subpanel > :not(summary) {
    padding: 8px 14px 12px 14px;
}
/* Subtle "click to expand" hint when collapsed, to drive discoverability. */
.case-subpanel:not([open]) > summary::after {
    content: "click to expand";
    margin-left: auto;
    font-size: 0.75em;
    font-weight: 400;
    font-style: italic;
    color: #9ca3af;
}
.case-subpanel[open] > summary::after {
    content: "click to collapse";
    margin-left: auto;
    font-size: 0.75em;
    font-weight: 400;
    font-style: italic;
    color: #9ca3af;
}

.party-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.party-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px;
    align-items: start;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(150, 150, 150, 0.2);
}
.party-row:last-child { border-bottom: none; }
.party-role {
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #374151;
    text-transform: uppercase;
    padding-top: 3px;
}
.party-name { font-weight: 600; color: #111827; }
.party-address { font-size: 0.85em; color: var(--text-light, #6b7280); margin-top: 2px; }

.event-timeline {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
    border-left: 2px solid rgba(150, 150, 150, 0.25);
}
.event-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    padding: 8px 0 8px 12px;
    position: relative;
}
.event-row::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #9ca3af;
}
.event-row + .event-row { border-top: 1px dashed rgba(150, 150, 150, 0.18); }
.event-date {
    font-family: ui-monospace, monospace;
    font-size: 0.82em;
    color: var(--text-light, #6b7280);
    white-space: nowrap;
    padding-top: 2px;
}
.event-description {
    font-weight: 500;
    color: #111827;
}
.event-subname {
    font-size: 0.82em;
    margin-top: 2px;
}
.event-note {
    font-size: 0.78em;
    margin-top: 4px;
    font-style: italic;
}
.event-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.82em;
    text-decoration: none;
    color: #1f5c32;
    background: #eaf7ef;
    border: 1px solid #a3d9b1;
    border-radius: 6px;
    transition: background 120ms, border-color 120ms;
}
.attachment-link:hover,
.attachment-link:focus-visible {
    background: #d4edda;
    border-color: #6fc085;
    outline: none;
}
.attachment-link.attachment-secured {
    color: #6b7280;
    background: #f3f4f6;
    border-color: #d1d5db;
    cursor: help;
}
.attachment-link.attachment-skipped {
    color: #8a4f00;
    background: #fff8e1;
    border-color: #ffd76b;
    cursor: help;
}
.attachment-icon {
    display: inline-block;
    min-width: 30px;
    padding: 0 4px;
    font-size: 0.72em;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.05em;
    color: #fff;
    background: #1f5c32;
    border-radius: 3px;
}
.attachment-link.attachment-secured .attachment-icon { background: #6b7280; }
.attachment-link.attachment-skipped .attachment-icon { background: #8a4f00; }
.attachment-name {
    font-family: ui-monospace, monospace;
    font-size: 0.88em;
}
.attachment-size {
    color: var(--text-light, #6b7280);
    font-size: 0.9em;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin-top: 6px;
}
.document-tile {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    color: #111827;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: border-color 120ms, box-shadow 120ms;
}
.document-tile:hover,
.document-tile:focus-visible {
    border-color: #6fc085;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    outline: none;
}
.document-tile-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.document-tile-name {
    font-family: ui-monospace, monospace;
    font-size: 0.82em;
    word-break: break-all;
}
.document-tile-meta {
    font-size: 0.8em;
    margin-top: 4px;
}

.case-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.9em;
    color: #2c5f8a;
}

.compare-bar {
    border-radius: var(--radius);
    background: var(--primary-dark);
    box-shadow: var(--shadow-lg);
}

.compare-table th,
.compare-table td {
    border-color: var(--border-light);
}

.chart-card canvas {
    margin-top: 6px;
}

.risk-badge {
    border-radius: 999px;
}

body.app-ready .workspace-hero,
body.app-ready .page-header,
body.app-ready .stats-grid,
body.app-ready .filter-bar,
body.app-ready .table-container,
body.app-ready .detail-section,
body.app-ready .chart-card,
body.app-ready .compare-selector,
body.app-ready .compare-table-wrapper,
body.app-ready .add-form-card,
body.app-ready .add-status-card {
    animation: dirt-rise 0.3s ease both;
}

.stats-grid .stat-card:nth-child(2),
.detail-grid .detail-section:nth-child(2) {
    animation-delay: 0.04s;
}

.stats-grid .stat-card:nth-child(3),
.detail-grid .detail-section:nth-child(3) {
    animation-delay: 0.08s;
}

@keyframes dirt-rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.holdings-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

/* ── Polish: Data Table UX ──────────────────────────────── */

.data-table tbody tr {
    cursor: pointer;
}

.data-table tbody tr:nth-child(even) {
    background: #fafaf8;
}

.data-table tbody tr:hover {
    background: #f0efec;
}

.data-table tbody tr:active {
    background: #e8e7e3;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fafaf8;
}

/* ── Polish: Button Differentiation ────────────────────── */

.btn-warn {
    background: #fefce8;
    color: #854d0e;
    border: 1px solid #fde68a;
}

.btn-warn:hover {
    background: #fef9c3;
    color: #713f12;
}

/* ── Polish: Active Filter Indicators ──────────────────── */

.filter-group select:not([value=""]),
.filter-group input:not(:placeholder-shown) {
    border-color: var(--primary);
    background: #f0fff4;
}

/* ── Polish: Empty States ──────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 48px 28px;
}

.empty-state-icon {
    font-size: 48px;
    opacity: 0.35;
    margin-bottom: 14px;
}

.empty-state-title {
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state-copy {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.55;
    max-width: 400px;
    margin: 0 auto 18px;
}

/* ── Polish: Toast Notification ────────────────────────── */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--primary-dark);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.toast.toast-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-success {
    background: #2f855a;
}

.toast-error {
    background: #c53030;
}

/* ── Polish: Loading Spinner ───────────────────────────── */

.btn.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

.btn-outline.btn-loading::after {
    border-color: rgba(29, 46, 40, 0.15);
    border-top-color: var(--primary-dark);
}

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

/* ── Polish: Tab Transitions ───────────────────────────── */

.tab-content {
    animation: tab-fade 0.22s ease;
}

@keyframes tab-fade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Polish: Card Hover Lift (parcel detail sections) ──── */

.detail-section {
    transition: box-shadow 0.15s ease;
}

.detail-section:hover {
    box-shadow: var(--shadow-lg);
}

/* ── Polish: Image Cards ───────────────────────────────── */

.image-card img,
.visual-panel img {
    border-radius: 0;
    transition: transform 0.2s ease;
}

.image-card:hover img,
.visual-panel:hover img {
    transform: scale(1.02);
}

/* ── Polish: Scrollbar ─────────────────────────────────── */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ── Area Context / Buyer Appeal ──────────────────────── */

.area-context-score {
    display: flex;
    align-items: center;
    gap: 16px;
}

.appeal-score {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--bg);
    border: 2px solid var(--border);
}

.appeal-score.appeal-score-high {
    border-color: var(--primary);
    background: #f0f7f3;
}

.appeal-score.appeal-score-mid {
    border-color: #c17a2f;
    background: #fdf8f2;
}

.appeal-score.appeal-score-low {
    border-color: var(--danger);
    background: #fdf5f5;
}

.appeal-score-value {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}

.appeal-score-high .appeal-score-value { color: var(--primary); }
.appeal-score-mid .appeal-score-value { color: #c17a2f; }
.appeal-score-low .appeal-score-value { color: var(--danger); }

.appeal-score-label {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.appeal-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.appeal-profile {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.appeal-confidence {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.area-context-narrative {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-secondary);
    padding: 14px 16px;
    background: var(--bg);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

/* ── Acquisition Checklist ────────────────────────────── */

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: background 0.15s;
}

.checklist-item:hover {
    background: #f0efec;
}

.checklist-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 240px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text);
}

.checklist-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checklist-notes {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: var(--font);
    color: var(--text);
    background: #fff;
}

.checklist-notes:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(43, 85, 69, 0.12);
}

/* ── Title Search Checklist (Legal tab) ──────────────── */

.checklist-marker {
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    font-family: var(--font-mono);
    border-radius: var(--radius-sm);
    background: var(--border);
    color: var(--text-light);
}
.checklist-done .checklist-marker {
    background: var(--clr-done-bg);
    color: var(--clr-done);
}
.checklist-critical .checklist-marker {
    background: var(--clr-critical-bg);
    color: var(--clr-critical);
}
.checklist-critical {
    border-color: var(--clr-critical) !important;
    background: var(--clr-critical-bg) !important;
}
.checklist-done {
    border-color: var(--clr-done-bg) !important;
}
.checklist-detail {
    font-size: var(--fs-sm);
    margin-top: 2px;
}

/* ── Search Intelligence Results ─────────────────────── */

.search-result-card {
    padding: 14px 16px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid #bbb;
    border-radius: 8px;
    transition: border-color 0.15s;
}

.search-result-card.search-result-relevant {
    border-left-color: var(--primary);
    background: #f5faf7;
}

.search-result-card.search-result-not_relevant {
    border-left-color: var(--danger);
    background: #fdf5f5;
    opacity: 0.75;
}

.search-result-card.search-result-unrated {
    border-left-color: #ccc;
}

.search-result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-result-header strong {
    flex: 1;
    color: var(--text);
}

.search-result-query {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.search-result-snippet {
    margin: 6px 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.search-result-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.search-result-date {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Responsive: Mobile (<600px) ───────────────────────── */

@media (max-width: 600px) {
    .sidebar {
        display: none;
    }

    .content {
        margin-left: 0;
        padding: 14px;
    }

    .workspace-hero {
        border-radius: 10px;
        padding: 20px;
    }

    .workspace-hero h2,
    .page-header h2 {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .desk-control {
        grid-template-columns: 1fr;
    }

    .filter-form {
        flex-direction: column;
    }

    .filter-group {
        min-width: unset;
    }

    .header-actions {
        flex-wrap: wrap;
    }

    .page-header-split {
        flex-direction: column;
    }

    .row-action-stack {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 8px;
    }

    .tabs {
        gap: 6px;
    }

    .tab {
        padding: 8px 10px;
        font-size: 12px;
    }
}

@media (max-width: 1100px) {
    .workspace-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .ops-health-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .desk-control {
        grid-template-columns: 1fr;
    }

    .ops-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .brand-mark,
    .sidebar .eyebrow,
    .sidebar-footer-copy {
        display: none;
    }

    .content {
        padding: 18px 18px 30px;
    }

    .workspace-hero,
    .page-header,
    .desk-column,
    .filter-bar,
    .table-container,
    .detail-section,
    .add-form-card,
    .add-status-card,
    .chart-card,
    .compare-selector,
    .compare-table-wrapper,
    .recent-section,
    .risk-detail-section,
    .empty-state {
        border-radius: 10px;
    }

    .workspace-hero h2,
    .page-header h2 {
        font-size: 2rem;
    }

    .ops-health-grid {
        grid-template-columns: 1fr;
    }

    .focus-row {
        flex-direction: column;
    }

    .focus-row-metrics {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ── Utility classes (token-backed) ─────────────────── */

.mt-sm  { margin-top: var(--sp-sm); }
.mt-md  { margin-top: var(--sp-md); }
.mt-lg  { margin-top: var(--sp-lg); }
.ml-sm  { margin-left: var(--sp-sm); }
.ml-md  { margin-left: var(--sp-md); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-muted  { color: var(--text-light); }

/* ── UX additions (2026-04 review pass) ────────────────────── */

.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    padding: var(--sp-md, 16px);
    background: repeating-linear-gradient(
        45deg,
        rgba(150, 150, 150, 0.08),
        rgba(150, 150, 150, 0.08) 10px,
        rgba(150, 150, 150, 0.14) 10px,
        rgba(150, 150, 150, 0.14) 20px
    );
    color: var(--text-light, #6b7280);
    font-size: 0.9em;
    border-radius: 6px;
    border: 1px dashed rgba(150, 150, 150, 0.35);
    text-align: center;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    margin-left: 6px;
    font-size: 0.78em;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-light, #6b7280);
    background: transparent;
    border: 1px solid rgba(150, 150, 150, 0.35);
    border-radius: 4px;
    cursor: pointer;
    transition: background 120ms, color 120ms, border-color 120ms;
}
.btn-copy:hover,
.btn-copy:focus-visible {
    color: var(--text, #111827);
    background: rgba(150, 150, 150, 0.1);
    border-color: rgba(100, 100, 100, 0.5);
    outline: none;
}

.data-quality-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    margin-left: 8px;
    font-size: 0.78em;
    font-weight: 600;
    color: #8a4f00;
    background: #fff3cd;
    border: 1px solid #ffc25c;
    border-radius: 999px;
    cursor: help;
}
.data-quality-chip.severity-critical {
    color: #8a1c1c;
    background: #ffe1e1;
    border-color: #ff7676;
}
.data-quality-chip::before {
    content: "⚠";
    font-size: 1em;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    margin: 24px 0;
    text-align: center;
    background: rgba(150, 150, 150, 0.04);
    border: 1px dashed rgba(150, 150, 150, 0.3);
    border-radius: 8px;
}
.empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
}
.empty-state p {
    margin: 4px 0;
    color: var(--text-light, #6b7280);
}
.empty-state a {
    margin-top: 12px;
}

.shortcut-help-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}
.shortcut-help-overlay.visible { display: flex; }
.shortcut-help-panel {
    background: #fff;
    color: #111;
    padding: 24px 28px;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    min-width: 320px;
    max-width: 480px;
}
.shortcut-help-panel h3 {
    margin: 0 0 12px 0;
    font-size: 1.1em;
}
.shortcut-help-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
}
.shortcut-help-panel li {
    display: contents;
}
.shortcut-help-panel kbd {
    display: inline-block;
    min-width: 22px;
    padding: 2px 6px;
    font-family: ui-monospace, monospace;
    font-size: 0.85em;
    text-align: center;
    color: #111;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}
.shortcut-help-panel span { align-self: center; }
.shortcut-help-hint {
    margin: 14px 0 0 0;
    font-size: 0.8em;
    color: #6b7280;
}

/* ── Finances page ──────────────────────────────────────────────────── */
.finance-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}
.finance-form .form-group { margin: 0; }
.finance-form .form-group-wide { grid-column: 1 / -1; }
.finance-form .form-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}
.finance-form input[type="text"],
.finance-form input[type="number"],
.finance-form input[type="date"],
.finance-form select {
    width: 100%;
}
.finance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.finance-table th,
.finance-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    text-align: left;
    vertical-align: middle;
}
.finance-table th {
    font-weight: 600;
    background: rgba(0, 0, 0, 0.03);
}
.finance-table td.num,
.finance-table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.finance-subtle { color: #6b7280; font-size: 0.9em; }
.finance-subtle-note { margin-top: 10px; }
.finance-pos { color: var(--success, #2e7d32); font-weight: 600; }
.finance-neg { color: var(--danger, #c62828); font-weight: 600; }

@media (max-width: 720px) {
    .finance-form { grid-template-columns: 1fr; }
    .finance-table th, .finance-table td { padding: 6px 6px; }
}

/* ── Comparable Sales (DTS) — replaces the older flag-item rows ─────── */
.comp-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }

.comp-card {
    background: var(--info-bg, #f0f7ff);
    border-left: 3px solid var(--info, #2563eb);
    border-radius: var(--radius-sm, 6px);
    padding: 10px 14px;
    font-size: 13px;
}

.comp-card-excluded {
    background: var(--surface-muted, #f8fafc);
    border-left-color: var(--text-muted, #94a3b8);
    opacity: 0.85;
}

.comp-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.comp-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--info, #2563eb);
    color: #fff;
}

.comp-card-excluded .comp-tag {
    background: var(--text-muted, #94a3b8);
}

.comp-tax-map { font-family: var(--mono, ui-monospace, "SFMono-Regular", Menlo, monospace); font-size: 12px; }
.comp-tax-map a { color: inherit; text-decoration: underline dotted; }
.comp-date { font-size: 12px; color: var(--text-muted, #64748b); }
.comp-type { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted, #64748b); }
.comp-amount { margin-left: auto; font-weight: 600; }
.comp-ppa, .comp-acreage { font-weight: 400; color: var(--text-muted, #64748b); margin-left: 4px; font-size: 12px; }

.comp-parties {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted, #64748b);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.comp-grantor, .comp-grantee { font-weight: 500; color: var(--text, #1e293b); }
.comp-arrow { opacity: 0.6; }

.comp-exclusion {
    margin-top: 6px;
    font-size: 11px;
    font-style: italic;
    color: var(--text-muted, #64748b);
}

.comp-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.comp-link {
    font-size: 11px;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid var(--border, #cbd5e1);
    color: var(--text, #1e293b);
    background: #fff;
}
.comp-link:hover { background: var(--surface-muted, #f1f5f9); }

/* ── Skip link — hidden until focused (standard a11y pattern) ──────────── */
.skip-link {
    position: absolute;
    top: -48px;
    left: 0;
    z-index: 9999;
    padding: 10px 16px;
    background: var(--accent, #9a4f2f);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 6px 0;
    transition: top 120ms ease;
}
.skip-link:focus { top: 0; outline: 3px solid #fff; outline-offset: -3px; }
/* Make programmatic focus on <main> visible when reached via skip link. */
#main-content:focus { outline: none; }

/* ── Visually-hidden helper (used by labels we still want SR users to hear) */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Data-quality chip → <details> disclosure ─────────────────────────── */
.data-quality-disclosure {
    display: inline-block;
    vertical-align: middle;
    border-radius: var(--radius-sm, 6px);
    /* When closed, the summary alone shows; when open, the list flows below. */
}
.data-quality-disclosure[open] {
    display: block;
    margin-top: 4px;
    padding: 0;
}
.data-quality-disclosure > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.data-quality-disclosure > summary::-webkit-details-marker { display: none; }
.data-quality-disclosure > summary::before {
    content: "▸ ";
    display: inline-block;
    margin-right: 4px;
    transition: transform 120ms ease;
}
.data-quality-disclosure[open] > summary::before {
    content: "▾ ";
}
.data-quality-disclosure > summary:focus-visible {
    outline: 2px solid var(--accent, #9a4f2f);
    outline-offset: 2px;
}
.data-quality-hint {
    font-size: 10px;
    margin-left: 6px;
    opacity: 0.7;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.data-quality-disclosure[open] .data-quality-hint::after { content: ""; }
.data-quality-list {
    list-style: none;
    padding: 8px 12px;
    margin: 6px 0 0 0;
    background: var(--surface-muted, #f8fafc);
    border-radius: var(--radius-sm, 6px);
    border-left: 3px solid var(--warning, #d97706);
}
.data-quality-disclosure.severity-critical .data-quality-list {
    border-left-color: var(--danger, #c62828);
}
.data-quality-item {
    padding: 6px 0;
    font-size: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    border-bottom: 1px dashed var(--border, #e2e8f0);
}
.data-quality-item:last-child { border-bottom: 0; }
.data-quality-severity {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--warning, #d97706);
    color: #fff;
}
.data-quality-item.dq-critical .data-quality-severity {
    background: var(--danger, #c62828);
}
.data-quality-item.dq-info .data-quality-severity {
    background: var(--info, #2563eb);
}
.data-quality-message { flex: 1 1 auto; }
.data-quality-source {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    font-style: italic;
}

/* ── Compare 4-cap UI affordance ──────────────────────────────────────── */
.compare-cap-hint {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    margin: 0 6px;
    font-style: italic;
}
.compare-bar.compare-bar-cap .compare-cap-hint {
    color: var(--warning, #d97706);
    font-weight: 600;
    font-style: normal;
}
.compare-check[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.parcel-row.compare-cap-reached { background: rgba(217, 119, 6, 0.04); }
