/* RCHG Kanban Dashboard — Dark Theme — Side-by-Side Board Columns */

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #161922;
    --bg-card: #1c2030;
    --bg-card-hover: #232840;
    --bg-column: #12151f;
    --border: #2a2f42;
    --border-focus: #4f46e5;
    --text-primary: #e4e6ef;
    --text-secondary: #8b8fa8;
    --text-muted: #5a5e73;

    --running: #3b82f6;
    --ready: #f59e0b;
    --blocked: #ef4444;
    --todo: #8b5cf6;
    --done: #10b981;

    --dot-mario: #ef4444;
    --dot-adrian: #3b82f6;
    --dot-joshua: #22c55e;
    --dot-sebastian: #f59e0b;
    --dot-unassigned: #6b7280;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Header */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
header h1 { font-size: 15px; font-weight: 700; }
.subtitle { font-size: 11px; color: var(--text-muted); margin-left: 8px; }
.header-left { display: flex; align-items: baseline; }
.header-right { display: flex; align-items: center; gap: 16px; }
.clock { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.refresh-indicator {
    display: flex; align-items: center; gap: 5px;
    font-size: 10px; font-weight: 600; color: var(--done);
    text-transform: uppercase; letter-spacing: 1px;
}
.pulse { width: 6px; height: 6px; background: var(--done); border-radius: 50%; animation: pulse-anim 2s ease-in-out infinite; }
@keyframes pulse-anim { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }

/* Boards side-by-side */
main {
    display: flex;
    gap: 1px;
    height: calc(100vh - 42px);
    overflow: hidden;
}

.board-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}
.board-col:last-child { border-right: none; }

.board-header {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.board-header .active-count {
    font-size: 10px; font-weight: 600;
    padding: 1px 6px; border-radius: 8px;
    background: var(--border); color: var(--text-secondary);
}

/* Status rows */
.status-group { border-bottom: 1px solid var(--border); overflow: hidden; }
.status-group:last-child { border-bottom: none; }

.status-label {
    display: flex; align-items: center; justify-content: space-between;
    padding: 3px 10px; font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
    cursor: pointer; user-select: none;
}
.status-label .toggle { font-size: 8px; color: var(--text-muted); transition: transform 0.2s; }
.status-label.collapsed .toggle { transform: rotate(-90deg); }

.status-label.s-running  { background: rgba(59,130,246,0.1);  color: var(--running); border-left: 3px solid var(--running); }
.status-label.s-ready    { background: rgba(245,158,11,0.1);   color: var(--ready);   border-left: 3px solid var(--ready); }
.status-label.s-blocked  { background: rgba(239,68,68,0.1);    color: var(--blocked);  border-left: 3px solid var(--blocked); }
.status-label.s-todo      { background: rgba(139,92,246,0.1);  color: var(--todo);     border-left: 3px solid var(--todo); }
.status-label.s-done      { background: rgba(16,185,129,0.08); color: var(--done);     border-left: 3px solid var(--done); }

.status-count {
    font-size: 9px; background: rgba(255,255,255,0.08);
    padding: 0 5px; border-radius: 6px; min-width: 16px; text-align: center;
}

/* Tasks area */
.status-tasks {
    padding: 4px 6px 6px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.status-tasks.hidden { max-height: 0; padding: 0 6px; overflow: hidden; }

/* ───────────────────────────────────────────────
   CARD STYLE — running / ready / blocked / todo
   ─────────────────────────────────────────────── */
.task.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    line-height: 1.45;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    cursor: default;
}
.task.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 3px 12px rgba(0,0,0,0.35);
}

.task.card .card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.task.card .task-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task.card.running .task-title { color: var(--running); }
.task.card.blocked .task-title { color: var(--blocked); }

.task.card .card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.task.card .card-duration {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(59,130,246,0.15);
    color: var(--running);
    white-space: nowrap;
    animation: duration-pulse 3s ease-in-out infinite;
}

/* ───────────────────────────────────────────────
   COMPACT STYLE — done tasks
   ─────────────────────────────────────────────── */
