/* ============================================================
   GitHub Deploy Monitor — Stylesheet
   ============================================================ */

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

:root {
    --bg:           #0d1117;
    --surface:      #161b22;
    --surface-2:    #21262d;
    --border:       #30363d;
    --border-muted: #21262d;
    --text:         #e6edf3;
    --text-muted:   #8b949e;
    --text-link:    #58a6ff;
    --green:        #2ea043;
    --green-bg:     #0d2818;
    --green-text:   #3fb950;
    --red:          #da3633;
    --red-bg:       #2d0f0e;
    --red-text:     #f85149;
    --amber:        #d29922;
    --amber-bg:     #2d2007;
    --amber-text:   #e3b341;
    --grey-bg:      #1c2028;
    --grey-text:    #8b949e;
    --font-sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono:    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --radius:       6px;
    --radius-sm:    4px;
}

html { font-size: 14px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--surface-2);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.5rem;
    height: 56px;
    max-width: 100%;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.github-icon {
    width: 24px;
    height: 24px;
    fill: var(--text);
}

.header-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.header-org {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.header-nav {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: background 0.1s, color 0.1s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--text); font-weight: 600; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.fetched-at {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.btn-refresh {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.1s;
}
.btn-refresh:hover { background: var(--border); text-decoration: none; }

.btn-logout {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.btn-logout:hover { color: var(--text); }

/* ============================================================
   Main content
   ============================================================ */

.main-content {
    flex: 1;
    padding: 1.5rem;
    overflow-x: auto;
}

/* ============================================================
   Alerts
   ============================================================ */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid;
}
.alert-error { background: var(--red-bg); border-color: var(--red); color: var(--red-text); }
.alert-info  { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); }

/* ============================================================
   Tables (shared)
   ============================================================ */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.deploy-table,
.matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
}

.deploy-table {
    table-layout: fixed;
}

.deploy-table th,
.matrix-table th {
    background: var(--surface);
    padding: 0.6rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.deploy-table td,
.matrix-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-muted);
    vertical-align: top;
}

.deploy-table tr:last-child td,
.matrix-table tr:last-child td {
    border-bottom: none;
}

.deploy-table tbody tr:hover,
.matrix-table tbody tr:hover {
    background: var(--surface);
}

.col-repo {
    width: 200px;
    min-width: 200px;
    position: sticky;
    left: 0;
    background: var(--bg);
    z-index: 1;
    border-right: 1px solid var(--border);
}

.deploy-table tbody tr:hover .col-repo,
.matrix-table tbody tr:hover .col-repo {
    background: var(--surface);
}

.col-env {
    width: 220px;
}

.matrix-table .col-env {
    min-width: 160px;
}

.repo-link {
    font-weight: 500;
    color: var(--text);
    font-size: 0.875rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}
.repo-link:hover { color: var(--text-link); text-decoration: none; }

/* ============================================================
   Deploy cards (Deployments page)
   ============================================================ */

