/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Instrument+Serif:ital@0;1&display=swap');

.hidden {
    display: none !important;
}

/* ── Design tokens — Variant B (Narrative) ─────────────────── */
:root {
    /* Surfaces — warm off-whites */
    --bg-0: #f6f4ef;
    --bg-1: #ffffff;
    --bg-2: #fbfaf6;
    --bg-3: #f1eee7;
    --bg-4: #e8e4da;
    --bg-hover: #f7f5ef;

    /* Borders */
    --border-1: #e7e3d8;
    --border-2: #d8d3c5;
    --border-strong: #b8b2a0;

    /* Text */
    --fg-0: #16150f;
    --fg-1: #2e2c22;
    --fg-2: #5a5648;
    --fg-3: #8a8573;
    --fg-4: #b5b09c;

    /* Accent — deep indigo */
    --accent: oklch(0.42 0.19 275);
    --accent-dim: oklch(0.62 0.14 275);
    --accent-bg: oklch(0.42 0.19 275 / 0.08);
    --accent-fg: #ffffff;

    /* Signals */
    --good: oklch(0.52 0.16 150);
    --good-bg: oklch(0.52 0.16 150 / 0.1);
    --warn: oklch(0.65 0.15 65);
    --warn-bg: oklch(0.65 0.15 65 / 0.12);
    --bad: oklch(0.55 0.22 28);
    --bad-bg: oklch(0.55 0.22 28 / 0.10);
    --info: oklch(0.50 0.13 245);
    --info-bg: oklch(0.50 0.13 245 / 0.08);

    /* Chart palette */
    --c-1: oklch(0.42 0.19 275);
    --c-2: oklch(0.55 0.22 28);
    --c-3: oklch(0.52 0.16 150);
    --c-4: oklch(0.65 0.15 65);
    --c-5: oklch(0.50 0.13 245);
    --c-6: oklch(0.55 0.18 330);
    --c-7: oklch(0.60 0.12 200);
    --c-8: oklch(0.45 0.10 50);

    /* Typography */
    --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --font-display: 'Instrument Serif', 'Times New Roman', serif;

    /* Radii */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;

    /* Shadows */
    --shadow-1: 0 1px 2px rgba(22, 21, 15, 0.04);
    --shadow-2: 0 4px 16px rgba(22, 21, 15, 0.06);
    --shadow-pop: 0 20px 60px rgba(22, 21, 15, 0.12), 0 0 0 1px var(--border-1);

    /* ── Backward-compat aliases (existing CSS keeps working) ── */
    --color-primary: var(--accent);
    --color-primary-hover: var(--accent-dim);
    --color-bg: var(--bg-0);
    --color-surface: var(--bg-1);
    --color-border: var(--border-1);
    --color-text: var(--fg-0);
    --color-muted: var(--fg-3);
    --color-success: var(--good);
    --color-danger: var(--bad);
    --radius: var(--r-md);
    --shadow: var(--shadow-2);
}

/* Tabular numbers utility */
.num {
    font-family: var(--font-mono);
    font-feature-settings: 'tnum';
    letter-spacing: -0.01em;
}

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

body {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--fg-0);
    background: var(--bg-0);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-4);
    border-radius: 10px;
    border: 2px solid var(--bg-0);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

::selection {
    background: var(--accent);
    color: var(--accent-fg);
}

/* ── Login page ───────────────────────────────────────────── */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-icon {
    margin-bottom: 20px;
}

.login-icon svg {
    width: 56px;
    height: 56px;
}

.login-card h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--color-muted);
    margin-bottom: 32px;
    font-size: 13px;
    line-height: 1.5;
}

.login-hint {
    margin-top: 14px;
    font-size: 12px;
    color: var(--color-muted);
    opacity: 0.8;
}

.btn-oauth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    color: #fff;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.15s;
}

.btn-oauth:hover {
    opacity: 0.88;
}

.btn-oauth svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-github {
    background: #24292e;
}

.alert {
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 20px;
    font-size: 13px;
}

.alert-success {
    background: #e9f8ef;
    color: var(--color-success);
}

.alert-error {
    background: #fce8e4;
    color: var(--color-danger);
}

/* ── App layout ───────────────────────────────────────────── */

.app-layout {
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ── Topbar (new shell) ───────────────────────────────────── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 16px;
    gap: 12px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border-1);
}

/* Logo */
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.topbar-brand-logo {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.topbar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 2px;
}

.topbar-brand-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--fg-0);
    letter-spacing: -0.01em;
}

.topbar-brand-sub {
    font-size: 9px;
    color: var(--fg-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar-divider {
    width: 1px;
    height: 22px;
    background: var(--border-1);
    flex-shrink: 0;
}

/* Nav tabs */
.topbar-nav {
    display: flex;
    gap: 2px;
    flex: 1;
}

.nav-link {
    padding: 6px 12px;
    border-radius: var(--r-md);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-2);
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--bg-3);
    color: var(--fg-0);
}

.nav-link-active {
    background: var(--bg-3);
    color: var(--fg-0);
    font-weight: 600;
}

.nav-link-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-badge-soon {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--bg-4);
    color: var(--fg-3);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Search placeholder */
.topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    border-radius: var(--r-md);
    color: var(--fg-3);
    font-size: 12px;
    min-width: 180px;
    cursor: pointer;
    transition: border-color 0.15s;
    font-family: var(--font-sans);
}

.topbar-search:hover {
    border-color: var(--border-2);
}

.topbar-kbd {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    background: var(--bg-3);
    border: 1px solid var(--border-2);
    border-radius: 4px;
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--fg-3);
    margin-left: auto;
}

/* User area */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 10px 3px 4px;
    border-radius: 20px;
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    flex-shrink: 0;
}

.avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.topbar-username {
    font-size: 12px;
    font-weight: 500;
    color: var(--fg-0);
}

.btn-logout {
    background: none;
    border: none;
    padding: 5px 10px;
    font-size: 12px;
    color: var(--fg-3);
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: color 0.15s;
    flex-shrink: 0;
}

.btn-logout:hover {
    color: var(--bad);
}

/* Sync status pill */
.sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border-1);
    background: var(--bg-2);
    cursor: pointer;
    transition: border-color 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}

.sync-pill:hover {
    border-color: var(--border-2);
}

.sync-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sync-pill-ok .sync-pill-dot {
    background: var(--good);
}

.sync-pill-run .sync-pill-dot {
    background: var(--warn);
    animation: sync-blink 1s ease-in-out infinite;
}

.sync-pill-error .sync-pill-dot {
    background: var(--bad);
}

.sync-pill-ok {
    color: var(--fg-2);
}

.sync-pill-run {
    color: var(--warn);
    border-color: var(--warn-bg);
    background: var(--warn-bg);
}

.sync-pill-error {
    color: var(--bad);
    border-color: var(--bad-bg);
    background: var(--bad-bg);
}

@keyframes sync-blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* ── Sidebar (new design) ─────────────────────────────────── */

.report-sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--bg-1);
    border-right: 1px solid var(--border-1);
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 14px;
    gap: 20px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-3);
    margin-bottom: 4px;
    padding: 0 2px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: var(--r-sm);
    min-width: 0;
    transition: background 0.1s;
}

.sidebar-item:hover {
    background: var(--bg-hover);
}

.sidebar-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--fg-1);
    cursor: default;
}

.sidebar-item-inactive {
    color: var(--fg-3);
}

.sidebar-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-active {
    background: var(--good);
}

.dot-inactive {
    background: var(--border-2);
}

.dot-stale {
    background: var(--warn);
}

.dot-failed {
    background: var(--bad);
}

.sidebar-user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-sans);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0;
}

.sidebar-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--fg-3);
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.1s, color 0.1s, background 0.1s;
}

.sidebar-item:hover .sidebar-icon-btn {
    opacity: 1;
}

.sidebar-icon-btn:hover {
    background: var(--bg-3);
    color: var(--fg-0);
}

.sidebar-icon-btn-danger:hover {
    color: var(--bad);
    background: var(--bad-bg);
}

.sidebar-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    background: none;
    border: 1px dashed var(--border-2);
    border-radius: var(--r-sm);
    padding: 5px 8px;
    font-size: 12px;
    color: var(--fg-3);
    cursor: pointer;
    margin-top: 4px;
    transition: border-color 0.15s, color 0.15s;
    text-align: left;
    font-family: var(--font-sans);
}

.sidebar-add-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.sidebar-inactive-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--fg-3);
    margin-top: 6px;
    padding: 0 2px;
    cursor: pointer;
}

.sidebar-inactive-toggle input {
    accent-color: var(--accent);
    cursor: pointer;
}

/* Sidebar footer — beta widget */
.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    border-radius: var(--r-md);
}

.sidebar-footer-link {
    font-size: 12px;
    color: var(--fg-3);
    text-decoration: none;
    transition: color 0.15s;
    display: block;
    text-align: center;
}

.sidebar-footer-link:hover {
    color: var(--accent);
}

/* ── Main content areas ────────────────────────────────────── */

.main-content {
    padding: 24px 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ── Page header — title left, period control right ─────── */

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

.page-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.dora-action-btns {
    display: flex;
    gap: 6px;
    margin-right: 8px;
}

.dora-action-btn {
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-mono);
    padding: 5px 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-1);
    background: var(--bg-1);
    color: var(--fg-2);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.dora-action-btn:hover {
    background: var(--bg-2);
    color: var(--fg-0);
    border-color: var(--border-2);
}

.dora-action-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.page-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--fg-0);
    margin: 0 0 4px;
    line-height: 1.15;
}

.page-title-workspace {
    color: var(--fg-3);
}