.task.compact {
    padding: 3px 6px 2px;
    margin-bottom: 1px;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-secondary);
    background: transparent;
    transition: background 0.1s;
    cursor: default;
}
.task.compact:hover { background: var(--bg-card-hover); }

.task.compact .compact-line {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task.compact .compact-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    font-size: 11px;
}

.task.compact .compact-date {
    font-size: 9px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ───────────────────────────────────────────────
   Shared — assignee tags
   ─────────────────────────────────────────────── */
.assignee-tag {
    font-size: 9px;
    font-weight: 600;
    padding: 0px 4px;
    border-radius: 3px;
    text-transform: capitalize;
    white-space: nowrap;
    flex-shrink: 0;
}
.assignee-tag.card-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}
.assignee-tag.mario     { background: rgba(239,68,68,0.2); color: #f87171; }
.assignee-tag.adrian    { background: rgba(59,130,246,0.2); color: #60a5fa; }
.assignee-tag.joshua    { background: rgba(34,197,94,0.2); color: #4ade80; }
.assignee-tag.sebastian { background: rgba(245,158,11,0.2); color: #fbbf24; }
.assignee-tag.unassigned { background: rgba(107,114,128,0.2); color: #9ca3af; }

/* Empty state */
.empty-row {
    padding: 2px 10px;
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
}

@keyframes duration-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ───────────────────────────────────────────────
   MODAL OVERLAY & TASK DETAIL
   ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 16px;
    overflow-y: auto;
    backdrop-filter: blur(3px);
}
.modal-overlay.hidden { display: none; }

.modal {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 680px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 24px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    z-index: 10;
}
.modal-close:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.modal-error {
    color: var(--blocked);
    text-align: center;
    padding: 40px 0;
    font-size: 14px;
}

/* Header */
.modal-header {
    margin-bottom: 16px;
    padding-right: 30px;
}
.modal-task-id {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 8px;
}
.modal-header-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.modal-status-badge.s-running  { background: rgba(59,130,246,0.15); color: var(--running); }
.modal-status-badge.s-ready    { background: rgba(245,158,11,0.15); color: var(--ready); }
.modal-status-badge.s-blocked  { background: rgba(239,68,68,0.15);  color: var(--blocked); }
.modal-status-badge.s-todo     { background: rgba(139,92,246,0.15); color: var(--todo); }
.modal-status-badge.s-done     { background: rgba(16,185,129,0.12); color: var(--done); }

/* Meta row */
.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

/* Sections */
.modal-section {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.modal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.modal-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Status actions */
.modal-status-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.modal-btn-status {
    font-size: 12px;
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 600;
}
.modal-btn-status.s-running  { background: rgba(59,130,246,0.12); color: var(--running); border-color: rgba(59,130,246,0.25); }
.modal-btn-status.s-ready    { background: rgba(245,158,11,0.12); color: var(--ready); border-color: rgba(245,158,11,0.25); }
.modal-btn-status.s-blocked  { background: rgba(239,68,68,0.12);  color: var(--blocked); border-color: rgba(239,68,68,0.25); }
.modal-btn-status.s-done     { background: rgba(16,185,129,0.12); color: var(--done); border-color: rgba(16,185,129,0.25); }
.modal-btn-status:hover { filter: brightness(1.2); }
.modal-btn-status.current {
    box-shadow: 0 0 0 2px currentColor;
    opacity: 1;
}
.modal-btn-status:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Assign */
.modal-assign-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}
.modal-select:focus { border-color: var(--border-focus); }

.modal-btn {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 600;
    white-space: nowrap;
}
.modal-btn:hover { background: var(--bg-card-hover); }
.modal-btn-assign { border-color: rgba(59,130,246,0.3); color: var(--running); }
.modal-btn-assign:hover { background: rgba(59,130,246,0.15); }
.modal-btn-unassign { border-color: rgba(107,114,128,0.3); color: var(--text-muted); }
.modal-btn-unassign:hover { background: rgba(107,114,128,0.15); }
.modal-btn-comment { border-color: rgba(59,130,246,0.3); color: var(--running); }
.modal-btn-comment:hover { background: rgba(59,130,246,0.15); }

/* Body / Result text */
.modal-body-text, .modal-result-text {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    max-height: 260px;
    overflow-y: auto;
}
.modal-pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}
.modal-paragraph {
    white-space: pre-wrap;
    word-break: break-word;
}

.modal-section-error {
    background: rgba(239,68,68,0.06);
    border-radius: 6px;
    padding: 10px 14px;
    border: 1px solid rgba(239,68,68,0.15);
}
.modal-failure-count {
    margin-top: 6px;
    font-size: 11px;
    color: var(--blocked);
}

/* Links */
.modal-links-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 13px;
}
.modal-links-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 60px;
}
.modal-link {
    color: var(--running);
    cursor: pointer;
    text-decoration: underline;
    font-size: 13px;
    font-weight: 500;
}
.modal-link:hover { color: #93c5fd; }

/* Comments */
.modal-comments-list {
    margin-bottom: 10px;
    max-height: 240px;
    overflow-y: auto;
}
.modal-comment {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
.modal-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.modal-comment-time {
    font-size: 10px;
    color: var(--text-muted);
}
.modal-comment-body {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

.modal-comment-input {
    display: flex;
    gap: 8px;
}
.modal-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    outline: none;
    font-family: inherit;
    resize: vertical;
    min-height: 34px;
}
.modal-input:focus { border-color: var(--border-focus); }
.modal-input::placeholder { color: var(--text-muted); }

.modal-empty {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    padding: 8px 0;
}

/* Event history timeline */
.modal-events-timeline {
    max-height: 200px;
    overflow-y: auto;
}
.modal-event {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    line-height: 1.4;
}
.modal-event-kind {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.modal-event-payload {
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: normal;
}
.modal-event-reason {
    color: #f87171;
    font-weight: 600;
}
.modal-event-detail {
    color: var(--text-secondary);
    font-size: 11px;
    white-space: normal;
    overflow-wrap: break-word;
}
.modal-event-detail strong {
    color: var(--text-primary);
    font-weight: 600;
}
.modal-event.modal-event-blocked {
    background: rgba(239,68,68,0.08);
    border-left: 3px solid var(--blocked);
    padding-left: 8px;
    border-radius: 4px;
}
.modal-event-kind.kind-blocked {
    background: rgba(239,68,68,0.2);
    color: #f87171;
}
.modal-event-time {
    color: var(--text-muted);
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Run history table */
.modal-runs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.modal-runs-table th {
    text-align: left;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.modal-runs-table td {
    padding: 6px 8px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: top;
}
.modal-runs-table tr:hover td {
    background: var(--bg-card);
}
.modal-run-summary {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.outcome-completed { color: var(--done); }
.outcome-failed { color: var(--blocked); }

/* Make task cards clickable */
.task.card, .task.compact {
    cursor: pointer;
}

@media (max-width: 900px) {
    main { flex-direction: column; height: auto; overflow: auto; }
    .board-col { border-right: none; border-bottom: 1px solid var(--border); min-height: 300px; }
    .modal { max-width: 100%; }
}

/* ───────────────────────────────────────────────
   MODAL OVERLAY — Task Detail (extended classes)
   ─────────────────────────────────────────────── */

/* Overlay: full-screen semi-transparent backdrop */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(4px);
    transition: opacity 0.2s ease;
}
.modal-overlay.hidden { display: none; }

/* Modal box: centered, scrollable, rounded */
.modal {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 95%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255,255,255,0.05);
    overflow: hidden;
    animation: modal-slide-in 0.2s ease-out;
}
@keyframes modal-slide-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal header: fixed top bar */
.modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 28px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    position: relative;
}

/* Close button */
.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    background: transparent;
    border: none;
    transition: background 0.15s, color 0.15s;
    z-index: 10;
}
.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.modal-close:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* Modal body: scrollable content */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px 24px;
    overscroll-behavior: contain;
}

/* Task ID: small monospace muted */
.modal-task-id {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Task title: large bold */
.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 8px;
}

/* Badge: inline status pill */
.modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.modal-badge.s-running,
.modal-badge.running   { background: rgba(59,130,246,0.15);  color: var(--running); }
.modal-badge.s-ready,
.modal-badge.ready      { background: rgba(245,158,11,0.15);  color: var(--ready); }
.modal-badge.s-blocked,
.modal-badge.blocked    { background: rgba(239,68,68,0.15);    color: var(--blocked); }
.modal-badge.s-todo,
.modal-badge.todo       { background: rgba(139,92,246,0.15);   color: var(--todo); }
.modal-badge.s-done,
.modal-badge.done       { background: rgba(16,185,129,0.12);   color: var(--done); }

/* Meta row: assignee, priority, dates */
.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

/* Sections within modal body */
.modal-section {
    margin-top: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.modal-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Section title: uppercase small with colored border */
.modal-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--running);
}

/* ── Status action buttons ── */
.status-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.status-btn {
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.status-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}
.status-btn:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}
.status-btn.active {
    opacity: 0.6;
    cursor: default;
    box-shadow: inset 0 0 0 1px currentColor;
}
.status-btn.block {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--blocked);
    background: rgba(239, 68, 68, 0.08);
}
.status-btn.block:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
}
.status-btn.ready {
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--ready);
    background: rgba(245, 158, 11, 0.08);
}
.status-btn.ready:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.5);
    color: #fbbf24;
}
.status-btn.done {
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--done);
    background: rgba(16, 185, 129, 0.08);
}
.status-btn.done:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
}

