:root {
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-hover: #1c2333;
    --bg-selected: #1f2a3d;
    --border: #30363d;
    --text: #e6edf3;
    --text-dim: #8b949e;
    --accent: #58a6ff;
    --green: #3fb950;
    --red: #f85149;
    --orange: #d29922;
    --purple: #bc8cff;
    --neon-green: #39ff14;
    --neon-purple: #b026ff;
}

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

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Header --- */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}

header h1 {
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--neon-green), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
    user-select: none;
}
header h1:hover { filter: brightness(1.2); }

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

.mr-count {
    font-size: 12px;
    color: var(--text-dim);
}

select, button {
    font-family: inherit;
    font-size: 12px;
    padding: 5px 10px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
}

select:hover, button:hover { border-color: var(--accent); }

#refresh-btn { font-size: 16px; padding: 3px 8px; }

/* --- Split Layout --- */
:root { --left-panel-width: 380px; }
.split-layout {
    display: grid;
    grid-template-columns: var(--left-panel-width) 0 1fr;
    flex: 1;
    overflow: hidden;
}

.split-layout > .mr-sidebar { grid-column: 1; }
.split-layout > .files-panel { grid-column: 2; }
.split-layout > .mr-detail  { grid-column: 3; }

.split-layout.sidebar-collapsed {
    grid-template-columns: 0 var(--left-panel-width) 1fr;
}

.split-layout .files-panel { display: none; }
.split-layout.sidebar-collapsed .files-panel { display: flex; }
.split-layout.sidebar-collapsed .mr-sidebar { display: none; }

/* --- Left: MR Sidebar --- */
.mr-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
}

.sidebar-collapse-btn,
.sidebar-expand-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 2;
}

.sidebar-collapse-btn { right: 36px; }
.sidebar-collapse-btn:hover,
.sidebar-expand-btn:hover { border-color: var(--accent); color: var(--accent); }

.files-panel {
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg);
}

.files-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: relative;
}

.files-panel-title {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.files-panel-header .sidebar-expand-btn {
    position: static;
    transform: none;
    font-size: 11px;
    padding: 4px 10px;
    font-weight: 600;
    background: var(--bg-card);
    color: var(--accent);
    border: 1px solid var(--accent);
}
.files-panel-header .sidebar-expand-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.files-panel-list {
    overflow-y: auto;
    padding: 6px;
    flex: 1;
    font-size: 11px;
}

.file-entry {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 2px;
    line-height: 1.3;
}

.file-entry:hover { background: var(--bg-hover); }
.file-entry.active { background: var(--bg-selected); border-color: var(--accent); }

.file-entry-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: rtl;
    text-align: left;
    color: var(--text);
}

.file-entry-stats {
    flex-shrink: 0;
    font-size: 10px;
    font-family: monospace;
}

.file-entry-stats .add { color: var(--neon-green); }
.file-entry-stats .del { color: var(--red); }

.file-group { margin-bottom: 8px; }
.file-group.branch > .file-group-header { border-bottom-style: solid; }
.file-group.depth-2 { margin-left: 6px; }
.file-group.depth-3 { margin-left: 10px; }
.file-group.depth-4 { margin-left: 14px; }