.page-subtitle {
    color: var(--fg-2);
    font-size: 13px;
    line-height: 1.4;
}

/* ── Segmented period control ────────────────────────────── */

.period-segmented {
    display: inline-flex;
    background: var(--bg-2);
    border-radius: var(--r-md);
    padding: 3px;
    border: 1px solid var(--border-1);
    gap: 2px;
}

.period-seg-btn {
    padding: 5px 12px;
    border-radius: calc(var(--r-md) - 2px);
    background: transparent;
    color: var(--fg-2);
    font-size: 12px;
    font-weight: 500;
    border: none;
    outline: none;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}

.period-seg-btn:hover {
    background: var(--bg-3);
    color: var(--fg-1);
}

.period-seg-btn-active {
    background: var(--bg-4);
    color: var(--fg-0);
    box-shadow: var(--shadow-1);
}

/* ── Repo filter row (below header, subtle) ──────────────── */

.repo-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ── Cards ────────────────────────────────────────────────── */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

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

.card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
    margin-bottom: 8px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

/* ── Tables ───────────────────────────────────────────────── */

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

.table-card {
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: var(--r-lg);
    overflow: hidden;
}

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

.table-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg-0);
}

.table-card-subtitle {
    font-size: 11px;
    color: var(--fg-3);
    margin-top: 2px;
}

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

.data-table th {
    background: var(--bg-2);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-3);
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border-1);
    white-space: nowrap;
}

.data-table th:first-child {
    text-align: left;
}

.data-table th.th-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.data-table th.th-sortable:hover {
    color: var(--accent);
}

.data-table th.th-sort-active {
    color: var(--accent);
}

/* Clickable/hintable table headers */
.data-table th[data-tip] {
    cursor: default;
}

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

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

.data-table tr:hover td {
    background: var(--bg-hover);
}

.report-row {
    cursor: pointer;
}

.report-row.row-inactive td {
    opacity: 0.5;
}

.report-row.row-inactive:hover td {
    opacity: 0.75;
}

.user-cell-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-inactive-hint {
    font-size: 10px;
    color: var(--color-muted);
    font-weight: 400;
}

.report-row.row-focused td {
    background: #fff8f5;
}

.report-row.row-focused .user-name {
    color: var(--color-primary);
    font-weight: 600;
}

.report-row.row-highlighted td {
    background: var(--accent-bg);
}

.report-row.row-highlighted .user-name {
    color: var(--accent);
    font-weight: 600;
}

/* MR drill-down table */
.mr-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mr-detail-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.mr-detail-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

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

.mr-detail-table tbody tr:hover td {
    background: var(--color-bg);
}

.mr-td-title {
    max-width: 380px;
}

.mr-td-repo {
    color: var(--color-muted);
    font-size: 12px;
    white-space: nowrap;
}

.mr-td-date {
    white-space: nowrap;
    color: var(--color-muted);
    font-size: 12px;
}

.mr-td-ttm {
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.mr-td-num {
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: .85rem;
    color: #555;
}

.mr-title-link {
    color: var(--color-text);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mr-title-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.mr-list-loading,
.mr-list-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--color-muted);
    font-size: 13px;
}

/* MR drill-down: summary strip */
.mr-summary-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.mr-summary-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-muted);
    white-space: nowrap;
}

.mr-summary-pill b {
    color: var(--color-text);
    font-weight: 600;
}

.mr-summary-pill-warn {
    border-color: #f5c6aa;
    background: #fff4ee;
    color: #a84800;
}

.mr-summary-pill-warn b {
    color: #a84800;
}

.mr-th-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.mr-th-sort:hover {
    color: var(--color-primary);
}

.mr-sort-icon {
    font-size: 10px;
    opacity: 0.8;
}

.mr-summary-pill[data-filter] {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.mr-summary-pill[data-filter]:hover {
    border-color: var(--color-primary);
}

.mr-summary-pill-active {
    background: #fff4f0 !important;
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
}

.mr-summary-pill-active b {
    color: var(--color-primary) !important;
}

/* MR drill-down: scrollable table wrapper */
.mr-table-wrap {
    overflow-y: auto;
    max-height: 60vh;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.mr-table-wrap .mr-detail-table {
    border: none;
}

.mr-table-wrap .mr-detail-table thead th {
    position: sticky;
    top: 0;
    background: #f8f9fb;
    z-index: 1;
    /* compensate border-collapse stripping borders on sticky rows */
    box-shadow: inset 0 -1px 0 var(--color-border);
}

/* Generic tooltip — mirrors th.th-hint but works on any inline/inline-block element */
.tooltip-hint {
    cursor: default;
    position: relative;
    text-decoration: underline dotted var(--color-border);
    text-underline-offset: 3px;
    transition: color 0.15s;
}

.tooltip-hint:hover {
    color: var(--color-primary);
    text-decoration-color: var(--color-primary);
}

.tooltip-hint::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1f2329;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 8px;
    width: 210px;
    white-space: normal;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.tooltip-hint:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Sort icon */
.th-sort-icon {
    font-size: 9px;
    opacity: 0.65;
    vertical-align: middle;
    margin-left: 1px;
}

/* Sortable headers */
.report-table thead th {
    cursor: pointer;
    user-select: none;
}

.report-table thead th:hover {
    color: var(--accent);
}

.chart-legend-item:hover {
    color: var(--fg-0);
    cursor: pointer;
}

.chart-legend-item.legend-item-active {
    color: var(--fg-0);
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-active {
    background: #e9f8ef;
    color: var(--color-success);
}

.badge-inactive {
    background: #f4f5f7;
    color: var(--color-muted);
}

.badge-bot {
    background: #fef3c7;
    color: #b45309;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-left: 8px;
    padding: 2px 8px;
}

.discovery-row-bot {
    opacity: 0.5;
}

.discovery-row-bot .discovery-name,
.discovery-row-bot .discovery-email,
.discovery-row-bot .discovery-meta {
    color: var(--color-muted);
}

.discovery-avatar-bot {
    background: #d1d5db !important;
    color: #9ca3af !important;
}

.discovery-counter {
    font-size: 13px;
    color: var(--color-muted);
    margin-left: auto;
    font-family: var(--font-mono);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    font-family: var(--font-sans);
    letter-spacing: 0;
}

.user-name {
    font-weight: 500;
}

.user-email {
    font-size: 11px;
    color: var(--color-muted);
}

.repo-path {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 12px;
    color: var(--color-muted);
}

/* ── Filter form ──────────────────────────────────────────── */

.filter-form {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px 32px;
    align-items: flex-start;
    box-shadow: var(--shadow);
}

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

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

.period-buttons {
    display: flex;
    gap: 4px;
}

.period-btn {
    padding: 6px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-muted);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.period-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.period-btn-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 560px;
}

.filter-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--fg-3);
    cursor: pointer;
    padding: 4px 10px 4px 8px;
    border: 1px solid var(--border-1);
    border-radius: 20px;
    background: var(--bg-1);
    transition: border-color 0.12s, background 0.12s, color 0.12s;
    user-select: none;
}

.filter-checkbox-label:hover {
    border-color: var(--border-2);
    color: var(--fg-1);
}

.filter-checkbox-label input[type="checkbox"] {
    display: none;
}

.filter-chip-check {
    font-size: 10px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.12s;
    color: var(--accent);
}

.filter-checkbox-label:has(input:checked) {
    border-color: var(--accent);
    background: var(--bg-1);
    color: var(--fg-0);
    font-weight: 600;
}

.filter-checkbox-label:has(input:checked) .filter-chip-check {
    opacity: 1;
}

.filter-checkbox-label:has(input:checked):hover {
    background: var(--bg-2);
}

.project-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    max-width: 640px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

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

.btn-apply {
    padding: 8px 20px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    align-self: flex-end;
}

.btn-apply:hover {
    opacity: 0.88;
}

.period-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.period-info {
    font-size: 12px;
    color: var(--color-muted);
}

/* ── Data notice ──────────────────────────────────────────── */


/* ── Metrics legend ───────────────────────────────────────── */

.metrics-legend {
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    overflow: hidden;
}

.metrics-legend summary {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-muted);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metrics-legend summary::-webkit-details-marker {
    display: none;
}

.metrics-legend summary::before {
    content: '▶';
    font-size: 10px;
    transition: transform 0.15s;
}

.metrics-legend[open] summary::before {
    transform: rotate(90deg);
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0;
    border-top: 1px solid var(--color-border);
}

.legend-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legend-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
}

.legend-desc {
    font-size: 12px;
    color: var(--color-muted);
    line-height: 1.4;
}

/* ── Report table ─────────────────────────────────────────── */

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

.report-table th,
.report-table td {
    white-space: nowrap;
}

.td-user {
    white-space: normal;
    min-width: 150px;
    max-width: 220px;
}

/* number cells */
.td-num {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--fg-1);
    font-feature-settings: 'tnum';
}

.td-accent {
    color: var(--fg-0);
    font-weight: 500;
}

.td-good {
    color: var(--good);
}

.td-bad {
    color: var(--bad);
}

.td-ttm-bad {
    color: var(--bad);
    font-weight: 600;
}

.td-ttm-warn {
    color: var(--warn);
    font-weight: 600;
}

.td-spark {
    text-align: left;
}

.dev-status-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.dev-status-stuck {
    background: var(--bad-bg);
    color: var(--bad);
}

.dev-status-slow {
    background: var(--warn-bg);
    color: var(--warn);
}

.dev-status-top {
    background: var(--good-bg);
    color: var(--good);
}

/* keep old aliases for backwards compat */
.num-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}

.metric-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.delta {
    font-size: 10px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.01em;
    opacity: 0.85;
}