.deploy-card {
    border-radius: var(--radius);
    border: 1px solid var(--border-muted);
    padding: 0.6rem 0.75rem;
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.version-badge {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    white-space: nowrap;
}
.version-badge:hover { color: var(--text-link); text-decoration: none; }

.card-timestamp {
    font-size: 0.78rem;
    color: var(--text-muted);
    position: relative;
    cursor: default;
}

.timestamp-full {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    color: var(--text);
    pointer-events: none;
}

.card-timestamp:hover .timestamp-full { display: block; }

.card-commit-msg {
    font-size: 0.78rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.75rem;
    margin-top: 0.1rem;
}

.card-links a {
    color: var(--text-muted);
    white-space: nowrap;
}
.card-links a:hover { color: var(--text-link); }

.branch-link, .actor-link {
    font-size: 0.75rem;
}

/* ============================================================
   Status colours (shared)
   ============================================================ */

.status-success .status-badge { background: var(--green-bg); color: var(--green-text); }
.status-failure .status-badge { background: var(--red-bg);   color: var(--red-text);   }
.status-running .status-badge { background: var(--amber-bg); color: var(--amber-text); }
.status-cancelled .status-badge,
.status-skipped .status-badge,
.status-unknown .status-badge { background: var(--grey-bg);  color: var(--grey-text);  }

.status-success { border-color: var(--green) !important; }
.status-failure { border-color: var(--red)   !important; }
.status-running { border-color: var(--amber) !important; }

.status-none {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    background: none;
    border-color: transparent !important;
}

.no-deploy { color: var(--text-muted); font-size: 1.2rem; }

/* ============================================================
   Activity Monitor page
   ============================================================ */

.ac-board {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.ac-col {
    flex: 1 1 0;
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.ac-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1;
}

.ac-col-count {
    font-size: 0.72rem;
    font-weight: 400;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 7px;
    color: var(--text-muted);
}

.ac-col-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem;
}

.ac-empty {
    padding: 1.5rem 0.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Activity card */
.ac-card {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-muted);
    border-left: 3px solid var(--border);
    padding: 0.45rem 0.6rem;
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ac-card.status-success { border-left-color: var(--green); }
.ac-card.status-failure { border-left-color: var(--red);   }
.ac-card.status-running { border-left-color: var(--amber); }

.ac-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.ac-repo {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.ac-repo:hover { color: var(--text-link); text-decoration: none; }

.ac-status {
    font-size: 0.8rem;
    flex-shrink: 0;
}
.ac-status.status-success { color: var(--green-text); }
.ac-status.status-failure { color: var(--red-text);   }
.ac-status.status-running { color: var(--amber-text); }
.ac-status.status-cancelled,
.ac-status.status-unknown  { color: var(--grey-text); }

.ac-card-mid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.ac-version {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55%;
}
.ac-version:hover { color: var(--text-link); text-decoration: none; }

.ac-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.ac-msg {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.72rem;
    flex-wrap: wrap;
}
.ac-meta a { color: var(--text-muted); white-space: nowrap; }
.ac-meta a:hover { color: var(--text-link); }

/* ============================================================
   Excluded repos section
   ============================================================ */

.excluded-section {
    margin-top: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.excluded-summary {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    list-style: none;
}
.excluded-summary::-webkit-details-marker { display: none; }
.excluded-summary::before { content: '▶\00a0'; font-size: 0.7rem; }
details[open] .excluded-summary::before { content: '▼\00a0'; }
.excluded-summary:hover { color: var(--text); }

.excluded-count {
    font-weight: 400;
    color: var(--text-muted);
}

.excluded-body {
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.excluded-group {}

.excluded-reason {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.excluded-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.excluded-repo-link {
    font-size: 0.82rem;
    color: var(--text-muted) !important;
}
.excluded-repo-link:hover { color: var(--text-link) !important; }

/* ============================================================
   Loading spinner
   ============================================================ */

.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    gap: 1.25rem;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--text-link);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

.loading-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================================
   Login page
   ============================================================ */

.login-page {
    background: #090d12;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: #1c2128;
    border: 1px solid #444c56;
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.login-box h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.form-group input {
    width: 100%;
    background: #0d1117;
    border: 1px solid #6e7681;
    border-radius: var(--radius-sm);
    color: #e6edf3;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-family: var(--font-sans);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--text-link);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.btn-primary {
    width: 100%;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.5rem;
}
.btn-primary:hover { background: #238636; }

/* ============================================================
   Commit Timeline page
   ============================================================ */

.ct-main {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.ct-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.ct-repo-select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    min-width: 240px;
    cursor: pointer;
}
.ct-repo-select:focus {
    outline: none;
    border-color: var(--text-link);
    box-shadow: 0 0 0 3px rgba(88,166,255,0.15);
}

.ct-branch-badge {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 999px;
}

.ct-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.ct-loading {
    padding: 2rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Timeline wrapper — scrollable, fills the page */
.ct-timeline {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
}

/* One row per commit — fixed height keeps SVG lane lines continuous */
.ct-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-muted);
    height: 72px;
    overflow: hidden;
}
.ct-row:hover {
    background: var(--surface);
}
.ct-row:last-child {
    border-bottom: none;
}

/* Graph cell — left side, width set via inline style from JS */
.ct-graph-cell {
    flex-shrink: 0;
    position: relative;
    overflow: hidden; /* clip SVG cleanly at column edge */
}

.ct-graph-svg {
    display: block;
}

/* Separator between graph and commit info */
.ct-graph-cell::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

/* Commit info column — right side */
.ct-commit-col {
    flex: 1;
    min-width: 0;
    padding: 0.4rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    overflow: hidden;
}

.ct-commit-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Merge commits get a subtle left accent */
.ct-merge .ct-commit-msg {
    font-weight: 500;
}

.ct-commit-top {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    min-width: 0;
}

.ct-commit-msg {
    font-size: 0.875rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.ct-sha {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
}
a.ct-sha:hover { color: var(--text-link); text-decoration: none; }

.ct-commit-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ct-author {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.ct-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
}

.ct-author-link,
.ct-author-name {
    font-size: 0.78rem;
    color: var(--text-muted);
}
a.ct-author-link:hover { color: var(--text-link); text-decoration: none; }

.ct-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Deployment badges row */
.ct-deploys {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.15rem;
}

.ct-deploy-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}
a.ct-deploy-badge:hover { color: var(--text-link); text-decoration: none; }
.ct-deploy-badge.status-success { background: var(--green-bg); border-color: var(--green); color: var(--green-text); }
.ct-deploy-badge.status-failure { background: var(--red-bg);   border-color: var(--red);   color: var(--red-text);   }
.ct-deploy-badge.status-running { background: var(--amber-bg); border-color: var(--amber); color: var(--amber-text); }

.ct-deploy-more {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 1px 4px;
    align-self: center;
}

/* ============================================================
   Repo Timeline page
   ============================================================ */

.rt-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.rt-select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.4rem 0.65rem;
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 220px;
}

.rt-select:focus { outline: 2px solid var(--text-link); outline-offset: 1px; }

.rt-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.rt-filter-pill {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.78rem;
    padding: 0.2rem 0.7rem;
    white-space: nowrap;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.rt-filter-pill:hover  { background: var(--surface); color: var(--text); }
.rt-filter-pill.active { background: var(--text-link); border-color: var(--text-link); color: #fff; }

/* ── Feed ── */

.rt-feed {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 1020px;
}

/* ── Card ── */

.rt-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.rt-card-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    user-select: none;
}

.rt-card-header:hover { background: var(--surface-2); }

/* Event icon circle */
.rt-event-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-style: normal;
}

/* Event type colour variants */
.rt-ev-branch  { background: rgba(0,199,190,0.15);   color: #00c7be; }
.rt-ev-merge   { background: rgba(210,153,34,0.15);  color: var(--amber-text); }
.rt-ev-pr      { background: rgba(88,166,255,0.15);  color: var(--text-link); }
.rt-ev-approve { background: rgba(63,185,80,0.15);   color: var(--green-text); }
.rt-ev-trunk   { background: rgba(163,113,247,0.15); color: #a371f7; }
.rt-ev-build   { background: rgba(255,140,0,0.15);   color: #e69500; }
.rt-ev-deploy  { background: rgba(218,54,51,0.15);   color: var(--red-text); }

/* Header middle section */
.rt-header-main {
    flex: 1;
    min-width: 0;
}

.rt-header-top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.1rem;
}

.rt-event-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
}

.rt-jira-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.rt-jira-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0px 5px;
    border-radius: var(--radius-sm);
    background: rgba(88,166,255,0.1);
    color: var(--text-link);
    border: 1px solid rgba(88,166,255,0.3);
    text-decoration: none;
    white-space: nowrap;
}

.rt-jira-badge:hover { background: rgba(88,166,255,0.22); text-decoration: none; }

.rt-card-title {
    font-size: 0.865rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header right section */
.rt-card-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
    margin-left: auto;
}

.rt-actor-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-decoration: none;
    white-space: nowrap;
}

.rt-actor-link:hover { color: var(--text-link); text-decoration: none; }

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

.rt-time {
    font-size: 0.74rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.rt-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.15rem 0.2rem;
    flex-shrink: 0;
    line-height: 1;
}

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

/* ── Card Body ── */

.rt-card-body[hidden] { display: none !important; }

.rt-card-body:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    border-top: 1px solid var(--border-muted);
    padding: 0.7rem 0.85rem 0.7rem 3.4rem; /* indent to align with title */
    background: var(--bg);
}

.rt-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.82rem;
}

.rt-detail-label {
    color: var(--text-muted);
    min-width: 82px;
    flex-shrink: 0;
    padding-top: 0.05rem;
}

.rt-detail-value {
    color: var(--text);
    word-break: break-word;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.rt-notes-value { align-items: flex-start; }

.rt-notes-body {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    margin: 0;
    max-height: 8rem;
    overflow-y: auto;
}

.rt-links-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rt-link {
    color: var(--text-link);
    font-size: 0.82rem;
    text-decoration: none;
}

.rt-link:hover { text-decoration: underline; }

.rt-status {
    display: inline-block;
    font-size: 0.73rem;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
}

.rt-status.status-success  { background: var(--green-bg); border-color: var(--green); color: var(--green-text); }
.rt-status.status-failure  { background: var(--red-bg);   border-color: var(--red);   color: var(--red-text);   }
.rt-status.status-running  { background: var(--amber-bg); border-color: var(--amber); color: var(--amber-text); }

.rt-env-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Empty / loading states */

.rt-empty {
    padding: 2.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.rt-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem;
}

.rt-spinner {
    width: 32px !important;
    height: 32px !important;
    border-width: 2px !important;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}
