/* ─── ClarityNext Viewer Styles ──────────────────────────────────── */

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-border: #e2e6ea;
    --color-text: #1a1a2e;
    --color-text-muted: #6b7280;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    --color-accent: #0f766e;
    --color-row-hover: #f1f5ff;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 14px;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ── Top Bar ───────────────────────────────────────────────────── */
.top-bar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.5px;
}
.logo:hover {
    text-decoration: none;
}

.top-nav {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-link {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: all 0.15s ease;
}
.nav-link:hover {
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
}
.nav-link.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ── Nav Dropdowns ─────────────────────────────────────────────── */
.nav-dropdown {
    position: relative;
    padding-bottom: 8px;   /* extend hover zone below trigger */
    margin-bottom: -8px;   /* offset so layout isn't affected */
}
.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.nav-dd-chevron {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    transition: transform 0.2s ease;
}
.nav-dropdown:hover .nav-dd-chevron {
    transform: rotate(180deg);
}
.nav-dropdown.active > .nav-dropdown-trigger {
    background: var(--color-primary-light);
    color: var(--color-primary);
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 4px;
    z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}
.nav-dd-item {
    display: block;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: all 0.12s ease;
    text-decoration: none;
}
.nav-dd-item:hover {
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
}
.nav-dd-item.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ── Content ───────────────────────────────────────────────────── */
.content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* ── Page Header ───────────────────────────────────────────────── */
.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-top: 2px;
}

/* ── Filter Bar ────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.filter-group select,
.filter-group input[type="date"] {
    padding: 7px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
    min-width: 180px;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.series-gear-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 7px;
    color: #6b7280;
    line-height: 1;
    transition: all 0.15s;
}
.series-gear-btn:hover {
    background: #f3f4f6;
    color: var(--color-text);
}

/* Inline filters — no box, compact, instant client-side filtering */
.inline-filters {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 0 4px;
    margin-top: -12px;
    margin-bottom: 16px;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.2;
    box-sizing: border-box;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
}

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

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}
.btn-ghost:hover {
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ── Table ─────────────────────────────────────────────────────── */
.table-wrapper {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

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

.meeting-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

/* ── Sortable Headers ─────────────────────────────────────────── */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}
.sortable:hover {
    color: var(--color-primary);
}
.sortable .sort-icon::after {
    content: "\2195";
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.3;
}
.sortable.sorted .sort-icon::after {
    opacity: 1;
    color: var(--color-primary);
}
.sortable.sorted.asc .sort-icon::after {
    content: "\2191";
}
.sortable.sorted.desc .sort-icon::after {
    content: "\2193";
}

.meeting-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
    vertical-align: middle;
}

.meeting-table th.num,
.meeting-table td.num {
    text-align: right;
}

.meeting-row {
    cursor: pointer;
    transition: background 0.1s ease;
}
.meeting-row:hover {
    background: var(--color-row-hover);
}

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

.date-cell {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ── Org Badge ─────────────────────────────────────────────────── */
.org-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Org-specific colors */
.org-f1 {
    background: #fef3c7;
    color: #92400e;
}
.org-df {
    background: #dbeafe;
    color: #1e40af;
}
.org-fluidstructure {
    background: #d1fae5;
    color: #065f46;
}

/* Fallback for unknown orgs */
.org-badge:not(.org-f1):not(.org-df):not(.org-fluidstructure) {
    background: #f3f4f6;
    color: #374151;
}

/* ── Participant Tags ──────────────────────────────────────────── */
.participant-tag {
    display: inline-block;
    padding: 1px 7px;
    background: #f3f4f6;
    border-radius: 10px;
    font-size: 11px;
    color: var(--color-text-muted);
    margin: 1px 2px;
    white-space: nowrap;
}

.participant-more {
    display: inline-block;
    padding: 1px 7px;
    font-size: 11px;
    color: var(--color-primary);
    font-weight: 500;
}

.participants-cell {
    max-width: 320px;
}

.participant-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.participant-list .participant-tag {
    font-size: 13px;
    padding: 4px 10px;
}

/* ── Empty State ───────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--color-text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--color-text);
}

/* ── Detail Page ───────────────────────────────────────────────── */
.detail-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
}
.back-link:hover {
    color: var(--color-primary);
}

.prev-next {
    display: flex;
    gap: 8px;
}

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

.detail-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.detail-date {
    font-size: 16px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* ── Meta Cards ────────────────────────────────────────────────── */
.meta-cards {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.meta-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 20px;
    min-width: 140px;
    box-shadow: var(--shadow-sm);
}

.meta-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.meta-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
}

.meta-value-sm {
    font-size: 14px;
    font-weight: 600;
}

/* ── Detail Sections ───────────────────────────────────────────── */
.detail-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.detail-section h2 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

/* ── Transcript ────────────────────────────────────────────────── */
.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.transcript-header h2 {
    margin-bottom: 0;
}

.transcript-container {
    max-height: none;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.transcript-container.collapsed {
    max-height: 400px;
    position: relative;
}

.transcript-container.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, var(--color-surface));
    pointer-events: none;
}

.transcript-text {
    font-family: inherit;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--color-text);
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

/* ── Signal Table ──────────────────────────────────────────────── */
.signal-table td {
    vertical-align: middle;
}

.id-cell {
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 12px;
    white-space: nowrap;
    color: var(--color-text-muted);
}

.loop-key-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.concern-cell {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.context-cell {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Status Badges ────────────────────────────────────────────── */
.status-badge,
.strength-badge,
.concern-state-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Closure status */
.status-open {
    background: #fef3c7;
    color: #92400e;
}
.status-closed {
    background: #d1fae5;
    color: #065f46;
}
.status-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

/* Signal strength */
.strength-high {
    background: #fee2e2;
    color: #991b1b;
}
.strength-medium {
    background: #fef3c7;
    color: #92400e;
}
.strength-low {
    background: #f3f4f6;
    color: #6b7280;
}
.strength-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

/* Concern state */
.concern-state-open {
    background: #fee2e2;
    color: #991b1b;
}
.concern-state-closed {
    background: #d1fae5;
    color: #065f46;
}
.concern-state-deferred {
    background: #fef3c7;
    color: #92400e;
}
.concern-state-dismissed {
    background: #f3f4f6;
    color: #6b7280;
}
.concern-state-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

/* Decision state badges */
.decision-state-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    background: #f3f4f6;
    color: #6b7280;
}
.decision-state-decided {
    background: #d1fae5;
    color: #065f46;
}
.decision-state-proposed {
    background: #f3f4f6;
    color: #6b7280;
}
.decision-state-debated {
    background: #fef3c7;
    color: #92400e;
}
.decision-state-deferred {
    background: #ffedd5;
    color: #9a3412;
}
.decision-state-reaffirmed {
    background: #dbeafe;
    color: #1e40af;
}
.decision-state-amended {
    background: #ede9fe;
    color: #5b21b6;
}
.decision-state-reversed {
    background: #fee2e2;
    color: #991b1b;
}

/* Decision modal quotes */
.modal-quote {
    padding: 8px 14px;
    margin-bottom: 8px;
    background: #f8fafc;
    border-left: 3px solid #cbd5e1;
    border-radius: 0 8px 8px 0;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.6;
    font-style: italic;
}

.method-cell {
    font-size: 0.78rem;
    color: #6b7280;
}

/* ── Importance Score ──────────────────────────────────────────── */
.importance-cell {
    text-align: center;
}
.importance-score {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.importance-high {
    background: #fee2e2;
    color: #991b1b;
}
.importance-medium {
    background: #fef3c7;
    color: #92400e;
}
.importance-low {
    background: #f3f4f6;
    color: #6b7280;
}

/* ── Importance Breakdown (modal) ──────────────────────────────── */
.importance-breakdown {
    background: #f9fafb;
    border-radius: 8px;
    padding: 10px 14px !important;
}
.importance-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.importance-check {
    display: inline-block;
    padding: 2px 8px;
    background: #e5e7eb;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #374151;
}

/* ── Sortable Table Headers ────────────────────────────────────── */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 18px !important;
}
th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 4px;
    font-size: 0.7rem;
    color: #9ca3af;
}
th.sortable.sorted-desc::after {
    content: '▼';
    color: var(--color-primary);
}
th.sortable.sorted-asc::after {
    content: '▲';
    color: var(--color-primary);
}

/* ── Initiative Status ─────────────────────────────────────────── */
.init-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.init-status-planned {
    background: #dbeafe;
    color: #1e40af;
}
.init-status-in-progress {
    background: #fef3c7;
    color: #92400e;
}
.init-status-claimed-done {
    background: #d1fae5;
    color: #065f46;
}
.init-status-unclear {
    background: #f3f4f6;
    color: #6b7280;
}
.init-status-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

/* ── Claim Type (Metrics) ─────────────────────────────────────── */
.claim-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.claim-type-performance {
    background: #dbeafe;
    color: #1e40af;
}
.claim-type-risk {
    background: #fee2e2;
    color: #991b1b;
}
.claim-type-gap {
    background: #fef3c7;
    color: #92400e;
}
.claim-type-target {
    background: #e0e7ff;
    color: #3730a3;
}
.claim-type-forecast {
    background: #ede9fe;
    color: #5b21b6;
}
.claim-type-assumption {
    background: #f3f4f6;
    color: #6b7280;
}
.claim-type-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

/* ── Direction (Outcomes) ─────────────────────────────────────── */
.direction-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.direction-positive {
    background: #d1fae5;
    color: #065f46;
}
.direction-negative {
    background: #fee2e2;
    color: #991b1b;
}
.direction-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

/* ── Evidence Badge (Outcomes) ─────────────────────────────────── */
.evidence-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    background: #f3f4f6;
    color: #6b7280;
}