.delta-pos {
    color: var(--color-success);
}

.delta-neg {
    color: var(--color-danger);
}

.delta-neutral {
    color: var(--color-muted);
}

.delta-zero {
    color: var(--color-border);
}

/* ── Section headers (Ключевые метрики, Что требует внимания, etc.) ── */

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.section-header-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-3);
    font-weight: 600;
    white-space: nowrap;
}

.section-header-line {
    flex: 1;
    height: 1px;
    background: var(--border-1);
}

/* ── Summary grid (Ключевые метрики) ───────────────────────── */

.summary-section {
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.summary-card {
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: var(--r-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-1);
    transition: box-shadow 0.15s;
}

.summary-card:hover {
    box-shadow: var(--shadow-2);
}

.summary-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--fg-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.summary-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.summary-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--fg-0);
    line-height: 1.1;
    font-family: var(--font-mono);
    font-feature-settings: 'tnum';
    letter-spacing: -0.02em;
}

.summary-unit {
    font-size: 13px;
    color: var(--fg-2);
}

.summary-of {
    font-size: 15px;
    font-weight: 400;
    color: var(--fg-3);
    font-family: var(--font-mono);
}

.summary-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}

.summary-delta {
    font-size: 11px;
    font-weight: 500;
}

.summary-sparkline {
    flex-shrink: 0;
    display: block;
    opacity: 0.85;
}

/* ── Insight strip ─────────────────────────────────────────── */

.insight-section {
    margin-bottom: 0;
}

/* Section header with "Все инсайты →" link */
.section-header-link {
    font-size: 11px;
    color: var(--fg-3);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.section-header-link:hover {
    color: var(--accent);
}

/* Grid layout — 4 columns, aligned with key metrics below */
.insight-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.insight-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--r-lg);
    border: 1px solid var(--border-1);
    background: var(--bg-1);
    min-width: 0;
}

.insight-card-good {
    border-left: 3px solid var(--good);
}

.insight-card-warn {
    border-left: 3px solid var(--warn);
}

.insight-card-bad {
    border-left: 3px solid var(--bad);
}

.insight-card-info {
    border-left: 3px solid var(--info);
}

.insight-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.insight-card-good .insight-icon {
    background: var(--good-bg);
    color: var(--good);
}

.insight-card-warn .insight-icon {
    background: var(--warn-bg);
    color: var(--warn);
}

.insight-card-bad .insight-icon {
    background: var(--bad-bg);
    color: var(--bad);
}

.insight-card-info .insight-icon {
    background: var(--info-bg);
    color: var(--info);
}

.insight-kind-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.insight-card-bad .insight-kind-label {
    color: var(--bad);
}

.insight-card-warn .insight-kind-label {
    color: var(--warn);
}

.insight-card-good .insight-kind-label {
    color: var(--good);
}

.insight-card-info .insight-kind-label {
    color: var(--info);
}

.insight-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-0);
    line-height: 1.3;
}

.insight-desc {
    font-size: 12px;
    color: var(--fg-2);
    line-height: 1.4;
    flex: 1;
}

.insight-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.insight-avatars {
    display: flex;
}

.insight-avatar {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    border: 2px solid var(--bg-1);
    margin-left: -5px;
    flex-shrink: 0;
}

.insight-avatars .insight-avatar:first-child {
    margin-left: 0;
}

.insight-avatar[data-name] {
    position: relative;
    cursor: default;
}

.insight-avatar[data-name]::after {
    content: attr(data-name);
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-4);
    color: var(--fg-0);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    padding: 3px 7px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-2);
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease;
    z-index: 10;
}

.insight-avatar[data-name]:hover::after {
    opacity: 1;
}

.insight-action-link {
    font-size: 11px;
    font-weight: 500;
    color: var(--fg-3);
    text-decoration: none;
}

.insight-action-link:hover {
    color: var(--accent);
}

/* ── Table trend column ───────────────────────────────────── */

.trend-pill {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 99px;
    white-space: nowrap;
    font-family: var(--font-mono);
}

.trend-up {
    background: var(--good-bg);
    color: var(--good);
}

.trend-down {
    background: var(--bad-bg);
    color: var(--bad);
}

.trend-flat {
    background: var(--bg-3);
    color: var(--fg-3);
}

.delta-baseline-note {
    font-size: 11px;
    color: var(--fg-3);
    margin-bottom: 6px;
}

.num-cell.accent {
    font-weight: 700;
    color: var(--color-primary);
}

.num-cell.positive {
    color: var(--color-success);
}

.num-cell.negative {
    color: var(--color-danger);
}

/* ── History chart ────────────────────────────────────────── */

.chart-card {
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: var(--r-lg);
    padding: 16px;
    box-shadow: var(--shadow-1);
}

.chart-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.chart-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg-0);
}

.chart-metric-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    background: var(--bg-3);
    color: var(--fg-2);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.chart-subtitle {
    font-size: 11px;
    color: var(--fg-3);
    margin-top: 2px;
}

.chart-metric-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px;
    background: var(--bg-2);
    border-radius: var(--r-md);
    border: 1px solid var(--border-1);
}

.chart-seg-btn {
    padding: 5px 10px;
    border-radius: calc(var(--r-md) - 2px);
    font-size: 11px;
    font-weight: 500;
    background: transparent;
    color: var(--fg-2);
    box-shadow: none;
    border: none;
    outline: none;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
}

.chart-seg-btn-active {
    background: var(--bg-4);
    color: var(--fg-0);
    box-shadow: var(--shadow-1);
}

.chart-wrap {
    position: relative;
    height: 240px;
}

.chart-wrap canvas {
    max-height: 240px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-1);
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--fg-2);
}

.chart-legend-line {
    width: 12px;
    height: 2px;
    border-radius: 1px;
    flex-shrink: 0;
}

/* ── Empty state ──────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-muted);
    font-size: 13px;
}

/* ── Settings tabs ────────────────────────────────────────── */

.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0;
}

.tab-btn {
    padding: 8px 20px;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

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

.tab-btn-active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

.tab-content {
    animation: fadeIn 0.15s ease;
}

.tab-content.hidden {
    display: none;
}

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

.tab-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

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

.btn-primary {
    padding: 10px 20px;
    background: var(--accent);
    color: var(--accent-fg);
    border: none;
    border-radius: var(--r-md);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: -0.01em;
    transition: filter 0.15s;
}

.btn-primary:hover {
    filter: brightness(1.07);
}

.btn-primary:disabled {
    background: var(--bg-3);
    color: var(--fg-3);
    cursor: not-allowed;
}

.btn-secondary {
    padding: 9px 16px;
    background: var(--bg-1);
    color: var(--fg-1);
    border: 1px solid var(--border-2);
    border-radius: var(--r-md);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-danger {
    padding: 9px 16px;
    background: var(--bg-1);
    color: var(--bad);
    border: 1px solid var(--bad);
    border-radius: var(--r-md);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

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

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

.btn-success {
    color: var(--color-success) !important;
    border-color: var(--color-success) !important;
}

.btn-danger-text {
    color: var(--color-danger) !important;
    border-color: var(--color-danger) !important;
}

.actions-cell {
    white-space: nowrap;
    vertical-align: middle;
}

.actions-cell .btn-sm + .btn-sm {
    margin-left: 6px;
}

/* ── Modal ────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.1s ease;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--bg-1);
    border-radius: var(--r-lg);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-1);
}

.modal-wide {
    max-width: 860px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-1);
    font-size: 15px;
    font-weight: 600;
    color: var(--fg-0);
}

.modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--fg-3);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--r-sm);
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.modal-close:hover {
    background: var(--bg-3);
    color: var(--fg-1);
}

.modal-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--border-1);
}

.modal-error {
    background: var(--bad-bg);
    color: var(--bad);
    border-radius: var(--r-md);
    padding: 10px 14px;
    font-size: 13px;
}

.modal-error.hidden {
    display: none;
}

/* ── Form elements ────────────────────────────────────────── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-2);
    font-family: var(--font-mono);
}

.form-input,
.form-select {
    padding: 10px 12px;
    border: 1px solid var(--border-2);
    border-radius: var(--r-md);
    font-size: 14px;
    color: var(--fg-0);
    background: var(--bg-1);
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 0 rgba(22, 21, 15, 0.02);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 5 L6 8 L9 5' stroke='%235a5648' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 14%, transparent);
}

.form-hint {
    font-size: 12px;
    color: var(--fg-3);
    line-height: 1.5;
}

.token-hint {
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.5;
}

.token-hint-security {
    color: var(--good);
    opacity: 0.85;
}

.token-validate-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    min-height: 18px;
    transition: opacity 0.2s;
}

.token-validate-status.tv-ok {
    color: var(--good);
}

.token-validate-status.tv-error {
    color: var(--bad);
}

.token-validate-status.tv-loading {
    color: var(--fg-3);
}

.form-input.token-ok {
    border-color: var(--good);
}

.form-input.token-error {
    border-color: var(--bad);
}

/* ── Search input with icon ──────────────────────────────── */

.search-input-wrap {
    position: relative;
}

.search-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--fg-3);
    pointer-events: none;
    line-height: 1;
    display: flex;
    align-items: center;
}

.search-input-with-icon {
    padding-left: 32px;
}

/* ── Search results ───────────────────────────────────────── */

.search-results {
    border: 1px solid var(--border-1);
    border-radius: var(--r-md);
    background: var(--bg-1);
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.search-results.hidden {
    display: none;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-1);
    transition: background 0.1s;
}

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

.search-item:hover {
    background: var(--bg-2);
}

.search-item-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--fg-0);
    font-family: var(--font-mono);
}