.file-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    margin-top: 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    border-bottom: 1px dashed var(--border);
}
.file-group.depth-2 > .file-group-header { color: #9b7ff0; }
.file-group.depth-3 > .file-group-header { color: #d183f0; font-size: 9px; }
.file-group.depth-4 > .file-group-header { color: #e8a7a7; font-size: 9px; }

.file-group-count {
    font-size: 9px;
    color: var(--text-dim);
    margin-left: auto;
}

.file-entry-badge {
    flex-shrink: 0;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    background: var(--bg-card);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.mr-search-wrap {
    position: relative;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.mr-search {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 6px 28px 6px 10px;
    font-family: inherit;
    font-size: 12px;
}

.mr-search:focus {
    border-color: var(--neon-green);
    outline: none;
}

.mr-search::placeholder {
    color: var(--text-dim);
}

.mr-search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    padding: 0 4px;
    cursor: pointer;
}

.mr-search-clear:hover {
    color: var(--red);
}

.mr-search-clear.hidden {
    display: none;
}

.mr-list {
    overflow-y: auto;
    padding: 8px;
    flex: 1;
}

.mr-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
    border: 1px solid transparent;
    margin-bottom: 4px;
}

.mr-card:hover { background: var(--bg-hover); }
.mr-card.selected { background: var(--bg-selected); border-color: var(--accent); }

.mr-card .pipeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.dot-success { background: var(--green); }
.dot-failed { background: var(--red); }
.dot-running { background: var(--accent); animation: pulse 1.5s infinite; }
.dot-pending { background: var(--orange); }
.dot-unknown { background: var(--text-dim); }

@keyframes pulse { 50% { opacity: 0.4; } }

.mr-card-info { min-width: 0; flex: 1; }

.mr-card-title {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mr-card-meta {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 6px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.mr-card-status {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
}

.status-waiting {
    background: rgba(210, 153, 34, 0.2);
    color: var(--orange);
}

.status-ready {
    background: rgba(63, 185, 80, 0.2);
    color: var(--green);
}

.status-approved {
    background: rgba(63, 185, 80, 0.3);
    color: var(--green);
}

.status-reviewed {
    background: rgba(88, 166, 255, 0.2);
    color: var(--accent);
}

.status-rereview {
    background: rgba(248, 81, 73, 0.2);
    color: var(--red);
    animation: pulse 2s infinite;
}

.status-ongoing {
    background: rgba(88, 166, 255, 0.2);
    color: var(--accent);
    border: 1px solid rgba(88, 166, 255, 0.3);
}

/* Size indicators */
.size-info {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.size-label {
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 10px;
}

/* Conventional Comments labels — colored badge preceding the title.
   Rendered by renderConventionalLabel() when a finding title parses
   as `<label>[ (<decoration>)]: <subject>`. Legacy findings without
   a label render as plain text and skip this styling entirely. */
.cc-label {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid transparent;
}
.cc-issue      { background: rgba(248, 81, 73, 0.22);   color: #ff8b80; border-color: rgba(248, 81, 73, 0.45); }
.cc-suggestion { background: rgba(88, 166, 255, 0.22);  color: #79b8ff; border-color: rgba(88, 166, 255, 0.45); }
.cc-nitpick    { background: rgba(139, 148, 158, 0.22); color: #b0bac6; border-color: rgba(139, 148, 158, 0.4); }
.cc-question   { background: rgba(210, 153, 34, 0.22);  color: #e3c06a; border-color: rgba(210, 153, 34, 0.45); }
.cc-todo       { background: rgba(155, 127, 240, 0.22); color: #b69bff; border-color: rgba(155, 127, 240, 0.45); }
.cc-thought    { background: rgba(88, 166, 255, 0.15);  color: #a6c8f0; border-color: rgba(88, 166, 255, 0.3); }
.cc-chore      { background: rgba(210, 153, 34, 0.18);  color: #d7b56e; border-color: rgba(210, 153, 34, 0.35); }
.cc-note       { background: rgba(139, 148, 158, 0.18); color: #c0c8d0; border-color: rgba(139, 148, 158, 0.35); }
.cc-typo       { background: rgba(155, 127, 240, 0.18); color: #c9b5ff; border-color: rgba(155, 127, 240, 0.4); }
.cc-polish     { background: rgba(63, 185, 80, 0.18);   color: #7de088; border-color: rgba(63, 185, 80, 0.4); }
.cc-quibble    { background: rgba(139, 148, 158, 0.22); color: #b0bac6; border-color: rgba(139, 148, 158, 0.4); }
.cc-praise     { background: rgba(63, 185, 80, 0.22);   color: #6ad974; border-color: rgba(63, 185, 80, 0.45); }

.cc-decoration {
    font-size: 9px;
    color: var(--text-dim);
    font-style: italic;
    margin-right: 4px;
}

.cc-subject { font-weight: 600; }

.pending-cr-badge {
    background: linear-gradient(135deg, rgba(155, 127, 240, 0.25), rgba(88, 166, 255, 0.25));
    color: #d6c7ff;
    border: 1px solid #9b7ff0;
    font-weight: 600;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    animation: pending-cr-pulse 1.6s ease-in-out infinite;
}
.pending-cr-badge:hover { background: rgba(155, 127, 240, 0.4); }
@keyframes pending-cr-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(155, 127, 240, 0.5); }
    50%      { box-shadow: 0 0 0 4px rgba(155, 127, 240, 0); }
}
.pending-cr-list { display: flex; flex-direction: column; gap: 8px; }
.pending-cr-row {
    display: flex; flex-direction: column; gap: 6px;
    padding: 10px 12px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 12px;
}
.pending-cr-head {
    display: flex; justify-content: space-between; align-items: center;
}
.pending-cr-stage {
    color: var(--accent-purple, #9b7ff0); font-weight: 600; font-size: 11px;
}
.pending-cr-bar {
    height: 4px; background: rgba(155, 127, 240, 0.15);
    border-radius: 2px; overflow: hidden;
}
.pending-cr-bar-fill {
    height: 100%; background: linear-gradient(90deg, #9b7ff0, #3fb950);
    transition: width 0.4s ease;
}
.pending-cr-tool {
    font-family: var(--mono, monospace); font-size: 11px;
    color: var(--green, #3fb950);
}
.pending-cr-tool .dim { color: var(--text-dim); }
.pending-cr-counts { font-size: 11px; }

.mr-draft-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(210, 153, 34, 0.2);
    color: var(--orange, #d29922);
    border: 1px solid rgba(210, 153, 34, 0.4);
    border-radius: 3px;
    vertical-align: middle;
}
.mr-draft-pill {
    display: inline-block;
    padding: 1px 5px;
    font-size: 9px;
    font-weight: 700;
    background: rgba(210, 153, 34, 0.25);
    color: var(--orange, #d29922);
    border-radius: 2px;
    letter-spacing: 0.3px;
}
.mr-card-draft { opacity: 0.75; }
.mr-card-draft .mr-card-title { font-style: italic; }

.btn-ready {
    background: rgba(63, 185, 80, 0.2);
    color: var(--green, #3fb950);
    border: 1px solid rgba(63, 185, 80, 0.5);
}
.btn-ready:hover {
    background: rgba(63, 185, 80, 0.35);
}
.btn-draft-toggle {
    background: rgba(210, 153, 34, 0.15);
    color: var(--orange, #d29922);
    border: 1px solid rgba(210, 153, 34, 0.4);
}
.btn-draft-toggle:hover {
    background: rgba(210, 153, 34, 0.3);
}

/* --- Version chip + changelog modal --- */
.version-chip {
    background: rgba(155, 127, 240, 0.15);
    color: var(--accent-purple, #9b7ff0);
    border: 1px solid rgba(155, 127, 240, 0.4);
    font-family: var(--mono, monospace);
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 3px;
    cursor: pointer;
    letter-spacing: 0.3px;
    margin: 0 4px;
}
.version-chip:hover {
    background: rgba(155, 127, 240, 0.3);
    color: #fff;
}

.modal-wide { max-width: 820px; width: 92vw; }
.modal-wide .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 14px 22px;
    /* Override the base .modal-body pre-wrap which renders every
       newline + indent in the HTML template literal as visible space.
       For rich-HTML content we want normal whitespace collapsing. */
    white-space: normal;
}

/* Kill every inherited margin / padding inside the changelog modal so
   browser h4/ul defaults and modal-body rules can't stack vertical
   space between sections. All spacing is set explicitly below. */
.changelog-tabs,
.changelog-panes,
.changelog-pane,
.changelog-pane * {
    margin: 0;
    padding: 0;
}

.changelog-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}
.changelog-tab {
    background: transparent;
    color: var(--text-dim);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    line-height: 1.2;
}
.changelog-tab:hover { color: var(--text); }
.changelog-tab.active {
    color: var(--accent-purple, #9b7ff0);
    border-bottom-color: var(--accent-purple, #9b7ff0);
}
.changelog-current {
    display: inline-block;
    margin-left: 6px;
    font-family: var(--mono, monospace);
    font-size: 11px;
    padding: 1px 5px;
    background: rgba(155, 127, 240, 0.2);
    border-radius: 2px;
}

.changelog-pane { display: none; padding: 4px 2px 8px 2px; }
.changelog-pane.active { display: block; }

.changelog-version {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
}
.changelog-version:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.changelog-version-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}
.changelog-version-number {
    font-family: var(--mono, monospace);
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-purple, #9b7ff0);
    line-height: 1.2;
}
.changelog-latest {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    background: rgba(63, 185, 80, 0.25);
    color: var(--green, #3fb950);
    border: 1px solid rgba(63, 185, 80, 0.5);
    border-radius: 2px;
    letter-spacing: 0.5px;
    line-height: 1.3;
}
.changelog-version-date {
    font-size: 11px;
    color: var(--text-dim);
    margin-left: auto;
    font-family: var(--mono, monospace);
}
.changelog-version-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}
.changelog-section { margin-top: 4px; }
.changelog-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--green, #3fb950);
    text-transform: uppercase;
    margin-bottom: 2px;
    line-height: 1.2;
}
.changelog-items {
    list-style: disc;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.45;
}
.changelog-items li {
    margin-bottom: 2px;
    color: var(--text);
}

.size-xs  { background: rgba(139, 148, 158, 0.25); color: var(--text-dim); }
.size-sm  { background: rgba(63, 185, 80, 0.25);   color: var(--green); }
.size-md  { background: rgba(88, 166, 255, 0.25);  color: var(--accent); }
.size-lg  { background: rgba(210, 153, 34, 0.25);  color: var(--orange); }
.size-xl  { background: rgba(248, 81, 73, 0.25);   color: var(--red); }
.size-xxl {
    background: rgba(248, 81, 73, 0.45);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(248, 81, 73, 0.6);
    animation: size-xxl-pulse 2s ease-in-out infinite;
}
@keyframes size-xxl-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(248, 81, 73, 0.6); }
    50%      { box-shadow: 0 0 0 2px rgba(248, 81, 73, 0.9); }
}

.size-files { color: var(--text); }
.size-add { color: var(--green); }
.size-del { color: var(--red); }

/* --- Right: Detail Panel --- */
.mr-detail {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.detail-header-sticky {
    flex-shrink: 0;
    padding: 16px 20px 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.detail-header-sticky h2 {
    font-size: 16px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.detail-tabs {
    display: flex;
    gap: 0;
    margin-top: 14px;
    border-bottom: 1px solid var(--border);
    margin-left: -20px;
    margin-right: -20px;
    padding: 0 20px;
}

.tab {
    background: none;
    border: none;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 12px;
    color: var(--text-dim);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.tab.active {
    color: var(--neon-green);
    border-bottom-color: var(--neon-green);
}

.tab-count {
    background: var(--bg);
    color: var(--text-dim);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
}

.tab.active .tab-count {
    background: var(--neon-green);
    color: var(--bg);
}

.tab-count-orange {
    background: var(--orange) !important;
    color: var(--bg) !important;
}

.detail-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.tab-pane {
    display: none;
    /* Bottom padding so short content can be scrolled to top after switching tabs */
    padding-bottom: 60vh;
}

.tab-pane.active {
    display: block;
}

.tab-pane-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

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

/* --- Dismissed findings tab --- */
.dismissed-info {
    color: var(--text-dim);
    font-size: 11px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-left: 3px solid var(--orange);
    border-radius: 4px;
}

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

.dismissed-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    opacity: 0.7;
    transition: opacity 0.15s;
}

.dismissed-card:hover {
    opacity: 1;
}

.dismissed-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
}

.dismissed-body {
    flex: 1;
    min-width: 0;
}

.dismissed-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.dismissed-title {
    font-size: 12px;
    font-weight: 600;
    text-decoration: line-through;
    text-decoration-color: var(--text-dim);
}

.dismissed-desc {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
    line-height: 1.5;
}

.dismissed-reason {
    font-size: 10px;
    color: var(--orange);
    margin-top: 6px;
    font-style: italic;
}

.dismissed-restore-btn {
    flex-shrink: 0;
    font-size: 14px;
    padding: 4px 10px;
    color: var(--green);
    border-color: var(--green);
}

.dismissed-restore-btn:hover {
    background: var(--green);
    color: var(--bg);
}

/* --- Reported tab --- */
.reported-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reported-section-title {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 14px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.reported-section-title:first-of-type {
    margin-top: 0;
}

.reported-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.reported-card.reported-resolved {
    opacity: 0.6;
}

.reported-card.reported-resolved:hover {
    opacity: 1;
}

.reported-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
}

.reported-body {
    flex: 1;
    min-width: 0;
}

.reported-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.reported-title {
    font-size: 12px;
    font-weight: 600;
}

.reported-desc {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
    line-height: 1.5;
}

.reported-goto-btn {
    flex-shrink: 0;
    font-size: 14px;
    padding: 4px 10px;
}

.reported-status-badge {
    margin-left: auto;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    font-size: 14px;
}

.detail-header {
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
}

.detail-header h2 {
    font-size: 16px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.detail-meta {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.detail-description {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-dim);
    white-space: pre-wrap;
    line-height: 1.5;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* Description images */
.desc-img {
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin: 8px 0;
    display: block;
    cursor: pointer;
}

.desc-img:hover {
    border-color: var(--accent);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 8px;
}

.detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.btn {
    font-family: inherit;
    font-size: 12px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    background: var(--bg);
    color: var(--text);
    transition: all 0.15s;
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-approve { border-color: var(--green); color: var(--green); }
.btn-approve:hover { background: var(--green); color: var(--bg); }
.btn-claude { border-color: var(--neon-green); color: var(--neon-green); }
.btn-claude:hover { background: var(--neon-green); color: var(--bg); }
.btn-claude-deep { border-color: var(--neon-purple); color: var(--neon-purple); }
.btn-claude-deep:hover { background: var(--neon-purple); color: var(--bg); }

.btn-mark-reviewed {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-mark-reviewed:hover {
    background: var(--accent);
    color: var(--bg);
}
.btn-mark-reviewed.active {
    background: var(--accent);
    color: var(--bg);
}

.btn-danger {
    border-color: var(--red);
    color: var(--red);
}
.btn-danger:hover {
    background: var(--red);
    color: var(--bg);
}

.cr-select {
    font-size: 11px;
    padding: 4px 6px;
    background: var(--bg);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 4px;
}

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

.btn-loading {
    position: relative;
}

.btn-loading .spinner {
    width: 12px;
    height: 12px;
    margin-right: 4px;
    vertical-align: -1px;
}

/* --- Diff --- */
.detail-section { margin-bottom: 16px; }

.detail-section h3 {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.diff-file {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-card);
}

.diff-file-header {
    padding: 6px 12px;
    background: var(--bg-hover);
    font-size: 11px;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
}

.diff-file-header:hover { background: var(--bg-card); }

.diff-content {
    font-size: 11px;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

.diff-content.collapsed { display: none; }

.diff-toggle-btns {
    float: right;
    display: inline-flex;
    gap: 4px;
}

.btn-sm {
    font-size: 10px;
    padding: 2px 8px;
}

.line-num {
    display: inline-block;
    width: 40px;
    text-align: right;
    margin-right: 8px;
    color: var(--text-dim);
    opacity: 0.4;
    user-select: none;
    font-size: 10px;
    cursor: pointer;
    transition: opacity 0.1s, color 0.1s;
}

.line-num:hover {
    opacity: 1;
    color: var(--neon-green);
}

.diff-line:hover .line-num {
    opacity: 0.8;
}

/* Inline comment form */
.inline-comment-form {
    margin: 4px 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--neon-green);
    border-radius: 6px;
}

.inline-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 11px;
    color: var(--accent);
}

.inline-comment-textarea {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
}

.inline-comment-textarea:focus {
    border-color: var(--accent);
    outline: none;
}

.inline-comment-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.discussion-reply {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.discussion-reply-form {
    margin-top: 6px;
}

.discussion-reply-textarea {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}

.discussion-reply-textarea:focus {
    border-color: var(--accent);
    outline: none;
}

.discussion-reply-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.diff-line {
    padding: 0 12px;
    white-space: pre;
    font-family: inherit;
}

/* Finding markers in diff */
.finding-marker {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid;
    margin: 2px 0;
}

.finding-marker.finding-critical-bg { border-left-color: var(--red); }
.finding-marker.finding-warning-bg { border-left-color: var(--orange); }
.finding-marker.finding-suggestion-bg { border-left-color: var(--accent); }
.finding-marker.finding-praise-bg { border-left-color: var(--green); }

.finding-marker-icon { flex-shrink: 0; }

.finding-marker-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.finding-marker-back {
    font-family: inherit;
    font-size: 10px;
    padding: 1px 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.finding-marker-back:hover {
    background: var(--accent);
    color: var(--bg);
}

.finding-marker-flash {
    animation: markerFlash 2s ease;
    position: relative;
    z-index: 10;
}

@keyframes markerFlash {
    0% {
        box-shadow: 0 0 0 4px var(--neon-green), 0 0 24px 8px rgba(57, 255, 20, 0.6);
        background-color: rgba(57, 255, 20, 0.15);
    }
    30% {
        box-shadow: 0 0 0 3px var(--neon-green), 0 0 20px 6px rgba(57, 255, 20, 0.5);
        background-color: rgba(57, 255, 20, 0.12);
    }
    100% {
        box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent;
        background-color: transparent;
    }
}

.finding-goto-btn {
    font-size: 12px;
    padding: 3px 6px;
    opacity: 0.5;
}

.finding-card:hover .finding-goto-btn { opacity: 1; }

.diff-add { background: rgba(63, 185, 80, 0.08); color: var(--green); }
.diff-del { background: rgba(248, 81, 73, 0.08); color: var(--red); }
.diff-hunk { color: var(--purple); background: rgba(188, 140, 255, 0.05); }

/* Claude Review — Findings */
.findings-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.findings-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.finding-card {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.finding-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.finding-check {
    flex-shrink: 0;
    margin-top: 2px;
}

.finding-check input { cursor: pointer; }

.finding-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.finding-critical { color: var(--red); }
.finding-warning { color: var(--orange); }
.finding-suggestion { color: var(--accent); }
.finding-praise { color: var(--green); }

.finding-critical-bg { background: rgba(248, 81, 73, 0.05); border-color: rgba(248, 81, 73, 0.2); }
.finding-warning-bg { background: rgba(210, 153, 34, 0.05); border-color: rgba(210, 153, 34, 0.2); }
.finding-suggestion-bg { background: rgba(88, 166, 255, 0.05); border-color: rgba(88, 166, 255, 0.2); }
.finding-praise-bg { background: rgba(63, 185, 80, 0.05); border-color: rgba(63, 185, 80, 0.2); }

.finding-icon {
    background: rgba(255, 255, 255, 0.05);
}

.finding-body {
    flex: 1;
    min-width: 0;
}

.finding-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.finding-title {
    font-size: 12px;
    font-weight: 600;
}

.finding-file {
    font-size: 10px;
    color: var(--accent);
}

.finding-editor {
    font-family: inherit;
    font-size: 11px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 8px;
    margin-top: 4px;
    line-height: 1.5;
    width: 100%;
    resize: vertical;
    min-height: 40px;
    overflow: hidden; /* JS autoResizeTextarea grows it to fit content */
    box-sizing: border-box;
}

.finding-editor:focus {
    border-color: var(--accent);
    outline: none;
}

.finding-btns {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.finding-post-btn {
    font-size: 14px;
    padding: 4px 8px;
    opacity: 0.5;
}

.finding-card:hover .finding-post-btn { opacity: 1; }

.finding-posted {
    color: var(--green);
    font-size: 14px;
}

.finding-posted.hidden { display: none; }

.finding-new {
    animation: fadeIn 0.5s ease-in;
    box-shadow: 0 0 8px rgba(176, 38, 255, 0.3);
}

.finding-new-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--neon-purple);
    color: white;
}

.finding-delete-btn {
    font-size: 14px;
    padding: 3px 8px;
    opacity: 0.4;
    color: var(--red);
    border-color: var(--red);
}

.finding-delete-btn:hover {
    opacity: 1;
    background: var(--red);
    color: var(--bg);
}

/* --- Finding conversation --- */
.finding-conversation {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.conv-message {
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
    font-size: 12px;
}

.conv-user {
    background: rgba(88, 166, 255, 0.08);
    border-left: 3px solid var(--accent);
}

.conv-assistant {
    background: rgba(57, 255, 20, 0.06);
    border-left: 3px solid var(--neon-green);
}

.conv-author {
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 4px;
    font-weight: 600;
}

.conv-body {
    line-height: 1.5;
    white-space: pre-wrap;
}

.conv-input-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.conv-input {
    flex: 1;
    font-family: inherit;
    font-size: 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 8px;
    line-height: 1.5;
    resize: vertical;
}

.conv-input:focus {
    border-color: var(--neon-green);
    outline: none;
}

.conv-send-btn {
    flex-shrink: 0;
}

.conv-btns {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    align-self: stretch;
    justify-content: flex-end;
}

.conv-update-btn {
    flex-shrink: 0;
}

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

/* Error display */
.claude-error {
    padding: 16px 20px;
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid var(--red);
    border-radius: 8px;
    margin-bottom: 16px;
}

.claude-error strong {
    color: var(--red);
    font-size: 13px;
}

.claude-error pre {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-dim);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
}

/* Discussions (threaded) */
.discussion {
    border: 1px solid var(--border);
    border-left: 3px solid var(--orange);
    border-radius: 6px;
    margin-bottom: 14px;
    overflow: hidden;
    background: var(--bg-card);
}

.discussion-open {
    border-left-color: var(--orange);
}

.discussion-resolved {
    border-left-color: var(--green);
    opacity: 0.7;
}

.discussion-resolved:hover {
    opacity: 1;
}

.discussion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-hover);
    font-size: 11px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.discussion-header:hover {
    background: var(--bg);
}

.discussion-collapse-icon {
    color: var(--text-dim);
    transition: transform 0.15s;
    flex-shrink: 0;
    font-size: 10px;
}

.discussion.collapsed .discussion-collapse-icon {
    transform: rotate(-90deg);
}

.discussion.collapsed .discussion-body {
    display: none;
}

.discussion.collapsed .discussion-header {
    border-bottom: none;
}

.discussion-status-badge {
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.discussion-status-badge.open {
    background: rgba(210, 153, 34, 0.2);
    color: var(--orange);
    border: 1px solid var(--orange);
}

.discussion-status-badge.resolved {
    background: rgba(63, 185, 80, 0.2);
    color: var(--green);
    border: 1px solid var(--green);
}

.discussion-location {
    color: var(--accent);
    font-family: inherit;
    flex-shrink: 0;
}

.discussion-author-preview {
    flex: 1;
    min-width: 0;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discussion-author-preview strong {
    color: var(--text);
    margin-right: 4px;
}

.discussion-preview-text {
    color: var(--text-dim);
}

.discussion-reply-count {
    color: var(--accent);
    margin-left: 6px;
    font-size: 10px;
}

.discussion-resolve-btn {
    flex-shrink: 0;
}

.discussion-resolve-btn:hover {
    background: var(--green);
    color: var(--bg);
    border-color: var(--green);
}

.discussion-resolved-badge {
    color: var(--green);
    font-weight: 600;
}

.note {
    padding: 10px 12px;
    background: var(--bg-card);
    font-size: 12px;
}

.note + .note {
    border-top: 1px solid var(--border);
}

.note-reply {
    padding-left: 28px;
    background: var(--bg);
    border-left: 3px solid var(--border);
    margin-left: 12px;
}

.note-author {
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.note-body {
    line-height: 1.5;
}

.note-body img.desc-img {
    max-width: 100%;
    max-height: 400px;
}

/* Discussion location — clickable */
.discussion-location {
    cursor: pointer;
    user-select: none;
}

.discussion-location:hover {
    color: var(--neon-green);
}

/* Diff snippet inside discussion */
.discussion-snippet {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    line-height: 1.5;
    overflow-x: auto;
    padding: 6px 0;
}

.discussion-snippet.collapsed {
    display: none;
}

.snippet-toggle {
    margin-left: auto;
}

/* Discussion markers in main diff */
.discussion-marker {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(210, 153, 34, 0.1);
    border-left: 3px solid var(--orange);
    margin: 2px 0;
    cursor: pointer;
}

.discussion-marker::before {
    content: 'OPEN';
    background: var(--orange);
    color: var(--bg);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.discussion-marker:hover {
    background: rgba(210, 153, 34, 0.2);
}

.discussion-marker.resolved {
    opacity: 0.55;
    border-left-color: var(--green);
    background: rgba(63, 185, 80, 0.08);
}

.discussion-marker.resolved::before {
    content: '✓ RESOLVED';
    background: var(--green);
}

.discussion-marker.resolved:hover {
    opacity: 1;
    background: rgba(63, 185, 80, 0.15);
}

.discussion-marker-icon {
    flex-shrink: 0;
    color: var(--accent);
}

.discussion-marker-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-dim);
    font-weight: 400;
}

.discussion-marker-author {
    color: var(--text);
    font-weight: 600;
}

.discussion-marker-count {
    flex-shrink: 0;
    background: var(--accent);
    color: var(--bg);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
}

.discussion-snippet-missing {
    padding: 8px 12px;
    color: var(--text-dim);
    font-style: italic;
    font-size: 11px;
}

.discussion-snippet .diff-line {
    padding: 0 12px;
}

.discussion-snippet .snippet-target {
    background: rgba(176, 38, 255, 0.15);
    border-left: 3px solid var(--neon-purple);
    padding-left: 9px;
}

/* Reactions */
.note-reactions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.reaction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 12px;
    cursor: default;
}

.reaction:hover {
    border-color: var(--accent);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    transition: opacity 0.3s;
}

.toast.hidden { opacity: 0; pointer-events: none; }

/* --- Modal --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--neon-green);
    border-radius: 10px;
    min-width: 420px;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 0 40px rgba(57, 255, 20, 0.2), 0 8px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: modalSlide 0.2s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-20px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

.modal-header {
    padding: 16px 22px;
    font-size: 14px;
    font-weight: 600;
    color: var(--neon-green);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(57, 255, 20, 0.05), transparent);
}

.modal-body {
    padding: 18px 22px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    overflow-y: auto;
    flex: 1;
}

.modal-input-wrap {
    padding: 0 22px 14px;
}

.modal-input-wrap.hidden {
    display: none;
}

.modal-input-wrap textarea {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
}

.modal-input-wrap textarea:focus {
    border-color: var(--neon-green);
    outline: none;
}

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

.modal-cancel {
    color: var(--text-dim);
}

.modal-confirm {
    background: var(--neon-green);
    color: var(--bg);
    border-color: var(--neon-green);
    font-weight: 600;
}

.modal-confirm:hover {
    background: transparent;
    color: var(--neon-green);
}

.modal-confirm.danger {
    background: var(--red);
    border-color: var(--red);
    color: white;
}

.modal-confirm.danger:hover {
    background: transparent;
    color: var(--red);
}
.toast.success { background: var(--green); color: var(--bg); }
.toast.error { background: var(--red); color: white; }
.toast.info { background: var(--accent); color: var(--bg); }

.loading {
    text-align: center;
    color: var(--text-dim);
    padding: 40px;
    font-size: 13px;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* --- Login screen & user badge (Stage 4) --- */

.hidden { display: none !important; }

.login-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 20px;
}

.login-card {
    max-width: 520px;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--neon-green);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 0 40px rgba(57, 255, 20, 0.08);
}

.login-card h2 {
    margin-bottom: 12px;
    color: var(--neon-green);
    font-size: 16px;
}

.login-help {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 16px;
}

.login-help a {
    color: var(--accent);
    text-decoration: none;
}

.login-help a:hover {
    text-decoration: underline;
}

.login-help code {
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--neon-purple);
    font-size: 11px;
}

.login-token-input {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 12px;
    margin-bottom: 12px;
}

.login-token-input:focus {
    border-color: var(--neon-green);
    outline: none;
}

.login-actions {
    display: flex;
    justify-content: flex-end;
}

.login-error {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--red);
    border-radius: 4px;
    color: var(--red);
    font-size: 11px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
}

.user-badge-name {
    color: var(--text-dim);
}

#logout-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0 4px;
    font-size: 14px;
}

#logout-btn:hover {
    color: var(--red);
}

/* --- Worker indicator (Phase C) --- */

.worker-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 10px;
    color: var(--text-dim);
    cursor: help;
    margin-right: 4px;
}

.worker-indicator .worker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-dim);
    box-shadow: 0 0 0 0 var(--text-dim);
}

.worker-indicator.online {
    border-color: var(--green);
    color: var(--green);
}

.worker-indicator.online .worker-dot {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: worker-pulse 2s ease-in-out infinite;
}

.worker-indicator.offline {
    border-color: var(--red);
    color: var(--red);
}

.worker-indicator.offline .worker-dot {
    background: var(--red);
}

@keyframes worker-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Sessions modal */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
}
.session-row {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
}
.session-row .session-meta {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 2px;
}
#sessions-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0 4px;
    font-size: 12px;
}
#sessions-btn:hover { color: var(--accent); }

/* --- Worker install banner --- */

.worker-install-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--orange);
    background: rgba(210, 153, 34, 0.12);
    color: var(--text);
    font-size: 12px;
    flex-shrink: 0;
}

.worker-install-banner.wib-offline {
    background: rgba(210, 153, 34, 0.12);
    border-bottom-color: var(--orange);
}

.worker-install-banner.wib-outdated {
    background: rgba(188, 140, 255, 0.10);
    border-bottom-color: var(--purple);
}

.worker-install-banner code {
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--neon-purple);
    font-size: 11px;
}

.worker-install-banner.hidden { display: none; }

.worker-install-banner .wib-text {
    flex: 1;
    line-height: 1.5;
}

.worker-install-banner .wib-text strong {
    color: var(--orange);
    margin-right: 6px;
}

.worker-install-banner .wib-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

#wib-dismiss {
    min-width: 28px;
    padding: 2px 8px;
    color: var(--text-dim);
}

.install-help { font-size: 12px; line-height: 1.6; }
.install-help p { margin: 8px 0; }
.install-help ul { margin: 8px 0 8px 20px; }
.install-help pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 11px;
    overflow-x: auto;
    white-space: pre;
}
.install-help code {
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--neon-purple);
    font-size: 11px;
}

/* Install one-liner modal — pre box with inline copy button */
.oneliner-box {
    position: relative;
    margin: 10px 0;
}
.oneliner-box .oneliner-pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px 80px 10px 10px;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--neon-green);
    user-select: all;
    cursor: text;
    max-height: 160px;
    overflow-y: auto;
}
.oneliner-copy {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 10px;
    font-size: 10px;
}

/* --- RE-REVIEW summary panel --- */
.rereview-panel {
    background: rgba(188, 140, 255, 0.08);
    border: 1px solid var(--purple);
    border-radius: 6px;
    padding: 10px 14px;
    margin: 8px 0 12px 0;
    font-size: 11px;
}
.rereview-panel .rr-header {
    color: var(--purple);
    margin-bottom: 8px;
}
.rereview-panel .rr-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.rereview-panel .rr-tile {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: border-color 0.1s;
}
.rereview-panel .rr-tile:hover {
    border-color: var(--purple);
}
.rereview-panel .rr-tile-mine {
    cursor: default;
    opacity: 0.7;
}
.rereview-panel .rr-n {
    font-weight: 700;
    color: var(--neon-purple);
    font-size: 14px;
}
.rereview-panel .rr-label {
    color: var(--text-dim);
    font-size: 11px;
}

/* Sidebar RE-REVIEW badge can optionally show count — future */

/* --- Commity tab --- */
.commit-card {
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 6px;
    overflow: hidden;
}
.commit-card.commit-new {
    border-color: var(--purple);
    box-shadow: 0 0 0 1px rgba(188, 140, 255, 0.2);
}
.commit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
}
.commit-row:hover {
    background: var(--bg-hover);
}
.commit-toggle {
    width: 12px;
    color: var(--text-dim);
    font-size: 10px;
    flex-shrink: 0;
}
.commit-sha {
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    color: var(--accent);
    flex-shrink: 0;
}
.commit-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}
.commit-badge-new {
    background: var(--purple);
    color: var(--bg);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.commit-meta {
    color: var(--text-dim);
    font-size: 10px;
    flex-shrink: 0;
}
.commit-body {
    display: none;
    padding: 10px 12px;
    background: var(--bg);
    border-top: 1px solid var(--border);
}
.commit-message {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 10px;
    font-size: 11px;
    white-space: pre-wrap;
    color: var(--text-dim);
}