/* ── Time Horizon (Risks) ─────────────────────────────────────── */
.horizon-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.horizon-already-slipping {
    background: #fee2e2;
    color: #991b1b;
}
.horizon-near-term {
    background: #fef3c7;
    color: #92400e;
}
.horizon-this-quarter {
    background: #fef9c3;
    color: #854d0e;
}
.horizon-longer-term {
    background: #dbeafe;
    color: #1e40af;
}
.horizon-retrospective {
    background: #f3f4f6;
    color: #6b7280;
}
.horizon-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-container {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.15s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: var(--color-surface);
    z-index: 1;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 12px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}
.modal-close:hover {
    color: var(--color-text);
}

.modal-body {
    padding: 20px 24px 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px 16px;
    border-top: 1px solid #e2e8f0;
}

.modal-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.modal-meta-sep {
    color: var(--color-border);
}
.modal-meta-bottom {
    margin-bottom: 0;
    margin-top: 20px;
    padding-bottom: 0;
    padding-top: 16px;
    border-bottom: none;
    border-top: 1px solid var(--color-border);
}
.modal-meta-id {
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    opacity: 0.7;
}

.modal-section {
    margin-bottom: 16px;
}

.modal-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.modal-section p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text);
    margin: 0;
}

.modal-verbatim {
    font-style: italic;
    font-size: 13px;
    line-height: 1.7;
    color: var(--color-text);
    border-left: 3px solid var(--color-primary);
    padding: 8px 16px;
    background: var(--color-primary-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.modal-primary-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text);
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.modal-grid > div {
    min-width: 0;
}

.modal-grid p {
    font-size: 13px;
    margin: 0;
}

/* ── Flag Tags ─────────────────────────────────────────────────── */
.flag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.flag-tag {
    display: inline-block;
    padding: 2px 10px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Login Page ───────────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f3f4f6;
}
.login-container {
    width: 100%;
    max-width: 380px;
    padding: 40px 32px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.login-logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-align: center;
    margin-bottom: 28px;
    color: var(--color-text);
}
.login-error {
    background: #fef2f2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: .85rem;
    margin-bottom: 18px;
    border: 1px solid #fecaca;
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.login-field label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 5px;
}
.login-field input {
    width: 100%;
    padding: 10px 12px;
    font-size: .9rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: border-color .15s;
}
.login-field input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.login-btn {
    width: 100%;
    padding: 11px;
    font-size: .9rem;
    margin-top: 4px;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 18px 0 14px;
    color: #94a3b8;
    font-size: .82rem;
}
.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.login-divider span {
    padding: 0 12px;
}

.btn-microsoft {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px;
    font-size: .9rem;
    font-weight: 500;
    color: #fff;
    background: #2f2f2f;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}
.btn-microsoft:hover {
    background: #1a1a1a;
}
.btn-microsoft svg {
    flex-shrink: 0;
}

/* ── Series Listing ──────────────────────────────────────────── */
.back-link {
    font-size: 0.85rem;
    color: var(--color-muted, #64748b);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}
.back-link:hover { color: var(--color-primary, #4f46e5); }

.series-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 4px 6px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.15s;
}
.series-action-btn:hover {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

.action-pill {
    display: inline-block;
    padding: 4px 12px;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
}
.action-pill:hover {
    background: #e0e7ff;
}
.action-pill-empty {
    color: #9ca3af;
    font-size: 0.82rem;
}
.action-pill-empty-link {
    color: #94a3b8;
    font-size: 0.82rem;
    text-decoration: none;
}
.action-pill-empty-link:hover {
    color: #64748b;
    text-decoration: underline;
}

/* ── Quick Upload Modal (shared) ────────────────────────────── */
.qu-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.4);z-index:1000;display:flex;align-items:center;justify-content:center}
.qu-modal{background:#fff;border-radius:10px;width:440px;max-width:90vw;box-shadow:0 8px 30px rgba(0,0,0,0.15)}
.qu-header{display:flex;align-items:center;justify-content:space-between;padding:14px 20px;border-bottom:1px solid #e5e7eb}
.qu-body{padding:16px 20px}
.qu-field{margin-bottom:12px}
.qu-field label{display:block;font-size:0.82rem;font-weight:500;color:#374151;margin-bottom:4px}
.qu-readonly{padding:6px 10px;background:#f9fafb;border:1px solid #e5e7eb;border-radius:5px;font-size:0.88rem;color:#4b5563}
.qu-dropzone{border:2px dashed #d1d5db;border-radius:8px;padding:24px;text-align:center;cursor:pointer;color:#6b7280;font-size:0.85rem;transition:border-color 0.2s}
.qu-dropzone:hover,.qu-dropzone.dragover{border-color:#2563eb;color:#2563eb}
.qu-dropzone.has-file{border-color:#059669;background:#f0fdf4;color:#065f46}
.qu-footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px;border-top:1px solid #e5e7eb}
.qu-progress-bar{padding:0}
.qu-progress-track{height:3px;background:#e5e7eb;border-radius:2px;overflow:hidden}
.qu-progress-fill{height:100%;background:#2563eb;border-radius:2px;transition:width 0.5s ease;width:0%}
.qu-progress-fill.done{background:#059669}
.qu-progress-info{display:flex;align-items:center;gap:6px;padding:6px 2px 0;font-size:0.82rem;color:#4b5563}
.qu-progress-spinner{width:12px;height:12px;border:2px solid #93c5fd;border-top-color:#2563eb;border-radius:50%;animation:qu-spin 0.8s linear infinite;flex-shrink:0}
.qu-refresh-btn{padding:3px 12px;background:#059669;color:#fff;border:none;border-radius:5px;font-size:0.8rem;cursor:pointer;margin-left:auto}
.qu-refresh-btn:hover{background:#047857}
@keyframes qu-spin{to{transform:rotate(360deg)}}

/* ── Nav User ────────────────────────────────────────────────── */
.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
.nav-user-name {
    font-size: .82rem;
    color: #6b7280;
    font-weight: 500;
}
.nav-logout {
    font-size: .8rem !important;
    color: #9ca3af !important;
    padding: 4px 10px !important;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}
.nav-logout:hover {
    color: #374151 !important;
    border-color: #d1d5db;
    background: #f9fafb;
}

/* ── Upload: fixed org display for customers ─────────────────── */
.org-fixed {
    display: inline-block;
    padding: 8px 12px;
    font-size: .9rem;
    font-weight: 600;
    color: #1f2937;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}


/* ── Summary View — Polished Reference Design ────────────────── */

.s3-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.s3-header { margin-bottom: 28px; }
.s3-eyebrow {
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: #6b7280; margin-bottom: 6px;
}
.s3-header h1 {
    font-size: 1.625rem; font-weight: 700; color: #111318;
    letter-spacing: -0.02em; line-height: 1.25;
}

/* Stats Bar */
.s3-stats-bar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 12px; margin-bottom: 28px;
}
.s3-stat-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 16px 18px; display: flex; flex-direction: column; gap: 2px;
    text-decoration: none; transition: box-shadow 0.15s;
}
.s3-stat-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); text-decoration: none; }
.s3-stat-label {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: #6b7280;
}
.s3-stat-number { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.s3-stat-amber .s3-stat-number { color: #b45309; }
.s3-stat-red .s3-stat-number { color: #dc2626; }
.s3-stat-blue .s3-stat-number { color: #2563eb; }
.s3-stat-slate .s3-stat-number { color: #475569; }
.s3-stat-green .s3-stat-number { color: #059669; }

/* Toolbar */
.s3-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; flex-wrap: wrap; gap: 10px;
}
.s3-toolbar-left { display: flex; gap: 8px; }
.s3-toolbar-right { display: flex; gap: 8px; }
.s3-toolbar-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; border-radius: 8px; font-size: 0.78rem;
    font-weight: 600; font-family: inherit; cursor: pointer;
    border: 1px solid #d1d5db; background: #fff; color: #374151;
    transition: all 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.s3-toolbar-btn:hover { background: #f9fafb; border-color: #9ca3af; }
.s3-toolbar-btn svg { width: 14px; height: 14px; }
.s3-btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.s3-btn-primary:hover { background: #1d4ed8; }
.s3-btn-active { background: #2563eb !important; color: #fff !important; border-color: #2563eb !important; }

/* Section */
.s3-section { margin-bottom: 24px; scroll-margin-top: 72px; }
.s3-section-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px; background: #fff;
    border: 1px solid #e5e7eb; border-radius: 12px 12px 0 0; border-bottom: none;
}
.s3-section-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.s3-section-icon svg { width: 16px; height: 16px; }
.s3-icon-amber { background: #fef3c7; }
.s3-icon-amber svg { stroke: #b45309; }
.s3-icon-red { background: #fee2e2; }
.s3-icon-red svg { stroke: #dc2626; }
.s3-icon-blue { background: #dbeafe; }
.s3-icon-blue svg { stroke: #2563eb; }
.s3-icon-slate { background: #f1f5f9; }
.s3-icon-slate svg { stroke: #475569; }
.s3-icon-green { background: #d1fae5; }
.s3-icon-green svg { stroke: #059669; }
.s3-section-title { font-size: 0.88rem; font-weight: 700; color: #111318; flex: 1; }
.s3-section-count {
    font-size: 0.72rem; font-weight: 700; padding: 3px 10px;
    border-radius: 20px; background: #f3f4f6; color: #6b7280;
}

/* Help button & banner */
.s3-help-btn {
    width: 20px; height: 20px; border-radius: 50%;
    border: 1.5px solid #d1d5db; background: #f9fafb;
    color: #9ca3af; font-size: 0.7rem; font-weight: 700;
    cursor: pointer; display: inline-flex; align-items: center;
    justify-content: center; flex-shrink: 0;
    transition: all 0.15s ease; line-height: 1;
    font-family: inherit;
}
.s3-help-btn:hover {
    background: #e5e7eb; color: #374151; border-color: #9ca3af;
}
.s3-help-banner {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 20px; background: #f0f4ff;
    border: 1px solid #e5e7eb; border-top: none;
    font-size: 0.8rem; line-height: 1.6; color: #374151;
}
.s3-help-text { flex: 1; }
.s3-help-text strong { font-weight: 700; color: #1e293b; }
.s3-help-close {
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; color: #9ca3af; padding: 0 2px;
    line-height: 1; flex-shrink: 0; transition: color 0.15s;
}
.s3-help-close:hover { color: #374151; }

/* Panel list */
.s3-panel-list {
    background: #fff; border: 1px solid #e5e7eb;
    border-top: none; border-radius: 0 0 12px 12px; overflow: hidden;
}

/* Panel */
.s3-panel { border-bottom: 1px solid #f3f4f6; }
.s3-panel:last-child { border-bottom: none; }
.s3-panel-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; cursor: pointer; user-select: none;
    transition: background 0.12s;
}
.s3-panel-header:hover { background: #fafbfc; }

/* Accent bar */
.s3-accent { width: 3px; height: 18px; border-radius: 2px; flex-shrink: 0; }
.s3-accent-amber { background: #f59e0b; }
.s3-accent-red { background: #ef4444; }
.s3-accent-blue { background: #3b82f6; }
.s3-accent-slate { background: #94a3b8; }

.s3-panel-title {
    font-weight: 600; font-size: 0.84rem; color: #1a1d23; flex: 1; line-height: 1.4;
}
.s3-panel-meta {
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex-shrink: 0;
}

/* Chevron */
.s3-chevron {
    width: 16px; height: 16px; flex-shrink: 0;
    stroke: #9ca3af; transition: transform 0.25s ease;
}
.s3-panel.open .s3-chevron { transform: rotate(180deg); }

/* Checkbox slot */
.s3-cb-slot {
    flex-shrink: 0; width: 20px;
    display: flex; align-items: center; justify-content: center;
}
.s3-cb-slot input[type="checkbox"] {
    width: 16px; height: 16px; cursor: pointer; accent-color: #2563eb;
}

/* Panel body — grid-based smooth expand */
.s3-panel-body {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}
.s3-panel.open .s3-panel-body { grid-template-rows: 1fr; }
.s3-panel-inner { overflow: hidden; }

/* Card */
.s3-card {
    margin: 0 20px 16px; padding: 18px 22px;
    background: #f9fafb; border: 1px solid #eef0f2; border-radius: 10px;
}

/* Fields */
.s3-field { margin-bottom: 14px; }
.s3-field:last-child { margin-bottom: 0; }
.s3-field-label {
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: #6b7280; font-weight: 700; margin-bottom: 4px;
}
.s3-field-value { font-size: 0.84rem; color: #374151; line-height: 1.65; }
.s3-field-quote {
    font-style: italic; color: #4b5563; font-size: 0.84rem;
    border-left: 3px solid #d1d5db; padding: 8px 14px;
    background: #fff; border-radius: 0 6px 6px 0; line-height: 1.65;
}

/* Row / Half */
.s3-row { display: flex; gap: 24px; margin-bottom: 14px; }
.s3-half { flex: 1; min-width: 0; }

/* Tags */
.s3-tag {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    font-size: 0.73rem; font-weight: 500; margin: 2px 4px 2px 0; line-height: 1.5;
}
.s3-tag-init { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.s3-tag-metr { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Meta chips */
.s3-meta-chip {
    display: inline-block; padding: 2px 10px; border-radius: 20px;
    font-size: 0.68rem; font-weight: 600;
}
.s3-mchip-init { background: #ede9fe; color: #5b21b6; }
.s3-mchip-metr { background: #dbeafe; color: #1e40af; }

/* Badges */
.s3-badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 0.7rem; font-weight: 600; white-space: nowrap;
}
.s3-badge-healthy { background: #dcfce7; color: #166534; }
.s3-badge-act-no-meas { background: #fef3c7; color: #92400e; }
.s3-badge-meas-no-act { background: #fee2e2; color: #991b1b; }
.s3-badge-inactive { background: #f3f4f6; color: #6b7280; }
.s3-badge-no-resp { background: #fee2e2; color: #991b1b; }
.s3-badge-implicit { background: #fef3c7; color: #92400e; }
.s3-badge-explicit { background: #dcfce7; color: #166534; }

/* ── Task List (tiptap-compatible checklist) ───────────────────── */
.s3-tasklist {
    list-style: none; margin: 0; padding: 0;
}
.s3-taskitem {
    display: flex; align-items: flex-start;
    padding: 12px 20px; border-bottom: 1px solid #f3f4f6;
    font-size: 0.84rem; color: #1a1d23; line-height: 1.5;
}
.s3-taskitem:last-child { border-bottom: none; }
.s3-task-label {
    display: flex; align-items: flex-start; gap: 12px;
    cursor: pointer; flex: 1;
}
.s3-task-check {
    position: absolute; opacity: 0; pointer-events: none;
}
.s3-task-checkbox-visual {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 4px;
    border: 2px solid #d1d5db; background: #fff;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px; transition: all 0.15s;
}
.s3-task-checkbox-visual::after {
    content: ''; display: block; width: 10px; height: 6px;
    border-left: 2px solid #fff; border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(0, -1px); opacity: 0;
    transition: opacity 0.15s;
}
.s3-task-check:checked + .s3-task-checkbox-visual {
    background: #2563eb; border-color: #2563eb;
}
.s3-task-check:checked + .s3-task-checkbox-visual::after {
    opacity: 1;
}
.s3-task-text { flex: 1; font-weight: 400; transition: opacity 0.2s; }
.s3-copy-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 6px; border: 1px solid #d1d5db;
    background: #f9fafb; color: #6b7280; font-size: 0.7rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
}
.s3-copy-btn:hover { background: #e5e7eb; color: #374151; }
.s3-copy-btn svg { width: 13px; height: 13px; }
.s3-copy-btn.copied { background: #d1fae5; color: #059669; border-color: #a7f3d0; }
.s3-task-check:checked ~ .s3-task-text {
    text-decoration: line-through; opacity: 0.5;
}
.s3-taskitem .s3-cb-slot {
    flex-shrink: 0; margin-left: 8px;
}

.s3-empty-dash { color: #c4c8cf; font-size: 0.84rem; }
.s3-empty { color: #9ca3af; padding: 20px; font-style: italic; text-align: center; }

/* ── Summary 2: Reference signals divider ──────────────────────── */
.s2-ref-divider {
    margin: 36px 0 24px;
    padding: 20px 0 16px;
    border-top: 2px solid #e2e6ea;
    text-align: center;
}
.s2-ref-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: #334155;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}
.s2-ref-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    font-style: italic;
    font-weight: 400;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group select,
    .filter-group input[type="date"] {
        min-width: auto;
        width: 100%;
    }
    .meta-cards {
        flex-direction: column;
    }
    .participants-cell {
        max-width: none;
    }
    .detail-nav {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .modal-overlay {
        padding: 12px;
    }
    .modal-container {
        max-height: 90vh;
    }
    .modal-grid {
        grid-template-columns: 1fr;
    }
    .loop-key-cell,
    .concern-cell,
    .context-cell {
        max-width: 180px;
    }
    .s3-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .s3-row {
        flex-direction: column;
        gap: 12px;
    }
    .s3-panel-title {
        font-size: 0.8rem;
    }
    .s3-panel-meta {
        display: none;
    }
    .s3-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .s3-toolbar-left,
    .s3-toolbar-right {
        justify-content: center;
    }
}


/* ── Pattern Badges (MI Map) ────────────────────────────────────── */
.pattern-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.pattern-healthy {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}
.pattern-activity-no-measurement {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
}
.pattern-measurement-no-action {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.pattern-inactive {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}
.pattern-unknown {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

/* ── Visibility Badges (RI Map) ─────────────────────────────────── */
.visibility-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.visibility-no-response {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.visibility-implicit {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
}
.visibility-explicit {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}
.visibility-unknown {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

/* ── Item Tags (MI Map initiative/metric lists) ─────────────────── */
.list-cell {
    max-width: 320px;
}
.item-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.76rem;
    margin: 2px 3px 2px 0;
    line-height: 1.4;
}
.item-tag-initiative {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
}
.item-tag-metric {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #7dd3fc;
}
.item-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.item-none {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}
.theme-cell {
    font-weight: 600;
    white-space: nowrap;
}
.mi-map-table td.list-cell {
    max-width: 220px;
    vertical-align: top;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ══════════════════════════════════════════════════════════════════════
   Canonical Initiatives Viewer
   ══════════════════════════════════════════════════════════════════════ */

/* ── Stats bar (4-column variant) ──────────────────────────────────── */
.ci-stats-bar {
    grid-template-columns: repeat(4, 1fr);
}

/* ── Status accent bars (left edge of panel) ───────────────────────── */
.ci-accent-active   { background: #22c55e; }
.ci-accent-planned  { background: #f59e0b; }
.ci-accent-completed { background: #94a3b8; }
.ci-accent-stalled  { background: #ef4444; }
.ci-accent-dormant  { background: #d1d5db; }

/* ── Status badges ─────────────────────────────────────────────────── */
.ci-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ci-status-active    { background: #dcfce7; color: #166534; }
.ci-status-planned   { background: #fef3c7; color: #92400e; }
.ci-status-completed { background: #f1f5f9; color: #475569; }
.ci-status-stalled   { background: #fee2e2; color: #991b1b; }
.ci-status-dormant   { background: #f3f4f6; color: #6b7280; }

/* ── Meta chips (header) ───────────────────────────────────────────── */
.ci-mchip-mentions { background: #dbeafe; color: #1e40af; }
.ci-mchip-loop     { background: #fef3c7; color: #92400e; }
.ci-mchip-risk     { background: #fee2e2; color: #991b1b; }
.ci-mchip-conc     { background: #fce7f3; color: #9d174d; }

/* ── Count label in toolbar ────────────────────────────────────────── */
.ci-count-label {
    font-size: 0.82rem;
    color: #6b7280;
    font-weight: 500;
}

/* ── Indented detail block (the expanded body) ─────────────────────── */
.ci-detail-block {
    margin-left: 18px;
    padding-left: 16px;
    border-left: 3px solid #e5e7eb;
}

/* ── Description & meta line ───────────────────────────────────────── */
.ci-desc {
    font-size: 0.84rem;
    color: #334155;
    line-height: 1.55;
    margin-bottom: 6px;
}
.ci-meta-line {
    display: flex;
    gap: 8px;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 14px;
}

/* ── Signal columns grid ───────────────────────────────────────────── */
.ci-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.ci-col {
    min-width: 0;
}

/* Column heading */
.ci-col-heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 5px 10px;
    border-radius: 6px 6px 0 0;
    border-bottom: 2px solid;
}
.ci-ch-initiative { color: #5b21b6; background: #f5f3ff; border-color: #c4b5fd; }
.ci-ch-metric     { color: #1e40af; background: #eff6ff; border-color: #93c5fd; }
.ci-ch-risk       { color: #991b1b; background: #fef2f2; border-color: #fca5a5; }
.ci-ch-concern    { color: #9d174d; background: #fdf2f8; border-color: #f9a8d4; }
.ci-ch-loop       { color: #065f46; background: #ecfdf5; border-color: #6ee7b7; }

/* Column list */
.ci-col-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ci-col-item {
    display: flex;
    flex-direction: column;
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.1s;
}
.ci-col-item:hover {
    background: #f8fafc;
}
.ci-col-item:last-child {
    border-bottom: none;
}

/* Primary text */
.ci-col-text {
    font-size: 0.8rem;
    color: #1e293b;
    line-height: 1.45;
}

/* Evidence text */
.ci-col-evidence {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
    display: block;
    line-height: 1.3;
}

/* Footnote date */
.ci-col-date {
    font-size: 0.66rem;
    color: #c0c5ce;
    margin-top: 2px;
    letter-spacing: 0.01em;
}

/* Multi-claim badge for metrics */
.ci-multi-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0 5px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ── Popup overlay ─────────────────────────────────────────────────── */
.ci-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.ci-popup-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.ci-popup {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px 28px;
    position: relative;
}
.ci-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}
.ci-popup-close:hover { color: #334155; }

.ci-popup-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
    padding-right: 28px;
    line-height: 1.4;
}

.ci-popup-body {}

.ci-popup-field {
    margin-bottom: 10px;
}
.ci-popup-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}
.ci-popup-value {
    display: block;
    font-size: 0.84rem;
    color: #1e293b;
    line-height: 1.55;
}
.ci-popup-date-field {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}
.ci-popup-divider {
    border: none;
    border-top: 1px dashed #e2e8f0;
    margin: 10px 0;
}

/* ── Responsive override for canonical ─────────────────────────────── */
@media (max-width: 768px) {
    .ci-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .ci-detail-block {
        margin-left: 8px;
        padding-left: 10px;
    }
    .ci-columns {
        grid-template-columns: 1fr;
    }
    .ci-popup {
        width: 95%;
        padding: 18px 20px;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* ── Recommendations View ────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════ */

.rec-window-meta {
    font-size: 0.82rem;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.6;
}
.rec-dates-toggle {
    color: #3b82f6;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
}
.rec-dates-toggle:hover { text-decoration: underline; }
.rec-dates-list {
    font-size: 0.75rem;
    color: #94a3b8;
}

.rec-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 24px;
}

.rec-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}
.rec-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.rec-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.rec-rank {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 2px;
}
.rec-card:nth-child(1) .rec-rank { background: #dbeafe; color: #1e40af; }
.rec-card:nth-child(2) .rec-rank { background: #e0e7ff; color: #3730a3; }
.rec-card:nth-child(3) .rec-rank { background: #f1f5f9; color: #475569; }

.rec-headline {
    font-size: 1rem;
    font-weight: 700;
    color: #111318;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin: 0;
}

.rec-body {
    padding: 18px 24px 20px;
}

.rec-section {
    margin-bottom: 16px;
}
.rec-section:last-child { margin-bottom: 0; }

.rec-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rec-urgency-icon {
    width: 14px;
    height: 14px;
    stroke: #dc2626;
}

.rec-reasoning {
    font-size: 0.84rem;
    color: #374151;
    line-height: 1.7;
    margin: 0;
}

.rec-urgency {
    font-size: 0.82rem;
    color: #991b1b;
    background: #fef2f2;
    border-left: 3px solid #fca5a5;
    padding: 8px 14px;
    border-radius: 0 8px 8px 0;
    line-height: 1.6;
    margin: 0;
}

/* Signal references (collapsible) */
.rec-refs {
    margin-top: 16px;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
}

.rec-refs-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}
.rec-refs-label:hover { color: #6b7280; }

.rec-refs-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}
.rec-refs.open .rec-refs-chevron {
    transform: rotate(180deg);
}

.rec-refs-body {
    display: none;
    margin-top: 10px;
}
.rec-refs.open .rec-refs-body {
    display: block;
}

.rec-ref-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f9fafb;
    font-size: 0.78rem;
    line-height: 1.5;
}
.rec-ref-item:last-child { border-bottom: none; }

.rec-ref-type {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rec-ref-type-loop     { background: #fef3c7; color: #92400e; }
.rec-ref-type-metric   { background: #dbeafe; color: #1e40af; }
.rec-ref-type-concern  { background: #fee2e2; color: #991b1b; }
.rec-ref-type-risk     { background: #fce7f3; color: #9d174d; }
.rec-ref-type-outcome  { background: #d1fae5; color: #065f46; }
.rec-ref-type-initiative { background: #ede9fe; color: #5b21b6; }

.rec-ref-id {
    flex-shrink: 0;
    font-weight: 600;
    color: #374151;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.72rem;
}

.rec-ref-meeting {
    flex-shrink: 0;
    color: #9ca3af;
    font-size: 0.7rem;
}

.rec-ref-relevance {
    flex: 1;
    color: #6b7280;
}

@media (max-width: 640px) {
    .rec-card-header { flex-direction: column; gap: 10px; }
    .rec-ref-item { flex-wrap: wrap; }
}


/* ─── Upload / Add Meetings Page ─────────────────────────────────── */

.upload-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 1.5rem;
}
.upload-zone:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}
.upload-zone.dragover {
    border-color: var(--color-primary);
    background: #dbeafe;
}
.upload-zone-content {
    text-align: center;
    padding: 2rem;
}
.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}
.upload-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.4rem;
}
.upload-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Upload progress */
.upload-progress-bar {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}
.upload-progress-fill {
    height: 100%;
    width: 60%;
    background: var(--color-primary);
    border-radius: 2px;
    animation: progress-pulse 1.5s ease-in-out infinite;
}
@keyframes progress-pulse {
    0%, 100% { width: 30%; }
    50% { width: 80%; }
}
.upload-progress-text {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Metadata header */
.metadata-header {
    margin-bottom: 1.5rem;
}
.metadata-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.metadata-header p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* File cards */
.file-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}
.file-card-error {
    border-color: #fca5a5;
    background: #fef2f2;
}
.file-card-validation-error {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.2);
}
.file-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.file-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
}
.file-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}
.file-stats span {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}
.file-error-badge {
    background: #fee2e2;
    color: #dc2626;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 500;
}
.file-error-msg {
    color: #dc2626;
    font-size: 0.88rem;
}

/* Field layout */
.file-card-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}
.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.field-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.field-with-new {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.field-group select,
.field-group input[type="date"],
.field-group input[type="text"] {
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.88rem;
    color: var(--color-text);
    background: #fff;
    width: 100%;
}
.field-group select:focus,
.field-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.add-new-input {
    border-color: var(--color-primary) !important;
}
.date-hint {
    font-size: 0.75rem;
    color: #f59e0b;
}
.date-hint.date-detected {
    color: #10b981;
}

/* Ingest actions */
.ingest-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.btn-ingest {
    display: inline-block;
    padding: 0.6rem 1.8rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}
.btn-ingest:hover {
    background: var(--color-primary-hover);
}
.btn-ingest:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}
.btn-secondary {
    padding: 0.6rem 1.8rem;
    background: #fff;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-secondary:hover {
    background: #f3f4f6;
}

/* Ingestion results */
.result-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.result-filename {
    font-weight: 500;
    min-width: 200px;
}
.result-badge {
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
}
.result-success .result-badge {
    background: #d1fae5;
    color: #065f46;
}
.result-duplicate .result-badge {
    background: #fef3c7;
    color: #92400e;
}
.result-failed .result-badge {
    background: #fee2e2;
    color: #dc2626;
}
.result-message {
    color: var(--color-text-muted);
    font-size: 0.88rem;
    flex: 1;
}

@media (max-width: 768px) {
    .file-card-fields {
        grid-template-columns: 1fr;
    }
    .file-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* Summary 3 — Agenda with Rationale                                  */
/* ═══════════════════════════════════════════════════════════════════ */

.s3a-wrap { max-width: 920px; margin: 0 auto; padding: 24px 16px 64px; }

.s3a-header { margin-bottom: 24px; }
.s3a-eyebrow {
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: #6b7280; margin-bottom: 6px;
}
.s3a-header h1 {
    font-size: 1.5rem; font-weight: 700; color: #111318;
    letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 4px;
}
.s3a-subtitle { font-size: 0.84rem; color: #9ca3af; }

.s3a-empty { text-align: center; padding: 48px 24px; color: #6b7280; }
.s3a-empty p { margin-bottom: 8px; font-size: 0.95rem; }
.s3a-empty-hint { font-size: 0.82rem; color: #9ca3af; }
.s3a-empty-hint code {
    background: #f3f4f6; padding: 2px 8px; border-radius: 4px;
    font-size: 0.78rem; font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Toolbar */
.s3a-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; gap: 8px; flex-wrap: wrap;
}
.s3a-toolbar-left, .s3a-toolbar-right { display: flex; gap: 8px; align-items: center; }
.s3a-toolbar-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 8px; border: 1px solid #e5e7eb;
    background: #fff; color: #374151; font-size: 0.78rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.s3a-toolbar-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
.s3a-toolbar-btn svg { width: 15px; height: 15px; }
.s3a-btn-primary { background: #111318; color: #fff; border-color: #111318; }
.s3a-btn-primary:hover { background: #1f2937; }
.s3a-copied { background: #d1fae5 !important; color: #059669 !important; border-color: #a7f3d0 !important; }

/* Cards */
.s3a-cards { display: flex; flex-direction: column; gap: 8px; }

.s3a-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    overflow: hidden; transition: box-shadow 0.15s;
}
.s3a-card:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.s3a-card[data-checked="true"] { opacity: 0.6; }

.s3a-card-top {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 14px 16px 14px 20px;
}

.s3a-task-label {
    display: flex; align-items: flex-start; gap: 12px; flex: 1; cursor: pointer;
}
.s3a-task-check { position: absolute; opacity: 0; pointer-events: none; }
.s3a-task-checkbox-visual {
    width: 20px; height: 20px; border-radius: 4px; border: 2px solid #d1d5db;
    flex-shrink: 0; margin-top: 1px; position: relative;
    transition: all 0.15s; background: #fff;
}
.s3a-task-checkbox-visual::after {
    content: ''; position: absolute; top: 2px; left: 6px;
    width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg); opacity: 0; transition: opacity 0.15s;
}
.s3a-task-check:checked + .s3a-task-checkbox-visual {
    background: #2563eb; border-color: #2563eb;
}
.s3a-task-check:checked + .s3a-task-checkbox-visual::after { opacity: 1; }
.s3a-task-text {
    flex: 1; font-weight: 400; font-size: 0.88rem; color: #1a1d23; line-height: 1.5;
}
.s3a-task-check:checked ~ .s3a-task-text {
    text-decoration: line-through; opacity: 0.5;
}

.s3a-expand-btn {
    background: none; border: none; cursor: pointer; padding: 4px;
    flex-shrink: 0; color: #9ca3af; transition: color 0.15s;
}
.s3a-expand-btn:hover { color: #374151; }
.s3a-chevron { width: 18px; height: 18px; transition: transform 0.25s ease; }
.s3a-card.open .s3a-chevron { transform: rotate(180deg); }

/* Collapsible detail */
.s3a-card-detail {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease;
}
.s3a-card.open .s3a-card-detail { max-height: 1200px; }

.s3a-rationale {
    padding: 0 20px 14px 52px;
}
.s3a-detail-label {
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: #9ca3af; font-weight: 700; margin-bottom: 6px;
}
.s3a-rationale p {
    font-size: 0.84rem; color: #374151; line-height: 1.65;
    background: #f0f4ff; border-left: 3px solid #93c5fd;
    padding: 8px 14px; border-radius: 0 8px 8px 0;
}

.s3a-signals {
    padding: 0 20px 16px 52px;
}
.s3a-signal-card {
    background: #f9fafb; border: 1px solid #f0f1f3; border-radius: 8px;
    padding: 10px 14px; margin-bottom: 6px;
}
.s3a-signal-card:last-child { margin-bottom: 0; }
.s3a-signal-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.s3a-signal-type {
    padding: 2px 8px; border-radius: 4px; font-size: 0.65rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    flex-shrink: 0;
}
.s3a-type-loop { background: #fef3c7; color: #92400e; }
.s3a-type-concern { background: #fee2e2; color: #991b1b; }
.s3a-type-risk { background: #fce7f3; color: #9d174d; }
.s3a-type-mi_map { background: #dbeafe; color: #1e40af; }
.s3a-type-unknown { background: #f3f4f6; color: #6b7280; }

.s3a-signal-id {
    font-weight: 600; color: #374151;
    font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.72rem;
    flex-shrink: 0;
}
.s3a-signal-title {
    font-size: 0.82rem; color: #1a1d23; font-weight: 500; line-height: 1.45;
}
.s3a-signal-detail {
    font-size: 0.78rem; color: #6b7280; line-height: 1.55; margin-top: 4px;
}

@media (max-width: 640px) {
    .s3a-wrap { padding: 16px 12px 48px; }
    .s3a-card-top { padding: 12px 12px 12px 14px; }
    .s3a-rationale, .s3a-signals { padding-left: 14px; }
    .s3a-toolbar { flex-direction: column; align-items: stretch; }
}

/* ── Summary 3 — Reference Signals (collapsed block) ───────────── */
.s3a-ref-block {
    margin-top: 36px;
    border: 1px solid #e2e6ea;
    border-radius: 12px;
    background: #fafbfc;
    overflow: hidden;
}
.s3a-ref-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; cursor: pointer; user-select: none;
    transition: background 0.12s;
}
.s3a-ref-header:hover { background: #f3f4f6; }
.s3a-ref-header-left { display: flex; align-items: center; gap: 10px; }
.s3a-ref-header h2 { font-size: 0.92rem; font-weight: 700; color: #334155; margin: 0; }
.s3a-ref-counts {
    font-size: 0.72rem; color: #9ca3af; font-weight: 500;
}
.s3a-ref-hint {
    font-size: 0.72rem; color: #9ca3af; font-style: italic;
}
.s3a-ref-chevron {
    width: 18px; height: 18px; stroke: #9ca3af; flex-shrink: 0;
    transition: transform 0.25s ease;
}
.s3a-ref-block.open .s3a-ref-chevron { transform: rotate(180deg); }
.s3a-ref-block.open .s3a-ref-hint { display: none; }

.s3a-ref-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 20px;
}
.s3a-ref-block.open .s3a-ref-body {
    max-height: 12000px;
    padding: 0 20px 20px;
}

/* Stats bar */
.s3a-ref-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-bottom: 20px; padding-top: 4px;
}
.s3a-ref-stat {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
}
.s3a-ref-stat-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; }
.s3a-ref-stat-num { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }
.s3a-ref-stat-amber .s3a-ref-stat-num { color: #b45309; }
.s3a-ref-stat-red .s3a-ref-stat-num { color: #dc2626; }
.s3a-ref-stat-blue .s3a-ref-stat-num { color: #2563eb; }
.s3a-ref-stat-slate .s3a-ref-stat-num { color: #475569; }

/* Section headers */
.s3a-ref-section { margin-bottom: 20px; }
.s3a-ref-sec-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: #fff;
    border: 1px solid #e5e7eb; border-radius: 10px 10px 0 0;
    border-bottom: none;
}
.s3a-ref-sec-icon {
    width: 28px; height: 28px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.s3a-ref-sec-icon svg { width: 14px; height: 14px; }
.s3a-ref-icon-amber { background: #fef3c7; }
.s3a-ref-icon-amber svg { stroke: #b45309; }
.s3a-ref-icon-red { background: #fee2e2; }
.s3a-ref-icon-red svg { stroke: #dc2626; }
.s3a-ref-icon-blue { background: #dbeafe; }
.s3a-ref-icon-blue svg { stroke: #2563eb; }
.s3a-ref-icon-slate { background: #f1f5f9; }
.s3a-ref-icon-slate svg { stroke: #475569; }
.s3a-ref-sec-title { font-size: 0.84rem; font-weight: 700; color: #111318; flex: 1; }
.s3a-ref-sec-count {
    font-size: 0.7rem; font-weight: 700;
    padding: 2px 9px; border-radius: 20px;
    background: #f3f4f6; color: #6b7280;
}

/* Panels (individual signals) */
.s3a-ref-panel-list {
    background: #fff; border: 1px solid #e5e7eb; border-top: none;
    border-radius: 0 0 10px 10px; overflow: hidden;
}
.s3a-ref-panel { border-bottom: 1px solid #f3f4f6; }
.s3a-ref-panel:last-child { border-bottom: none; }
.s3a-ref-panel-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; cursor: pointer; user-select: none;
    transition: background 0.12s;
}
.s3a-ref-panel-header:hover { background: #fafbfc; }
.s3a-ref-accent { width: 3px; height: 16px; border-radius: 2px; flex-shrink: 0; }
.s3a-ref-accent-amber { background: #f59e0b; }
.s3a-ref-accent-red { background: #ef4444; }
.s3a-ref-accent-blue { background: #3b82f6; }
.s3a-ref-accent-slate { background: #94a3b8; }
.s3a-ref-panel-title { font-weight: 600; font-size: 0.82rem; color: #1a1d23; flex: 1; line-height: 1.4; }
.s3a-ref-panel-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }
.s3a-ref-panel-chevron {
    width: 15px; height: 15px; flex-shrink: 0; stroke: #9ca3af;
    transition: transform 0.25s ease;
}
.s3a-ref-panel.open .s3a-ref-panel-chevron { transform: rotate(180deg); }

.s3a-ref-panel-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease;
}
.s3a-ref-panel.open .s3a-ref-panel-body { max-height: 2000px; }

/* Card inside panel */
.s3a-ref-card {
    margin: 0 16px 14px; padding: 14px 18px;
    background: #f9fafb; border: 1px solid #eef0f2; border-radius: 8px;
}
.s3a-ref-field { margin-bottom: 12px; }
.s3a-ref-field:last-child { margin-bottom: 0; }
.s3a-ref-field-label {
    font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: #6b7280; font-weight: 700; margin-bottom: 3px;
}
.s3a-ref-field-value { font-size: 0.82rem; color: #374151; line-height: 1.6; }
.s3a-ref-field-quote {
    font-style: italic; color: #4b5563; font-size: 0.82rem;
    border-left: 3px solid #d1d5db; padding: 6px 12px;
    background: #fff; border-radius: 0 6px 6px 0; line-height: 1.6;
}
.s3a-ref-row { display: flex; gap: 20px; margin-bottom: 12px; }
.s3a-ref-half { flex: 1; min-width: 0; }

/* Tags, chips, badges */
.s3a-ref-tag {
    display: inline-block; padding: 2px 9px; border-radius: 6px;
    font-size: 0.72rem; font-weight: 500; margin: 2px 3px 2px 0; line-height: 1.5;
}
.s3a-ref-tag-init { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.s3a-ref-tag-metr { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.s3a-ref-chip {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 0.66rem; font-weight: 600;
}
.s3a-ref-chip-init { background: #ede9fe; color: #5b21b6; }
.s3a-ref-chip-metr { background: #dbeafe; color: #1e40af; }
.s3a-ref-badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 0.68rem; font-weight: 600; white-space: nowrap;
}
.s3a-ref-badge-healthy { background: #dcfce7; color: #166534; }
.s3a-ref-badge-act { background: #fef3c7; color: #92400e; }
.s3a-ref-badge-meas { background: #fee2e2; color: #991b1b; }
.s3a-ref-badge-inactive { background: #f3f4f6; color: #6b7280; }
.s3a-ref-badge-no-resp { background: #fee2e2; color: #991b1b; }
.s3a-ref-badge-implicit { background: #fef3c7; color: #92400e; }
.s3a-ref-badge-explicit { background: #dcfce7; color: #166534; }
.s3a-ref-empty-dash { color: #c4c8cf; font-size: 0.82rem; }

@media (max-width: 640px) {
    .s3a-ref-stats { grid-template-columns: repeat(2, 1fr); }
    .s3a-ref-row { flex-direction: column; gap: 10px; }
    .s3a-ref-panel-meta { display: none; }
    .s3a-ref-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}


/* ── Admin Panel ──────────────────────────────────────────────── */

.admin-tabs {
    display: flex;
    gap: 4px;
    margin-top: 12px;
}
.admin-tab {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
}
.admin-tab:hover {
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
}
.admin-tab.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.admin-msg {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: .85rem;
    margin-bottom: 18px;
}
.admin-msg-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.admin-msg-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.admin-msg-backfill {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.admin-msg-backfill .backfill-info {
    flex: 1;
}
.admin-msg-backfill .backfill-form {
    flex-shrink: 0;
}

.admin-form-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.admin-form-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--color-text);
}
.admin-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.admin-form .filter-group input[type="text"],
.admin-form .filter-group input[type="email"],
.admin-form .filter-group input[type="password"] {
    padding: 7px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
    min-width: 180px;
}
.admin-form .filter-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.role-admin {
    background: #ede9fe;
    color: #6d28d9;
}
.role-customer {
    background: #ecfdf5;
    color: #047857;
}
.role-org_admin {
    background: #eff6ff;
    color: #1d4ed8;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.btn-danger:hover {
    background: #fecaca;
    color: #b91c1c;
    text-decoration: none;
}

.reset-form {
    margin-top: 8px;
}
.reset-inline {
    display: flex;
    gap: 6px;
    align-items: center;
}
.reset-input {
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    width: 160px;
}
.reset-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.actions-cell {
    white-space: nowrap;
}

.num-cell {
    text-align: center;
}

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

.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.type-loop {
    background: #dbeafe;
    color: #1e40af;
}
.type-concern {
    background: #fee2e2;
    color: #991b1b;
}
.type-risk {
    background: #fef3c7;
    color: #92400e;
}

.os-content-cell {
    max-width: 500px;
    line-height: 1.45;
    font-size: 13px;
    white-space: normal;
    word-break: break-word;
}

.age-cell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
    font-weight: 500;
    color: var(--color-text-muted);
}

.sortable-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.sortable-header:hover {
    color: var(--color-primary);
}

.close-cell {
    white-space: nowrap;
    text-align: center;
    width: 60px;
}

.btn-close-signal {
    color: var(--color-text-muted);
    border-color: var(--color-border);
    font-size: 11px;
    padding: 3px 8px;
}
.btn-close-signal:hover {
    color: #dc2626;
    border-color: #dc2626;
    background: #fef2f2;
}

/* Dismiss mini-modal */
.dismiss-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.dismiss-container {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}
.dismiss-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}
.dismiss-header h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}
.dismiss-body {
    padding: 16px 20px;
}
.dismiss-body label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}
.dismiss-body textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    color: var(--color-text);
    background: var(--color-surface);
    box-sizing: border-box;
}
.dismiss-body textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}
.dismiss-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
}

/* Dismissal info in signal modals */
.dismissal-section {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 12px;
}
.dismissal-section .modal-section-label {
    color: #92400e;
}
.dismissal-meta {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ── Cost Report Table ─────────────────────────────────────────── */

.cost-table {
    font-size: 13px;
}
.cost-table th.cost-header {
    text-align: right;
    font-size: 12px;
    white-space: nowrap;
}
.cost-cell {
    text-align: right;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    white-space: nowrap;
}
.cost-zero {
    color: var(--color-text-muted);
}
.cost-total-col {
    font-weight: 600;
}
.cost-total-row td {
    border-top: 2px solid var(--color-border);
    background: var(--color-bg);
    font-weight: 600;
}
.org-name-cell {
    font-weight: 500;
    white-space: nowrap;
}

/* ── Org Settings Page ──────────────────────────────────────────── */

.org-link {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
.org-link:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.config-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.config-actions-top {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.config-layer {
    margin-bottom: 20px;
}
.config-layer-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--color-border);
}

.config-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.1s ease;
    font-size: 13px;
}
.config-checkbox:hover {
    background: var(--color-bg);
}
.config-checkbox-indented {
    padding-left: 28px;
}

.config-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.config-checkbox-label {
    font-weight: 500;
    color: var(--color-text);
}

.config-dep-hint {
    font-size: 11px;
    color: var(--color-text-muted);
    font-style: italic;
    margin-left: auto;
}

.config-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 600px) {
    .config-nav-grid {
        grid-template-columns: 1fr;
    }
}

.config-nav-group {
    min-width: 0;
}

.config-save {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

/* ── Pipeline Status Badges ─────────────────────────────────────── */

.pipeline-status-cell {
    white-space: nowrap;
}

.pipeline-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.pipeline-completed {
    background: #f0fdf4;
    color: #166534;
}
.pipeline-running {
    background: #eff6ff;
    color: #1d4ed8;
    animation: pipeline-pulse 2s ease-in-out infinite;
}
.pipeline-queued {
    background: #fefce8;
    color: #854d0e;
}
.pipeline-failed {
    background: #fef2f2;
    color: #991b1b;
    cursor: help;
}
.pipeline-partial {
    background: #fffbeb;
    color: #92400e;
}
.pipeline-retry-btn {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border: 1px solid #d97706;
    border-radius: 10px;
    background: #fff;
    color: #d97706;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    vertical-align: middle;
    transition: background 0.15s, color 0.15s;
}
.pipeline-retry-btn:hover {
    background: #d97706;
    color: #fff;
}
.pipeline-retry-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Run Prompt Dropdown ──────────────────────────────────── */
.run-prompt-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 4px 0;
}
.run-prompt-group {
    padding: 6px 12px 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}
.run-prompt-item {
    display: block;
    width: 100%;
    padding: 6px 14px;
    border: none;
    background: none;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-text);
}
.run-prompt-item:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}
.run-prompt-loading,
.run-prompt-error {
    padding: 8px 14px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.pipeline-none {
    color: var(--color-text-muted);
    font-weight: 400;
}

@keyframes pipeline-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}


/* ── Proposed Initiatives: Accept / Ignore buttons ────────────────── */

.ci-action-btns {
    display: flex;
    gap: 6px;
    margin-left: auto;
    margin-right: 8px;
    flex-shrink: 0;
}
.btn-accept-canonical {
    background: #16a34a;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn-accept-canonical:hover { background: #15803d; }
.btn-ignore-canonical {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #cbd5e1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
}
.btn-ignore-canonical:hover { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }

/* Ignored section at bottom */
.ci-ignored-section {
    margin-top: 24px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}
.ci-ignored-toggle {
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
}
.ci-ignored-toggle:hover { color: #334155; }
.ci-ignored-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}
.ci-ignored-list {
    margin-top: 8px;
}
.ci-ignored-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9em;
}
.ci-ignored-label {
    flex: 1;
    color: #64748b;
}
.btn-restore-canonical {
    background: transparent;
    color: #3b82f6;
    border: 1px solid #93c5fd;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    cursor: pointer;
    white-space: nowrap;
}
.btn-restore-canonical:hover { background: #eff6ff; }

/* Accept modal */
.accept-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.accept-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 460px;
    overflow: hidden;
}
.accept-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.accept-body {
    padding: 16px 20px;
}
.accept-body .filter-group { margin-bottom: 12px; }
.accept-body .filter-group:last-child { margin-bottom: 0; }
.accept-body input[type="text"],
.accept-body textarea {
    font-family: inherit;
    font-size: 0.95em;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
}
.accept-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.btn-accept-confirm {
    background: #16a34a;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
.btn-accept-confirm:hover { background: #15803d; }
.btn-ghost {
    background: transparent;
    color: #64748b;
    border: 1px solid #cbd5e1;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}
.btn-ghost:hover { background: #f1f5f9; }

/* ── Convert to Initiative button (Open Signals) ──────────────────── */

.btn-convert-signal {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    margin-right: 4px;
}
.btn-convert-signal:hover { background: #2563eb; }

/* ── Initiatives Board ────────────────────────────────────────────── */

.btn-new-initiative {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn-new-initiative:hover { background: #2563eb; }

/* Status badges */
.mi-status-select {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    background: #fff;
}
.mi-status-select.mi-status-open { color: #2563eb; border-color: #93c5fd; }
.mi-status-select.mi-status-in_progress { color: #d97706; border-color: #fcd34d; }
.mi-status-select.mi-status-done { color: #16a34a; border-color: #86efac; }
.mi-status-select.mi-status-cancelled { color: #64748b; border-color: #cbd5e1; }
/* Experiment statuses */
.mi-status-select.mi-status-proposed { color: #7c3aed; border-color: #c4b5fd; }
.mi-status-select.mi-status-active { color: #2563eb; border-color: #93c5fd; }
.mi-status-select.mi-status-completed { color: #16a34a; border-color: #86efac; }
.mi-status-select.mi-status-deferred { color: #d97706; border-color: #fcd34d; }
/* Experiment outcomes */
.mi-status-select.mi-status-success { color: #16a34a; border-color: #86efac; }
.mi-status-select.mi-status-failure { color: #dc2626; border-color: #fca5a5; }
.mi-status-select.mi-status-inconclusive { color: #d97706; border-color: #fcd34d; }

/* Experiment pill buttons */
.exp-pill {
    padding: 5px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    color: #64748b;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.15s ease;
}
.exp-pill:hover {
    border-color: #93c5fd;
    color: #2563eb;
}
.exp-pill.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* Status badges (for detail popup) */
.mi-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: capitalize;
}
.mi-status-badge.mi-status-open { background: #dbeafe; color: #2563eb; }
.mi-status-badge.mi-status-in_progress { background: #fef3c7; color: #d97706; }
.mi-status-badge.mi-status-done { background: #dcfce7; color: #16a34a; }
.mi-status-badge.mi-status-cancelled { background: #f1f5f9; color: #64748b; }

/* Source badges */
.source-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}
.source-canonical {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}
.source-signal {
    background: #fefce8;
    color: #a16207;
    border: 1px solid #fde68a;
    cursor: pointer;
}
.source-signal:hover { background: #fef9c3; }

/* Action buttons */
.actions-cell {
    white-space: nowrap;
}
.btn-edit-init, .btn-delete-init {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1em;
    padding: 4px 6px;
    border-radius: 4px;
    opacity: 0.5;
}
.btn-edit-init:hover { background: #f1f5f9; opacity: 1; }
.btn-delete-init:hover { background: #fef2f2; opacity: 1; }

/* ── Chat Agent ──────────────────────────────────────────────────── */
.chat-layout {
    display: flex;
    height: calc(100vh - 220px);
    min-height: 400px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.chat-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.88em;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.chat-history-count {
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.8em;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
}
.chat-history-list {
    flex: 1;
    overflow-y: auto;
}
.chat-history-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    border-left: 3px solid transparent;
    transition: background 0.12s;
}
.chat-history-item:hover {
    background: #f1f5f9;
}
.chat-history-item.active {
    background: #eff6ff;
    border-left-color: #3b82f6;
}
.chat-history-q {
    font-size: 0.88em;
    color: #1e293b;
    line-height: 1.4;
    word-break: break-word;
}
.chat-history-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.chat-history-time {
    font-size: 0.75em;
    color: #94a3b8;
}
.chat-history-badge {
    font-size: 0.7em;
    color: #64748b;
    background: #e2e8f0;
    padding: 1px 6px;
    border-radius: 8px;
}
.chat-history-empty {
    padding: 24px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.88em;
}
.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    background: #fff;
    overflow: hidden;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
.chat-welcome {
    text-align: center;
    color: #64748b;
    padding: 40px 20px;
}
.chat-welcome h3 {
    margin: 0 0 8px 0;
    color: #334155;
    font-size: 1.1em;
}
.chat-welcome ul {
    list-style: none;
    padding: 0;
    margin: 16px 0 0 0;
}
.chat-welcome li {
    margin: 8px 0;
}
.chat-example-q {
    color: #3b82f6;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95em;
}
.chat-example-q:hover {
    text-decoration: underline;
}
.chat-msg {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}
.chat-msg-user {
    align-items: flex-end;
}
.chat-msg-user .chat-bubble {
    background: #3b82f6;
    color: #fff;
    border-radius: 12px 12px 4px 12px;
    max-width: 70%;
}
.chat-msg-assistant {
    align-items: flex-start;
}
.chat-msg-assistant .chat-bubble {
    background: #f1f5f9;
    color: #1e293b;
    border-radius: 12px 12px 12px 4px;
    max-width: 80%;
}
.chat-msg-error {
    align-items: flex-start;
}
.chat-msg-error .chat-bubble {
    background: #fef2f2;
    color: #dc2626;
    border-radius: 12px;
    max-width: 80%;
}
.chat-bubble {
    padding: 10px 16px;
    line-height: 1.5;
    word-wrap: break-word;
    font-size: 0.95em;
}
.chat-bubble p {
    margin: 0 0 8px 0;
}
.chat-bubble p:last-child {
    margin-bottom: 0;
}
.chat-bubble ul {
    margin: 4px 0;
    padding-left: 20px;
}
.chat-bubble li {
    margin: 2px 0;
}
.chat-citation {
    background: #e0f2fe;
    color: #0369a1;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.88em;
    white-space: nowrap;
}
.chat-meta {
    font-size: 0.78em;
    color: #94a3b8;
    margin-top: 4px;
    padding: 0 4px;
}
.chat-loading {
    color: #64748b;
    font-style: italic;
}
.dot-anim {
    animation: dotBlink 1.4s infinite;
}
@keyframes dotBlink {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}
.chat-error-text {
    font-weight: 500;
}
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.chat-input-area textarea {
    flex: 1;
    resize: none;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95em;
    font-family: inherit;
    line-height: 1.4;
    max-height: 120px;
    outline: none;
}
.chat-input-area textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.chat-input-area .btn {
    height: 40px;
    padding: 0 20px;
    flex-shrink: 0;
}

/* ── Priority Badges ─────────────────────────────────────── */
.priority-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}
.priority-high   { background: #fee2e2; color: #991b1b; }
.priority-medium { background: #fef3c7; color: #92400e; }
.priority-low    { background: #f3f4f6; color: #6b7280; }

/* ── Open Signals: compact header & filters ─────────────── */
.os-page .page-header {
    margin-bottom: 8px;
}
.os-page .page-header h1 {
    font-size: 20px;
    margin-bottom: 0;
}
.os-page .subtitle {
    font-size: 13px;
}
.os-page .filter-bar {
    padding: 8px 14px;
    margin-bottom: 6px;
    gap: 10px;
}
.os-page .filter-bar .filter-group label {
    font-size: 10px;
    margin-bottom: 0;
}
.os-page .filter-bar .filter-group select {
    padding: 5px 8px;
    font-size: 12px;
}
.os-page .filter-bar .btn { padding: 5px 14px; font-size: 12px; }
.os-page .inline-filters {
    margin-top: -2px;
    margin-bottom: 4px;
    gap: 10px;
}
.os-page .inline-filters .filter-group label {
    font-size: 10px;
}
.os-page .inline-filters .filter-group select {
    padding: 5px 8px;
    font-size: 12px;
}
.os-page .advisor-filter-banner {
    padding: 5px 12px;
    margin-bottom: 4px;
    font-size: 0.82em;
}

/* ── Open Signals Layout (table + advisor sidebar) ────────── */
.os-layout {
    display: flex;
    gap: 0;
    min-height: 300px;
    /* height is set dynamically by JS adjustLayoutHeight() */
}
.os-table-area {
    flex: 1;
    min-width: 0;
    overflow: auto;
}
.os-layout .table-wrapper {
    height: 100%;
    overflow: auto;
}

/* Advisor sidebar — hidden by default */
.advisor-sidebar {
    display: none;
    width: 35%;
    min-width: 320px;
    max-width: 420px;
    flex-shrink: 0;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 0 8px 8px 0;
    background: #fff;
    overflow: hidden;
}
.os-layout.advisor-open .advisor-sidebar {
    display: flex;
}
.os-layout.advisor-open .os-table-area {
    border-right: none;
    border-radius: 8px 0 0 8px;
    border: 1px solid #e2e8f0;
    border-right: none;
}

/* ── Compact table when advisor is open ──────────────────── */
/* Hide ID column */
.os-layout.advisor-open .th-id,
.os-layout.advisor-open .id-cell {
    display: none;
}
/* Hide detail/strength/horizon column */
.os-layout.advisor-open .th-detail,
.os-layout.advisor-open .detail-cell {
    display: none;
}
/* Let content column breathe */
.os-layout.advisor-open .os-content-cell {
    max-width: none;
}
/* Compact padding */
.os-layout.advisor-open .meeting-table th,
.os-layout.advisor-open .meeting-table td {
    padding: 8px 8px;
}
/* Convert & Close → icon buttons */
.os-layout.advisor-open .btn-convert-signal {
    font-size: 0;
    padding: 4px 7px;
    min-width: auto;
    line-height: 1;
}
.os-layout.advisor-open .btn-convert-signal::before {
    content: "↗";
    font-size: 14px;
}
.os-layout.advisor-open .btn-close-signal {
    font-size: 0;
    padding: 4px 7px;
    min-width: auto;
    line-height: 1;
}
.os-layout.advisor-open .btn-close-signal::before {
    content: "✕";
    font-size: 13px;
}
.os-layout.advisor-open .close-cell {
    width: auto;
    padding: 8px 4px;
}
/* Advisor tabs */
.advisor-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.advisor-tab {
    flex: 1;
    padding: 10px 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.88em;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.advisor-tab:hover { color: #334155; }
.advisor-new-chat {
    flex: none;
    margin-left: auto;
    font-size: 0.8em;
    padding: 4px 10px;
    align-self: center;
    color: #3b82f6;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    margin-right: 6px;
}
.advisor-new-chat:hover {
    background: #3b82f6;
    color: #fff;
}
.chat-input-area .advisor-new-chat {
    align-self: center;
    flex-shrink: 0;
    margin-left: 0;
    margin-right: 0;
    font-size: 0.88em;
}
.advisor-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}
.advisor-history-count {
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.8em;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}
.advisor-history-count:empty { display: none; }

/* Advisor panels */
.advisor-panel {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.advisor-messages {
    padding: 16px;
}

/* Advisor welcome */
.advisor-welcome {
    text-align: center;
    color: #64748b;
    padding: 20px 12px;
}
.advisor-welcome h3 {
    margin: 0 0 6px 0;
    color: #334155;
    font-size: 1em;
}
.advisor-welcome p {
    font-size: 0.88em;
    margin: 0 0 12px 0;
}
.advisor-welcome ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.advisor-welcome li { margin: 6px 0; }
.advisor-example-q {
    color: #3b82f6;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.88em;
}
.advisor-example-q:hover { text-decoration: underline; }

/* Advisor input — fixed at bottom */
.advisor-input-area {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}
.advisor-input-area textarea {
    flex: 1;
    resize: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.9em;
    font-family: inherit;
    line-height: 1.3;
    max-height: 80px;
    outline: none;
}
.advisor-input-area textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Advisor history list */
.advisor-history-list {
    padding: 0;
}
.advisor-history-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    border-left: 3px solid transparent;
    transition: background 0.12s;
}
.advisor-history-item:hover { background: #f1f5f9; }
.advisor-history-item.active {
    background: #eff6ff;
    border-left-color: #3b82f6;
}
.advisor-history-q {
    font-size: 0.85em;
    color: #1e293b;
    line-height: 1.35;
    word-break: break-word;
}
.advisor-history-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}
.advisor-history-time {
    font-size: 0.72em;
    color: #94a3b8;
}
.advisor-history-badge {
    font-size: 0.7em;
    color: #64748b;
    background: #e2e8f0;
    padding: 1px 6px;
    border-radius: 8px;
}
.advisor-history-empty {
    padding: 24px 14px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.88em;
}

/* Advisor filter banner */
.advisor-filter-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-size: 0.88em;
    color: #1e40af;
    margin-bottom: 8px;
}
.advisor-filter-icon {
    font-size: 1.1em;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — Hamburger Nav, Stacked Filters, Card Views
   ═══════════════════════════════════════════════════════════════════ */

/* ── Hamburger Button (hidden on desktop) ─────────────────────── */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile User Section (hidden on desktop) ──────────────────── */
.mobile-user-section { display: none; }

/* ── Card View (hidden on desktop, shown on mobile) ───────────── */
.card-view { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   TABLET — max-width: 768px
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* ── Hamburger visible ──────────────────────────────────────── */
    .hamburger { display: flex; }

    /* ── Top bar ────────────────────────────────────────────────── */
    .top-bar-inner {
        gap: 12px;
        padding: 0 12px;
        flex-wrap: wrap;
        height: auto;
        min-height: 48px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    /* ── Navigation — vertical dropdown ─────────────────────────── */
    .top-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 2px;
        padding: 8px 0;
        border-top: 1px solid var(--color-border);
        order: 10;
        max-height: 70vh;
        overflow-y: auto;
    }
    .top-nav.nav-open { display: flex; }

    .top-nav .nav-link {
        padding: 10px 12px;
        font-size: 15px;
        width: 100%;
    }

    /* Dropdowns: always visible when nav is open, no hover needed */
    .top-nav .nav-dropdown {
        padding-bottom: 0;
        margin-bottom: 0;
    }
    .top-nav .nav-dropdown-trigger { display: none; }
    .top-nav .nav-dropdown-menu {
        display: block;
        position: static;
        box-shadow: none;
        border: none;
        padding: 0;
        min-width: auto;
    }
    .top-nav .nav-dd-item {
        padding: 10px 12px;
        font-size: 15px;
    }

    /* Desktop user section — hide */
    .nav-user { display: none; }

    /* Mobile user section — show inside nav */
    .mobile-user-section {
        display: flex;
        flex-direction: column;
        gap: 2px;
        border-top: 1px solid var(--color-border);
        padding-top: 8px;
        margin-top: 4px;
    }
    .mobile-user-section .nav-user-name {
        padding: 6px 12px;
        font-size: 13px;
    }
    .mobile-user-section .nav-link {
        padding: 10px 12px;
        font-size: 15px;
    }

    /* ── Content area ───────────────────────────────────────────── */
    .content { padding: 16px 12px; }

    /* ── Page header — stack ────────────────────────────────────── */
    .page-header h1 { font-size: 20px; }
    .page-header > div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    /* ── Filter bar — stack vertically ──────────────────────────── */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }
    .filter-group select,
    .filter-group input[type="date"] {
        min-width: auto;
        width: 100%;
    }
    .filter-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    .filter-actions .btn {
        min-height: 40px;
        flex: 1;
    }
    .filter-actions button[onclick*="QuickUpload"] {
        margin-left: 0 !important;
        width: 100%;
        flex: none;
    }

    /* ── Tables — allow horizontal scroll ───────────────────────── */
    .table-wrapper { margin: 0 -12px; padding: 0 12px; }

    /* ── Modals — near fullscreen ───────────────────────────────── */
    .modal-container,
    .exp-detail-modal {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        margin: 5vh auto !important;
        padding: 12px !important;
    }

    /* ── Section headings ───────────────────────────────────────── */
    .section-heading { font-size: 16px; }

    /* ── Agenda widget ──────────────────────────────────────────── */
    .agenda-add { flex-direction: column; }
    .agenda-add button { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════
   PHONE — max-width: 480px
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    /* ── Show card views, hide tables ───────────────────────────── */
    .card-view { display: block; }
    .card-view-hide-table { display: none !important; }

    /* ── Card styles ────────────────────────────────────────────── */
    .action-card {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        padding: 12px;
        margin-bottom: 8px;
    }
    .action-card-header {
        display: flex;
        align-items: flex-start;
        gap: 10px;
    }
    .action-card-header input[type="checkbox"] {
        min-width: 22px;
        min-height: 22px;
        margin-top: 2px;
        accent-color: var(--color-primary);
    }
    .action-card-text {
        font-size: 14px;
        font-weight: 500;
        color: var(--color-text);
        line-height: 1.4;
        flex: 1;
    }
    .action-card-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 16px;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #f3f4f6;
        font-size: 12px;
        color: var(--color-text-muted);
    }
    .action-card-meta span { white-space: nowrap; }
    .action-card-meta strong { color: var(--color-text); font-weight: 600; }
    .action-card.fading {
        opacity: 0;
        max-height: 0;
        padding: 0;
        margin: 0;
        overflow: hidden;
        transition: all 0.3s ease;
    }
    .action-card-expand {
        border-top: 1px solid #f3f4f6;
        margin-top: 10px;
        padding-top: 10px;
    }
    .card-edit-row {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 8px;
    }
    .card-edit-row label {
        font-size: 12px;
        font-weight: 600;
        color: var(--color-text-muted);
        min-width: 50px;
    }
    .card-edit-select, .card-edit-input {
        flex: 1;
        padding: 8px 10px;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-sm);
        font-size: 14px;
        font-family: inherit;
        min-height: 40px;
    }
    .card-evidence {
        font-size: 12px;
        color: var(--color-text-muted);
        margin-top: 8px;
        line-height: 1.5;
    }
    .card-evidence strong { color: var(--color-text); }

    .exp-card {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        padding: 12px;
        margin-bottom: 8px;
        cursor: pointer;
    }
    .exp-card:active { background: var(--color-row-hover); }
    .exp-card-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--color-text);
        margin-bottom: 6px;
    }
    .exp-card-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 14px;
        font-size: 12px;
        color: var(--color-text-muted);
    }
    .exp-card-meta strong { color: var(--color-text); font-weight: 600; }

    /* ── Status badges on cards ─────────────────────────────────── */
    .card-status {
        display: inline-block;
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 11px;
        font-weight: 600;
    }
    .card-status-new { background: #dbeafe; color: #1e40af; }
    .card-status-completed { background: #d1fae5; color: #065f46; }
    .card-status-in_progress { background: #fef3c7; color: #92400e; }
    .card-status-deferred { background: #f3f4f6; color: #6b7280; }
    .card-status-active { background: #dbeafe; color: #1e40af; }
    .card-status-proposed { background: #ede9fe; color: #5b21b6; }
    .card-status-paused { background: #fef3c7; color: #92400e; }

    /* ── Smaller page title ─────────────────────────────────────── */
    .page-header h1 { font-size: 18px; }
    .subtitle { font-size: 12px; }

    /* ── Touch-friendly buttons ─────────────────────────────────── */
    .btn, .btn-primary, .btn-ghost,
    .btn-new-initiative, .btn-export {
        min-height: 44px;
        font-size: 14px;
    }

    /* ── Experiment inline filters ──────────────────────────────── */
    .exp-filters {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .exp-filters select {
        width: 100% !important;
        min-width: auto !important;
    }

    /* ── Create action modal ────────────────────────────────────── */
    .create-action-modal {
        width: 95vw !important;
        max-width: 95vw !important;
        padding: 12px !important;
    }

    /* ── Quick upload modal ─────────────────────────────────────── */
    .quick-upload-card {
        width: 95vw !important;
        max-width: 95vw !important;
        padding: 16px !important;
    }
}