.search-item-path {
    font-size: 11.5px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-loading,
.search-empty {
    padding: 14px;
    font-size: 13px;
    color: var(--fg-3);
    text-align: center;
}

.form-group-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.form-input-sm {
    width: auto;
    flex-shrink: 0;
}

.form-required {
    color: var(--color-danger);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-1);
    transition: background 0.1s;
}

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

.search-result-item:hover {
    background: var(--bg-2);
}

.search-result-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--color-border);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-sub {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-email-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--good-bg);
    color: var(--good);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Repo list (Add project modal) ───────────────────────── */

.repo-list-container {
    border: 1px solid var(--border-1);
    border-radius: var(--r-md);
    background: var(--bg-1);
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
}

.repo-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 120ms ease;
}

.repo-list-item:hover {
    background: var(--bg-2);
}

.repo-list-item.active {
    background: var(--accent-bg);
}

.repo-list-radio {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1.5px solid var(--border-strong, var(--border-2));
    background: transparent;
    box-sizing: border-box;
}

.repo-list-radio.active {
    border: 5px solid var(--accent);
    background: var(--accent-fg);
}

.repo-list-item-body {
    flex: 1;
    min-width: 0;
}

.repo-list-item-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--fg-0);
    font-family: var(--font-mono);
}

.repo-list-item-path {
    font-size: 11.5px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.repo-list-empty {
    padding: 20px;
    font-size: 13px;
    color: var(--fg-3);
    text-align: center;
}

.repo-path {
    font-size: 11.5px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    display: block;
    margin-top: 1px;
}

/* ── Sync banners ─────────────────────────────────────────── */

#sync-banners {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

/* ── Unified sync card ───────────────────────────────────────────────────── */

.sync-card {
    padding: 12px 16px;
    border-radius: var(--r-md);
    font-size: 12.5px;
    border: 1px solid var(--border-1);
}

.sync-card-running {
    background: var(--bg-1);
    border-color: oklch(0.42 0.19 275 / 0.18);
}

.sync-card-done {
    background: var(--good-bg, #f0fdf4);
    border-color: var(--good, #22c55e);
    color: var(--good, #16a34a);
}

.sync-card-error {
    background: var(--bad-bg, #fff1f2);
    border-color: var(--bad, #ef4444);
    color: var(--bad, #dc2626);
}

.sync-card-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sync-card-icon-box {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.sync-card-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.sync-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--fg-0);
    flex-wrap: wrap;
}

.sync-card-title strong {
    font-weight: 600;
}

.sync-phase-badge {
    font-size: 10.5px;
    font-family: var(--font-mono);
    color: #7c3aed;
    background: #ede9fe;
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.sync-card-phase-desc {
    font-size: 11.5px;
    color: var(--fg-3);
}

.sync-card-counters {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 11px;
    color: var(--fg-3);
    font-family: var(--font-mono);
}

.sync-card-done-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-card-done-icon {
    font-size: 13px;
}

.sync-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-progress-bar {
    width: 100%;
    height: 3px;
    background: var(--bg-3);
    border-radius: 2px;
    overflow: hidden;
}

.sync-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}

@keyframes sync-indeterminate {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(450%);
    }
}

.sync-progress-fill--indeterminate {
    width: 20% !important;
    transition: none;
    animation: sync-indeterminate 1.4s ease-in-out infinite;
}

.sync-card-meter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 14px;
}

.sync-progress-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--fg-2);
    font-family: var(--font-mono);
    white-space: nowrap;
    flex-shrink: 0;
}

.sync-eta-label {
    font-size: 10px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    white-space: nowrap;
    text-align: right;
}


.sync-spinner {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: sync-spin 0.9s linear infinite;
    flex-shrink: 0;
}

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

.sync-duration {
    font-size: 11px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    white-space: nowrap;
    flex-shrink: 0;
}

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

/* ── Alias chips ──────────────────────────────────────────── */

.alias-chip {
    display: inline-block;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    color: var(--color-muted);
    margin: 2px 2px 2px 0;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

.alias-empty {
    font-size: 12px;
    color: var(--color-border);
    font-style: italic;
}

.alias-chip-placeholder {
    opacity: 0.6;
    font-style: italic;
}

/* ── Onboarding: dashboard welcome ──────────────────────────────────────── */

.onboarding-welcome {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 56px 40px;
    text-align: center;
    max-width: 640px;
    margin: 32px auto;
}

.onboarding-welcome-icon {
    margin-bottom: 20px;
}

.onboarding-welcome-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
}

.onboarding-welcome-subtitle {
    font-size: 14px;
    color: var(--color-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

.onboarding-preview-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.ob-preview-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text);
    font-weight: 500;
}

.ob-preview-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.ob-preview-arrow {
    color: var(--color-border);
    font-size: 18px;
}

.onboarding-welcome-btn {
    display: inline-block;
    padding: 12px 32px;
    font-size: 15px;
    text-decoration: none;
}

/* ── Onboarding: settings wizard ────────────────────────────────────────── */

.onboarding-wizard {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 28px;
}

.ob-wizard-header {
    margin-bottom: 28px;
}

.ob-wizard-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
}

.ob-wizard-subtitle {
    font-size: 13px;
    color: var(--color-muted);
    line-height: 1.5;
}

.ob-steps {
    display: flex;
    flex-direction: column;
}

.ob-step {
    display: flex;
    gap: 20px;
    padding-bottom: 8px;
    opacity: 1;
    transition: opacity 0.2s;
}

.ob-step-locked {
    opacity: 0.45;
}

.ob-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.ob-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-muted);
    transition: all 0.2s;
}

.ob-step-active .ob-step-num {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.ob-step-done .ob-step-num {
    border-color: var(--color-success);
    background: var(--color-success);
    color: #fff;
}

.ob-step-line {
    width: 2px;
    flex: 1;
    min-height: 24px;
    background: var(--color-border);
    margin: 4px 0;
}

.ob-step-content {
    flex: 1;
    padding-bottom: 24px;
}

.ob-step-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
    padding-top: 6px;
}

.ob-step-locked .ob-step-title {
    color: var(--color-muted);
}

.ob-step-desc {
    font-size: 13px;
    color: var(--color-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.ob-step-hint {
    font-size: 12px;
    color: var(--color-muted);
    opacity: 0.75;
    line-height: 1.5;
}

.ob-step-desc code {
    font-family: "SF Mono", "Fira Code", monospace;
    background: var(--color-bg);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}

.ob-step-action {
    min-height: 32px;
}

.ob-done-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-success);
    font-size: 13px;
    font-weight: 600;
}

.ob-backfill-done {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ob-backfill-hint-sub {
    display: block;
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 2px;
}

.ob-locked-hint {
    font-size: 12px;
    color: var(--color-muted);
    font-style: italic;
}

.ob-sync-section {
    border-top: 1px solid var(--color-border);
    margin-top: 8px;
    padding-top: 20px;
}

.ob-sync-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.ob-sync-desc {
    font-size: 13px;
    color: var(--color-muted);
    margin-bottom: 12px;
}

.ob-footer {
    border-top: 1px solid var(--color-border);
    margin-top: 20px;
    padding-top: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.ob-cta-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.ob-cta-body {
    flex: 1;
}

.ob-cta-summary {
    margin-top: 2px;
}

.ob-cta-stat {
    font-size: 13px;
    color: var(--color-muted);
    line-height: 1.7;
}

.ob-cta-stat::before {
    content: '✓ ';
    color: var(--color-primary);
    font-weight: 600;
}

.ob-cta-btn {
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Contributor discovery panel ─────────────────────────────────────────── */

.discovery-panel {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    margin-bottom: 20px;
    overflow: hidden;
}

.discovery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--color-border);
    gap: 12px;
    flex-wrap: wrap;
}

.discovery-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.discovery-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.discovery-list {
    max-height: 380px;
    overflow-y: auto;
}

.discovery-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.1s;
}

.discovery-row:last-child {
    border-bottom: none;
}

.discovery-row-selectable {
    cursor: pointer;
}

.discovery-row-selectable:hover {
    background: var(--color-bg);
}

.discovery-row-tracked {
    opacity: 0.65;
}

.discovery-check {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.discovery-avatar {
    flex-shrink: 0;
}

.discovery-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.discovery-name {
    font-size: 13px;
    font-weight: 500;
}

.discovery-email {
    font-size: 12px;
    color: var(--color-muted);
    font-family: "SF Mono", "Fira Code", monospace;
}

.discovery-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    flex-wrap: wrap;
}

.discovery-repo-tag {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 8px;
    background: #e8f0fe;
    color: #1a56db;
    font-weight: 500;
}

.discovery-commits {
    font-size: 11px;
    color: var(--color-muted);
}

.discovery-alt-names {
    font-size: 11px;
    color: var(--color-muted);
    margin-left: 6px;
    cursor: help;
    text-decoration: underline dotted;
}

.discovery-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    font-size: 13px;
    color: var(--color-muted);
    margin-bottom: 16px;
}

/* ── Sync job history ────────────────────────────────────────────────────── */