/* ── Comments section ── */
.comment-list {
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 10px;
}
.comment-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.comment-item:last-child { border-bottom: none; }
.comment-author {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}
.comment-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 8px;
}
.comment-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 4px;
}

.comment-input-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.comment-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.comment-input:focus {
    border-color: var(--border-focus);
}
.comment-input::placeholder {
    color: var(--text-muted);
}
.comment-submit {
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.12);
    color: var(--running);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.comment-submit:hover {
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(59, 130, 246, 0.5);
}
.comment-submit:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* ── Event timeline ── */
.event-timeline {
    max-height: 200px;
    overflow-y: auto;
}
.event-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    line-height: 1.4;
}
.event-time {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.event-kind {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
/* Event kind color variants */
.event-kind.created   { color: var(--todo);  background: rgba(139,92,246,0.12); }
.event-kind.assigned  { color: var(--running); background: rgba(59,130,246,0.12); }
.event-kind.blocked   { color: var(--blocked); background: rgba(239,68,68,0.12); }
.event-kind.ready     { color: var(--ready); background: rgba(245,158,11,0.12); }
.event-kind.running   { color: var(--running); background: rgba(59,130,246,0.12); }
.event-kind.done      { color: var(--done); background: rgba(16,185,129,0.12); }
.event-kind.failed    { color: var(--blocked); background: rgba(239,68,68,0.12); }

/* ── Run history table ── */
.run-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.run-table th {
    text-align: left;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.run-table td {
    padding: 6px 8px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: top;
}
.run-table tr:hover td {
    background: var(--bg-card);
}
.run-outcome-completed { color: var(--done); font-weight: 600; }
.run-outcome-failed    { color: var(--blocked); font-weight: 600; }

/* ── Task link ── */
.task-link {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    color: var(--running);
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.15s;
}
.task-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}
.task-link:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* ── Accessibility focus styles ── */
.modal-overlay *:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* ── Mobile responsive ── */
@media (max-width: 700px) {
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .modal-header {
        padding: 16px 18px 12px;
    }
    .modal-body {
        padding: 16px 18px 20px;
    }
    .modal-title {
        font-size: 17px;
    }
    .modal-meta {
        flex-direction: column;
        gap: 6px;
    }
    .status-actions {
        gap: 6px;
    }
    .status-btn {
        height: 28px;
        padding: 0 10px;
        font-size: 11px;
    }
    .comment-input-row {
        flex-direction: column;
    }
}