.tab-badge-running {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    background: #f59f00;
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.section-subtitle {
    font-size: 12px;
    color: var(--color-muted);
    margin-left: 12px;
    align-self: center;
}

.job-id-cell {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 12px;
    color: var(--color-muted);
    width: 56px;
}

.job-time-cell {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 12px;
    white-space: nowrap;
}

.job-error-cell {
    font-size: 12px;
    color: var(--color-danger);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-row-running {
    background: #fffbf0;
}

.job-progress-wrap {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.job-progress-bar {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    min-width: 80px;
}

.job-progress-fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.job-progress-label {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
}

.job-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.job-status-ok {
    background: #e9f8ef;
    color: #1a6b3a;
}

.job-status-err {
    background: #fce8e4;
    color: var(--color-danger);
}

.job-status-run {
    background: #fff8e1;
    color: #7a5c00;
}

.sync-spinner-sm {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(122, 92, 0, 0.3);
    border-top-color: #7a5c00;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* ── Report page layout ───────────────────────────────────────────────────── */

.report-page {
    display: flex;
    min-height: calc(100vh - 52px);
}

.report-main {
    flex: 1;
    min-width: 0;
    padding: 20px 24px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#sync-banners:empty,
#sync-banners-ob:empty {
    display: none;
}

/* ── Sync banners global strip ───────────────────────────────────────────── */


/* ── DORA page ──────────────────────────────────────────────── */

/* Setup block */
.dora-setup-block {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.dora-setup-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--fg-1);
    margin-bottom: 14px;
}

.dora-setup-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-0);
}

.dora-setup-subtitle {
    font-size: 11px;
    color: var(--fg-3);
    margin-top: 2px;
}

.dora-setup-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dora-setup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface-0);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.dora-setup-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.dora-setup-pending {
    background: var(--accent-bg);
    color: var(--accent);
}

.dora-setup-done {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.dora-setup-item-body {
    flex: 1;
    min-width: 0;
}

.dora-setup-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-0);
}

.dora-setup-item-desc {
    font-size: 11px;
    color: var(--fg-3);
    margin-top: 2px;
}

.dora-setup-item-desc code {
    font-family: var(--font-mono);
    font-size: 10px;
    background: var(--surface-1);
    padding: 1px 4px;
    border-radius: 3px;
}

.dora-setup-item-ok {
    color: #22c55e;
}

/* 4-column metric grid */
.dora-big-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 900px) {
    .dora-big-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .dora-big-grid {
        grid-template-columns: 1fr;
    }
}

/* DoraBig card */
.dora-big-card {
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: var(--r-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-1);
}

.dora-big-card-tbd {
    opacity: 0.45;
}

.dora-big-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dora-big-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-2);
    font-weight: 600;
}

.dora-big-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.dora-big-value {
    font-family: var(--font-mono);
    font-feature-settings: 'tnum';
    font-size: 40px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--fg-0);
    line-height: 1;
}

.dora-big-unit {
    font-size: 14px;
    color: var(--fg-2);
}

.dora-big-trend {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.dora-sparkline {
    display: block;
    width: 100%;
    height: 44px;
    overflow: visible;
}

.dora-big-secondary {
    font-size: 11px;
    color: var(--fg-3);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
}

.dora-big-sep {
    color: var(--fg-4);
}

.dora-big-desc {
    font-size: 11px;
    color: var(--fg-3);
    line-height: 1.4;
}

/* Rating pill */
.rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.rating-pill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rating-pill-hoverable {
    cursor: default;
    position: relative;
}

.rating-pill-hoverable::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1f2329;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 10px;
    width: 260px;
    white-space: normal;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
    z-index: 300;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    transform: translateY(4px);
}

.rating-pill-hoverable:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rating-pill-elite {
    background: var(--good-bg);
    color: var(--good);
}

.rating-pill-elite .rating-pill-dot {
    background: var(--good);
}

.rating-pill-high {
    background: var(--info-bg);
    color: var(--info);
}

.rating-pill-high .rating-pill-dot {
    background: var(--info);
}

.rating-pill-medium {
    background: var(--warn-bg);
    color: var(--warn);
}

.rating-pill-medium .rating-pill-dot {
    background: var(--warn);
}

.rating-pill-low {
    background: var(--bad-bg);
    color: var(--bad);
}

.rating-pill-low .rating-pill-dot {
    background: var(--bad);
}

.rating-pill-tbd {
    background: var(--bg-3);
    color: var(--fg-3);
}

.rating-pill-tbd .rating-pill-dot {
    background: var(--fg-3);
}

/* ── Service Health Table ─────────────────────────────────── */

.svc-health-section {
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.svc-health-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-1);
}

.svc-health-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg-0);
}

.svc-health-subtitle {
    font-size: 12px;
    color: var(--fg-3);
    margin-top: 2px;
}

.svc-health-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.svc-th {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-3);
    padding: 10px 16px;
    text-align: right;
    background: var(--bg-2);
}

.svc-th-service {
    text-align: left;
    padding-left: 16px;
    width: 16%;
}

.svc-th-health {
    text-align: center;
    width: auto;
}

.svc-th-num {
    width: 9%;
}

.svc-th-trend {
    text-align: right;
    width: 8%;
}

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

.svc-row:last-child {
    border-bottom: none;
}

.svc-td {
    padding: 12px 16px;
    vertical-align: middle;
    text-align: right;
}

.svc-td-service {
    text-align: left;
    padding-left: 16px;
}

.svc-name {
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--fg-0);
    line-height: 1.3;
}

.svc-mr-count {
    font-size: 10px;
    color: var(--fg-3);
    margin-top: 2px;
}

.svc-td-health {
    text-align: left;
    padding-left: 0;
}

.svc-health-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.svc-ring-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.svc-ring {
    width: 36px;
    height: 36px;
    transform: rotate(-90deg);
}

.svc-ring-bg {
    fill: none;
    stroke: var(--bg-4);
    stroke-width: 3;
}

.svc-ring-fg {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.4s ease;
}

.svc-ring-good {
    stroke: var(--good);
}

.svc-ring-warn {
    stroke: var(--warn);
}

.svc-ring-bad {
    stroke: var(--bad);
}

.svc-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--fg-0);
}

.svc-health-bar-wrap {
    flex: 1;
    position: relative;
    height: 8px;
    background: var(--bg-3);
    border-radius: 2px;
    overflow: visible;
    min-width: 100px;
    margin-bottom: 10px;
}

.svc-health-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.svc-bar-good {
    background: var(--good);
}

.svc-bar-warn {
    background: var(--warn);
}

.svc-bar-bad {
    background: var(--bad);
}

.svc-bar-ticks {
    position: absolute;
    top: 11px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
}

.svc-bar-tick {
    font-size: 9px;
    color: var(--fg-3);
    line-height: 1;
}

.svc-td-num {
    text-align: right;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-0);
    white-space: nowrap;
}

.svc-unit {
    font-size: 10px;
    color: var(--fg-3);
    margin-left: 2px;
}

.svc-cfr-warn {
    color: var(--warn);
    font-style: italic;
    font-weight: 600;
}

.svc-cfr-bad {
    color: var(--bad);
    font-weight: 600;
}

.svc-td-trend {
    text-align: right;
    padding-right: 12px;
}

.svc-trend-spark {
    vertical-align: middle;
}

/* Chart header + legend */
.dora-chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.dora-chart-subtitle {
    font-size: 11px;
    color: var(--fg-3);
    margin-top: 2px;
}

.dora-chart-legend {
    display: flex;
    gap: 14px;
    font-size: 11px;
    color: var(--fg-2);
    align-items: center;
    flex-shrink: 0;
}

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

.dora-legend-line {
    display: inline-block;
    width: 14px;
    height: 2px;
}

.dora-legend-line-solid {
    background: var(--accent);
}

.dora-legend-line-dashed {
    background: none;
    border-top: 1.5px dashed var(--fg-3);
    height: 0;
}

.dora-legend-line-trend {
    background: none;
    border-top: 1.5px dashed var(--bad);
    height: 0;
    opacity: 0.6;
}

.dora-chart-wrap {
    position: relative;
    height: 280px;
}


/* ── Onboarding redesign ──────────────────────────────────────────────────── */

.ob-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 48px 24px;
    background: var(--bg-0);
}

.ob-card {
    width: 100%;
    max-width: 560px;
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: var(--r-xl);
    padding: 40px 44px 36px;
    box-shadow: var(--shadow-2);
    animation: ob-fadein 0.28s ease;
}

@keyframes ob-fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ── Stepper ────────────────────────────────────────────────────────────── */

.ob-stepper {
    margin-bottom: 40px;
}

.ob-stepper-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--fg-3);
    font-family: var(--font-mono);
    margin-bottom: 14px;
}

.ob-stepper-bars {
    display: flex;
    gap: 6px;
}

.ob-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--border-1);
    transition: background 200ms ease, opacity 200ms ease;
}

.ob-bar-done {
    background: var(--accent);
    opacity: 0.55;
}

.ob-bar-active {
    background: var(--accent);
    opacity: 1;
}

.ob-stepper-labels {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.ob-slabel {
    flex: 1;
    font-size: 9.5px;
    font-weight: 400;
    color: var(--fg-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
    text-align: left;
    line-height: 1.35;
}

.ob-slabel-active {
    color: var(--fg-0);
    font-weight: 600;
}

.ob-slabel-done {
    color: var(--fg-2);
}

/* ── Title block ─────────────────────────────────────────────────────────── */

.ob-eyebrow {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    font-weight: 600;
    font-family: var(--font-mono);
    margin-bottom: 14px;
}

.ob-title {
    font-family: var(--font-display);
    font-size: 44px;
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--fg-0);
    margin: 0 0 28px;
}

.ob-sub {
    font-size: 15px;
    color: var(--fg-2);
    margin: -20px 0 28px;
    max-width: 520px;
    line-height: 1.5;
}

.ob-step-body {
    animation: ob-fadein 0.3s ease;
}

/* ── Form primitives ─────────────────────────────────────────────────────── */

.ob-field-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--fg-2);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-mono);
}

.ob-text-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    background: var(--bg-1);
    border: 1px solid var(--border-2);
    border-radius: var(--r-md);
    outline: none;
    color: var(--fg-0);
    font-family: var(--font-sans);
    transition: border-color 160ms ease, box-shadow 160ms ease;
    box-shadow: 0 1px 0 rgba(22, 21, 15, 0.02);
    box-sizing: border-box;
}

.ob-text-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.ob-text-input.ob-mono {
    font-family: var(--font-mono);
}

.ob-text-input.ob-input-ok {
    border-color: var(--good);
}

.ob-field-hint {
    font-size: 12px;
    color: var(--fg-3);
    margin-top: 8px;
    line-height: 1.5;
}

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

.ob-primary-btn {
    padding: 12px 22px;
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 600;
    background: var(--accent);
    color: var(--accent-fg);
    border: none;
    cursor: pointer;
    letter-spacing: -0.01em;
    transition: filter 160ms ease;
}

.ob-primary-btn:disabled {
    background: var(--bg-3);
    color: var(--fg-3);
    cursor: not-allowed;
}

.ob-primary-btn-full {
    width: 100%;
    justify-content: center;
    padding: 14px 22px;
    font-size: 15px;
}

.ob-outline-btn {
    padding: 11px 20px;
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-1);
    color: var(--fg-1);
    border: 1px solid var(--border-2);
    cursor: pointer;
    transition: background 120ms ease;
}

.ob-outline-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ob-link-btn {
    font-size: 13px;
    color: var(--fg-2);
    padding: 8px 4px;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border-2);
    background: none;
    border: none;
    cursor: pointer;
}

.ob-nav-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 36px;
}

.ob-nav-footer-end {
    display: flex;
    justify-content: flex-end;
    margin-top: 28px;
}

/* ── Step 2: option cards ─────────────────────────────────────────────────── */

.ob-option-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.ob-option-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
    padding: 16px 18px;
    cursor: pointer;
    border-radius: var(--r-md);
    border: 1px solid var(--border-1);
    background: var(--bg-1);
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
    width: 100%;
}

.ob-option-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ob-option-card-active {
    border-color: var(--accent);
    background: var(--accent-bg);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 14%, transparent);
}

.ob-option-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    border: 1.5px solid var(--border-strong);
    background: transparent;
    box-sizing: border-box;
    transition: border 160ms ease;
}

.ob-option-radio-active {
    border: 5px solid var(--accent);
    background: var(--accent-fg);
}

.ob-option-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fg-0);
}

.ob-option-mono {
    font-size: 11px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    font-weight: 400;
}

.ob-option-soon {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-3);
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    margin-left: auto;
    font-weight: 400;
}

.ob-option-desc {
    font-size: 12.5px;
    color: var(--fg-2);
    line-height: 1.5;
}

/* ── Info box ─────────────────────────────────────────────────────────────── */

.ob-info-box {
    padding: 12px 16px;
    border-radius: var(--r-md);
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    font-size: 12.5px;
    color: var(--fg-2);
    line-height: 1.55;
}

.ob-info-box-flex {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    margin-top: 22px;
}

.ob-info-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Step 3: token + repo ────────────────────────────────────────────────── */

.ob-token-link {
    font-size: 11.5px;
    color: var(--accent);
    font-family: var(--font-mono);
    text-decoration: none;
}

.ob-token-status {
    font-size: 12px;
    margin-top: 10px;
    min-height: 18px;
    color: var(--fg-3);
    line-height: 1.5;
}

.ob-repo-list {
    border: 1px solid var(--border-1);
    border-radius: var(--r-md);
    background: var(--bg-1);
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
}

.ob-repo-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid var(--border-1);
    outline: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 120ms ease;
}

.ob-repo-item:last-child {
    border-bottom: none;
}

.ob-repo-item:hover {
    background: var(--bg-hover);
}

.ob-repo-item-active {
    background: var(--accent-bg);
}

.ob-repo-radio {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1.5px solid var(--border-strong);
    background: transparent;
    box-sizing: border-box;
}

.ob-repo-radio-active {
    border: 5px solid var(--accent);
    background: var(--accent-fg);
}

.ob-repo-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--fg-0);
    font-family: var(--font-mono);
}

.ob-repo-path {
    font-size: 11.5px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ob-repo-mrs {
    font-size: 11px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    flex-shrink: 0;
    margin-left: auto;
}

.ob-selected-repo-card {
    padding: 12px 16px;
    border-radius: var(--r-md);
    border: 1px solid var(--accent);
    background: var(--accent-bg);
    font-size: 13px;
    color: var(--fg-0);
    margin-top: 8px;
}

/* ── Step 4: sync ────────────────────────────────────────────────────────── */

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

@keyframes ob-indeterminate {
    0% {
        left: -34%;
    }
    100% {
        left: 100%;
    }
}

.ob-sync-progress-card {
    padding: 22px;
    border-radius: var(--r-lg);
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    margin-bottom: 14px;
}

.ob-sync-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.ob-sync-spinner {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    animation: ob-spin 1s linear infinite;
}

.ob-sync-repo-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-3);
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.ob-sync-phase-name {
    font-size: 14px;
    color: var(--fg-0);
    font-weight: 500;
}

.ob-sync-elapsed {
    font-size: 13px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    margin-left: auto;
    flex-shrink: 0;
}

.ob-sync-bar-wrap {
    height: 4px;
    background: var(--bg-3);
    border-radius: 2px;
    overflow: hidden;
}

.ob-sync-bar-fill {
    height: 100%;
    background: var(--accent);
    transition: width 50ms linear;
    border-radius: 2px;
}

.ob-sync-bar-fill-indeterminate {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 34%;
    background: var(--accent);
    animation: ob-indeterminate 1.8s ease-in-out infinite;
}

.ob-sync-bar-relative {
    position: relative;
    height: 4px;
    background: var(--bg-3);
    border-radius: 2px;
    overflow: hidden;
}

.ob-sync-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--fg-3);
}

.ob-phase2-preview {
    padding: 14px 18px;
    border-radius: var(--r-md);
    background: var(--bg-2);
    border: 1px dashed var(--border-2);
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.ob-phase2-num {
    width: 26px;
    height: 26px;
    border-radius: var(--r-sm);
    background: var(--bg-3);
    color: var(--fg-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 16px;
    font-weight: 500;
    flex-shrink: 0;
}

.ob-phase2-eyebrow {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg-3);
    font-family: var(--font-mono);
}

.ob-phase2-desc {
    font-size: 13px;
    color: var(--fg-1);
    margin-top: 4px;
    line-height: 1.5;
}

/* ── Step 5: people ───────────────────────────────────────────────────────── */

.ob-check-list {
    border: 1px solid var(--border-1);
    border-radius: var(--r-md);
    background: var(--bg-1);
    overflow: hidden;
    max-height: min(380px, calc(100vh - 480px));
    overflow-y: auto;
    margin-bottom: 14px;
}

.ob-check-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 80ms ease;
    user-select: none;
}

.ob-check-row:not(:last-child) {
    border-bottom: 1px solid var(--border-1);
}

.ob-check-box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1.5px solid var(--border-strong);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms ease;
}

.ob-check-box-checked {
    background: var(--accent);
    border: none;
}

.ob-avatar-colored {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    color: #fff;
}

.ob-check-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--fg-0);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ob-check-row-bot {
    opacity: 0.55;
}

.ob-bot-badge {
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--warn-bg);
    color: var(--warn);
    font-family: var(--font-mono);
}

.ob-check-mrs {
    font-size: 12px;
    color: var(--fg-3);
    margin-top: 3px;
    font-family: var(--font-mono);
}

.ob-people-actions {
    display: flex;
    align-items: center;
}

.ob-people-actions-links {
    display: flex;
    gap: 16px;
}

.ob-selected-counter {
    font-size: 12px;
    color: var(--fg-2);
    font-family: var(--font-mono);
}

/* ── Step 6: final ───────────────────────────────────────────────────────── */

.ob-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--border-1);
    border-radius: var(--r-md);
    background: var(--bg-1);
    margin-bottom: 16px;
    overflow: hidden;
}

.ob-stat-cell {
    padding: 18px 20px;
    border-left: 1px solid var(--border-1);
}

.ob-stat-cell:first-child {
    border-left: none;
}

.ob-stat-value {
    font-size: 30px;
    font-weight: 500;
    color: var(--fg-0);
    font-family: var(--font-display);
    letter-spacing: -0.02em;
    line-height: 1;
}

.ob-stat-label {
    font-size: 11px;
    color: var(--fg-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-mono);
    margin-top: 4px;
}

.ob-phase-card {
    padding: 14px 18px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.ob-phase-card-good {
    background: var(--good-bg);
    border: 1px solid color-mix(in oklch, var(--good) 30%, transparent);
}

.ob-phase-card-pending {
    background: var(--bg-1);
    border: 1px dashed var(--border-1);
}

.ob-phase-card-running {
    padding: 16px 18px;
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    display: block;
    margin-bottom: 24px;
}

.ob-phase-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--good);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ob-phase-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-0);
}

.ob-phase-desc {
    font-size: 12px;
    color: var(--fg-2);
    margin-top: 2px;
}

.ob-phase2-running-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.ob-phase2-running-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-0);
}

.ob-phase2-running-eta {
    font-size: 11px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    margin-left: auto;
    flex-shrink: 0;
}

.ob-phase2-running-desc {
    font-size: 12px;
    color: var(--fg-2);
    margin-top: 3px;
    line-height: 1.5;
}

.ob-phase2-counters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 16px;
}

.ob-phase2-counter-val {
    font-size: 18px;
    font-weight: 500;
    color: var(--fg-0);
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

.ob-phase2-counter-loaded {
    font-size: 11px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    margin-left: 6px;
    font-weight: 400;
}

.ob-phase2-counter-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg-3);
    font-family: var(--font-mono);
    margin-top: 4px;
}

.ob-final-note {
    font-size: 11.5px;
    color: var(--fg-3);
    text-align: center;
    margin-top: 14px;
    line-height: 1.5;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */

.ob-btn-spinner {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ob-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* ── Step 4 sync error banner ────────────────────────────────────────────── */

.ob-sync-error {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--bad-bg);
    border: 1px solid var(--bad);
    margin-bottom: 16px;
}

/* ── Phase 2 banner (report page) ───────────────────────────────────────── */


/* ── Discovery list (legacy) ─────────────────────────────────────────────── */

.ob-discovery-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-1);
    margin-top: 10px;
}


/* ══════════════════════════════════════════════════════════════════════════
   Insights page
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Meta explainer cards ────────────────────────────────────────────────── */

.insight-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.insight-meta-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: var(--r-lg);
    padding: 18px;
}

.insight-meta-card-ai {
    border-color: oklch(0.55 0.2 300 / 0.25);
}

.insight-meta-card-disabled {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.4);
}

.insight-meta-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-3);
    color: var(--fg-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.insight-meta-icon-ai {
    background: oklch(0.55 0.2 300 / 0.12);
    color: oklch(0.55 0.2 300);
}

.insight-meta-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-0);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.insight-meta-count {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--fg-3);
    font-weight: 400;
}

.insight-meta-desc {
    font-size: 11px;
    color: var(--fg-2);
    line-height: 1.5;
}

.badge-soon {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg-3);
    color: var(--fg-2);
}

/* ── Filter bar ──────────────────────────────────────────────────────────── */

.insight-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.insight-filter-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-filter-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Source filter (Все / Algo / AI) — connected strip */
#source-filter {
    gap: 0;
    border: 1px solid var(--border-1);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--bg-1);
}

#source-filter .insight-filter-btn {
    border: none;
    border-right: 1px solid var(--border-1);
    border-radius: 0;
    background: transparent;
}

#source-filter .insight-filter-btn:last-child {
    border-right: none;
}

/* Kind filter (Все / Проблемы / Внимание / Улучшения / Инфо) — gradient strip */
#kind-filter {
    gap: 0;
    border: 1px solid var(--border-1);
    border-radius: var(--r-md);
    overflow: hidden;
    background: linear-gradient(
        to right,
        var(--bg-1) 0%,
        oklch(from var(--bad) l c h / 0.07) 25%,
        oklch(from var(--warn) l c h / 0.07) 50%,
        oklch(from var(--good) l c h / 0.07) 75%,
        oklch(from var(--info) l c h / 0.07) 100%
    );
}

#kind-filter .insight-filter-btn {
    border: none;
    border-right: 1px solid var(--border-1);
    border-radius: 0;
    background: transparent;
}

#kind-filter .insight-filter-btn:last-child {
    border-right: none;
}

.insight-filter-btn {
    padding: 5px 12px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-1);
    background: var(--bg-1);
    color: var(--fg-2);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 120ms, color 120ms;
}

.insight-filter-btn:hover:not([disabled]) {
    background: var(--bg-3);
    color: var(--fg-0);
}

.insight-filter-btn-active {
    background: var(--bg-3);
    color: var(--fg-0);
    font-weight: 600;
}

.insight-filter-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.insight-filter-src-ai {
    color: oklch(0.55 0.2 300 / 0.7);
}

/* Kind-filter active states — colored accent on active */
#kind-filter .insight-filter-btn-bad.insight-filter-btn-active {
    background: oklch(from var(--bad) l c h / 0.15);
    color: var(--bad);
}

#kind-filter .insight-filter-btn-warn.insight-filter-btn-active {
    background: oklch(from var(--warn) l c h / 0.15);
    color: var(--warn);
}

#kind-filter .insight-filter-btn-good.insight-filter-btn-active {
    background: oklch(from var(--good) l c h / 0.15);
    color: var(--good);
}

#kind-filter .insight-filter-btn-info.insight-filter-btn-active {
    background: oklch(from var(--info) l c h / 0.15);
    color: var(--info);
}

.insight-filter-btn-bad {
    color: var(--fg-2);
}

.insight-filter-btn-warn {
    color: var(--fg-2);
}

.insight-filter-btn-good {
    color: var(--fg-2);
}

.insight-filter-btn-info {
    color: var(--fg-2);
}

.insight-sort-label {
    font-size: 11px;
    color: var(--fg-3);
    white-space: nowrap;
}

/* ── Full-width insight rows ─────────────────────────────────────────────── */

.insight-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.insight-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 14px;
    align-items: flex-start;
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: var(--r-lg);
    padding: 14px 16px;
}

.insight-row--bad {
    border-left: 3px solid var(--bad);
}

.insight-row--warn {
    border-left: 3px solid var(--warn);
}

.insight-row--good {
    border-left: 3px solid var(--good);
}

.insight-row--info {
    border-left: 3px solid var(--info);
}

.insight-row-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.insight-row-icon--bad {
    background: var(--bad-bg);
    color: var(--bad);
}

.insight-row-icon--warn {
    background: var(--warn-bg);
    color: var(--warn);
}

.insight-row-icon--good {
    background: var(--good-bg);
    color: var(--good);
}

.insight-row-icon--info {
    background: var(--info-bg);
    color: var(--info);
}

.insight-row-body {
    min-width: 0;
}

.insight-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.insight-row-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg-0);
}

.insight-row-badge-algo {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg-3);
    color: var(--fg-2);
}

.insight-row-severity {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.insight-row-severity--bad {
    color: var(--bad);
}

.insight-row-severity--warn {
    color: var(--warn);
}

.insight-row-severity--good {
    color: var(--good);
}

.insight-row-severity--info {
    color: var(--info);
}

.insight-row-code {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--fg-3);
    background: var(--bg-2);
    padding: 1px 6px;
    border-radius: 3px;
}

.insight-row-desc {
    font-size: 12px;
    color: var(--fg-2);
    line-height: 1.5;
    margin-bottom: 8px;
}

.insight-row-who {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.insight-row-who-label {
    font-size: 10px;
    color: var(--fg-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.insight-row-who-avatar {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--fg-1);
}

.avatar-xs {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    font-size: 10px;
    border-radius: 6px;
}

.insight-row-action {
    padding: 6px 12px;
    border-radius: var(--r-md);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    border: none;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 2px;
}

.insight-row-action--bad {
    background: var(--bad-bg);
    color: var(--bad);
}

.insight-row-action--warn {
    background: var(--warn-bg);
    color: var(--warn);
}

.insight-row-action--good {
    background: var(--good-bg);
    color: var(--good);
}

.insight-row-action--info {
    background: var(--info-bg);
    color: var(--info);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.insight-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--fg-3);
}

.insight-empty-icon {
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--good);
}

.insight-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--fg-1);
    margin-bottom: 6px;
}

.insight-empty-desc {
    font-size: 12px;
    color: var(--fg-2);
}

/* ── Footer explainer ────────────────────────────────────────────────────── */

.insight-footer-explainer {
    margin-top: 8px;
    padding: 16px;
    background: var(--bg-2);
    border: 1px dashed var(--border-2);
    border-radius: var(--r-lg);
    font-size: 11px;
    color: var(--fg-2);
    line-height: 1.6;
}

.insight-footer-explainer strong {
    color: var(--fg-1);
}

/* ── Sync History page ───────────────────────────────────────────────────── */

.sync-pg-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.sync-pg-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
    padding-top: 4px;
}

/* KPI strip */
.sync-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.kpi-card {
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: var(--r-lg);
    padding: 14px;
    box-shadow: var(--shadow-1);
}

.kpi-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fg-3);
    font-weight: 600;
}

.kpi-value {
    font-size: 26px;
    font-weight: 600;
    color: var(--fg-0);
    margin-top: 6px;
    letter-spacing: -.02em;
}

.kpi-value-ok {
    color: var(--good);
}

.kpi-value-bad {
    color: var(--bad);
}

.kpi-sub {
    font-size: 10px;
    color: var(--fg-3);
    margin-top: 2px;
}

/* Timeline chart */
.sync-timeline-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sync-legend {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--fg-3);
}

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

.sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.sync-dot-ok {
    background: var(--good);
}

.sync-dot-partial {
    background: var(--warn);
}

.sync-dot-failed {
    background: var(--bad);
}

.sync-dot-running {
    background: var(--accent);
}

.sync-chart-wrap {
    display: flex;
    gap: 8px;
    height: 120px;
}

.sync-chart-yaxis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 18px;
    min-width: 36px;
}

.sync-chart-yaxis span {
    font-size: 9px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    line-height: 1;
}

.sync-bars-container {
    display: flex;
    align-items: stretch;
    gap: 6px;
    height: 120px;
    flex: 1;
}

.sync-col-repo {
    font-size: 11px;
    color: var(--fg-2);
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sync-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.sync-bar {
    width: 100%;
    border-radius: 2px;
    min-height: 4px;
}

.sync-bar-ok,
.sync-bar-phase1,
.sync-bar-phase2,
.sync-bar-phase3,
.sync-bar-phase4 {
    background: var(--good);
}

.sync-bar-partial {
    background: var(--warn);
}

.sync-bar-failed {
    background: var(--bad);
}

.sync-bar-running {
    background: var(--accent);
}

.sync-bar-label {
    font-size: 9px;
    color: var(--fg-3);
    font-family: var(--font-mono);
}

/* History table */
.sync-history-card {
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-1);
}

.sync-history-top {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sync-table-header {
    display: grid;
    grid-template-columns: 160px 120px 100px 120px minmax(100px, 180px) 1fr 40px;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-2);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fg-3);
    font-weight: 600;
    border-bottom: 1px solid var(--border-1);
}

.sync-th-r {
    text-align: right;
}

.sync-run-item {
    border-bottom: 1px solid var(--border-1);
}

.sync-run-item:last-child {
    border-bottom: none;
}

.sync-run-row {
    width: 100%;
    display: grid;
    grid-template-columns: 160px 120px 100px 120px minmax(100px, 180px) 1fr 40px;
    gap: 12px;
    padding: 12px 16px;
    align-items: center;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background .1s;
}

.sync-run-row:hover,
.sync-run-row-open {
    background: var(--bg-2);
}

.sync-run-row-static {
    cursor: default;
}

.sync-run-row-static:hover {
    background: transparent;
}

.sync-col-date {
    font-size: 12px;
    color: var(--fg-1);
}

.sync-col-dur {
    font-size: 12px;
    color: var(--fg-2);
}

.sync-col-num {
    font-size: 12px;
    color: var(--fg-0);
    text-align: right;
}

.sync-col-unit {
    color: var(--fg-3);
    font-size: 10px;
}

.sync-col-note {
    font-size: 11px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sync-note-err {
    color: var(--bad);
}

.sync-col-chevron {
    font-size: 12px;
    color: var(--fg-3);
    text-align: center;
}

.sync-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.sync-status-ok {
    background: var(--good-bg);
    color: var(--good);
}

/* phase1 = FAST phase completed: Phase 1 of 3 succeeded, Phase 2 follows. Green, not orange. */
.sync-status-phase1 {
    background: var(--good-bg);
    color: var(--good);
}

/* phase2 = ENRICH phase completed: Phase 2 of 3 succeeded, Phase 3 (release) may follow. */
.sync-status-phase2 {
    background: var(--good-bg);
    color: var(--good);
}

/* phase3 = RELEASE phase completed: Phase 3 of 4 succeeded, Jira phase may follow. */
.sync-status-phase3 {
    background: var(--good-bg);
    color: var(--good);
}

/* phase4 = JIRA_INCIDENTS phase completed: all 4 phases done. */
.sync-status-phase4 {
    background: var(--good-bg);
    color: var(--good);
}

.sync-status-partial {
    background: var(--warn-bg);
    color: var(--warn);
}

.sync-status-failed {
    background: var(--bad-bg);
    color: var(--bad);
}

.sync-status-running {
    background: var(--accent-bg);
    color: var(--accent);
}

/* Expanded row */
.sync-run-details {
    padding: 12px 16px 16px 176px;
    background: var(--bg-2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sync-phases-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fg-3);
    font-weight: 600;
}

.sync-phases-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sync-phase-row {
    display: grid;
    grid-template-columns: 14px 220px 1fr 60px;
    gap: 10px;
    align-items: center;
    font-size: 11px;
}

.sync-phase-icon {
    font-size: 12px;
}

.sync-phase-skipped {
    color: var(--fg-3);
}

.sync-phase-bar {
    height: 3px;
    background: var(--bg-3);
    border-radius: 2px;
    overflow: hidden;
}

.sync-phase-bar-fill {
    height: 100%;
}

.sync-phase-dur {
    font-size: 10px;
    color: var(--fg-3);
    text-align: right;
}

.sync-error-log {
    margin-top: 4px;
    padding: 8px 10px;
    background: var(--bad-bg);
    border: 1px solid var(--border-1);
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--bad);
}

.sync-log-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 4px;
    font-weight: 600;
}

.sync-detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

/* Bottom grid */
.sync-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.sync-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
}

.sync-sched-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sync-sched-key {
    color: var(--fg-2);
}

.sync-sched-val {
    color: var(--fg-0);
    font-size: 12px;
}

.sync-sched-ok {
    color: var(--good);
}

.sync-add-link {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}

.sync-add-link:hover {
    text-decoration: underline;
}

.sync-repos-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sync-repo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-2);
    border-radius: var(--r-sm);
}

.sync-repo-name {
    font-size: 12px;
    color: var(--fg-0);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Explainer */
.sync-explainer {
    padding: 16px;
    background: var(--bg-2);
    border: 1px dashed var(--border-2);
    border-radius: var(--r-lg);
    font-size: 11px;
    color: var(--fg-2);
    line-height: 1.6;
    margin-bottom: 16px;
}

.sync-explainer strong {
    color: var(--fg-1);
}

.sync-empty {
    padding: 20px 16px;
    font-size: 12px;
    color: var(--fg-3);
    text-align: center;
}

/* ── Releases timeline (dora.html) ────────────────────────────────────────── */
.releases-section {
    margin-top: 24px;
}

.releases-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.releases-sync-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.releases-project-select {
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-1);
    color: var(--fg-1);
    font-size: 13px;
    cursor: pointer;
    max-width: 200px;
}

.releases-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--fg-0);
}

.releases-section-subtitle {
    font-size: 11px;
    color: var(--fg-3);
    margin-top: 2px;
}

.releases-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.release-row {
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: border-color 0.15s;
}

.release-row:hover {
    border-color: var(--border-2);
}

.release-row-main {
    display: grid;
    grid-template-columns: 200px 1fr 32px;
    align-items: center;
    gap: 0;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
}

.release-row-left {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 12px;
    overflow: hidden;
}

.release-tag-name {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-0);
    background: var(--bg-3);
    padding: 2px 8px;
    border-radius: var(--r-sm);
}

.release-prod-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.release-prod-dot-ok {
    background: var(--good);
}

.release-prod-dot-pending {
    background: var(--fg-4);
}

.release-row-meta {
    display: grid;
    grid-template-columns: 130px 150px 56px 1fr;
    align-items: center;
    gap: 0;
}

.release-meta-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-right: 12px;
}

.release-meta-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-4);
    font-weight: 600;
}

.release-meta-value {
    font-size: 12px;
    color: var(--fg-1);
    font-weight: 500;
}

.release-meta-na {
    color: var(--fg-4);
    font-weight: 400;
}

.release-lt-value {
    color: var(--accent);
}

.release-expand-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--fg-3);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, color 0.15s;
}

.release-expand-btn svg {
    width: 10px;
    height: 6px;
    transition: transform 0.2s;
}

.release-expand-btn-open svg {
    transform: rotate(180deg);
}

.release-expand-btn:hover {
    color: var(--fg-0);
    background: var(--bg-3);
}

.release-mr-list {
    border-top: 1px solid var(--border-1);
    background: var(--bg-2);
    padding: 6px 0;
}

.release-mr-row {
    display: grid;
    grid-template-columns: 52px 1fr 150px 110px;
    align-items: center;
    gap: 0;
    padding: 5px 16px;
    font-size: 12px;
}

.release-mr-row:hover {
    background: var(--bg-hover);
}

.release-mr-iid {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-3);
}

.release-mr-title {
    flex: 1;
    color: var(--fg-0);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.release-mr-title:hover {
    color: var(--accent);
    text-decoration: underline;
}

.release-mr-author {
    font-size: 11px;
    color: var(--fg-3);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    padding-right: 8px;
}

.release-mr-date {
    font-size: 11px;
    color: var(--fg-4);
    text-align: right;
}

/* Empty state */
.releases-empty {
    margin-top: 24px;
    padding: 32px 24px;
    background: var(--bg-1);
    border: 1px dashed var(--border-2);
    border-radius: var(--r-lg);
    text-align: center;
}

.releases-empty-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.releases-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg-1);
    margin-bottom: 6px;
}

.releases-empty-desc {
    font-size: 12px;
    color: var(--fg-3);
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.6;
}

.btn-release-sync {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-bg);
    border: 1px solid var(--accent);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-release-sync:hover:not(:disabled) {
    background: var(--accent);
    color: #fff;
}

.btn-release-sync:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ── Release tag tooltip ────────────────────────────────────────────────── */
.release-tag-hoverable {
    cursor: default;
    position: relative;
}

.release-tag-tooltip {
    position: absolute;
    z-index: 9999;
    min-width: 220px;
    max-width: 280px;
    background: var(--bg-1);
    border: 1px solid var(--border-2);
    border-radius: var(--r-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    pointer-events: none;
    animation: rtt-in 0.12s ease;
}

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

.rtt-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 10px;
}

.rtt-tag {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--fg-0);
    letter-spacing: -0.01em;
}

.rtt-project {
    font-size: 10px;
    color: var(--fg-3);
    font-weight: 500;
    background: var(--bg-3);
    padding: 2px 6px;
    border-radius: var(--r-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rtt-divider {
    height: 1px;
    background: var(--border-1);
    margin: 0 14px;
}

.rtt-body {
    padding: 10px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rtt-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--r-sm);
    align-self: flex-start;
    margin-bottom: 2px;
}

.rtt-status-ok {
    color: var(--good);
    background: var(--good-bg);
}

.rtt-status-pending {
    color: var(--fg-4);
    background: var(--bg-3);
}

.rtt-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.rtt-label {
    font-size: 11px;
    color: var(--fg-3);
    flex-shrink: 0;
}

.rtt-value {
    font-size: 11px;
    font-weight: 500;
    color: var(--fg-1);
    text-align: right;
}

.rtt-accent {
    color: var(--accent);
}

.btn-release-sync-sm {
    padding: 3px 9px;
    font-size: 11px;
    margin-left: 4px;
    vertical-align: middle;
}

.release-project-name {
    font-size: 10px;
    color: var(--fg-3);
    font-weight: 500;
    background: var(--bg-3);
    padding: 1px 5px;
    border-radius: var(--r-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}
