:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #1c2128;
  --border: #30363d;
  --accent: #238636;
  --accent-hover: #2ea043;
  --danger: #da3633;
  --success: #3fb950;
  --text: #c9d1d9;
  --muted: #8b949e;
  --link: #58a6ff;
  --warn: #d29922;
  --row-hover: #1c2128;
  --row-active: #1a2332;
}
:root.light {
  --bg: #f9fbfc;
  --surface: #ffffff;
  --surface2: #f6f8fa;
  --border: #d0d7de;
  --accent: #1a7f37;
  --accent-hover: #1f8f3f;
  --danger: #cf222e;
  --success: #1a7f37;
  --text: #1f2328;
  --muted: #424a53;
  --link: #0969da;
  --warn: #9a6700;
  --row-hover: #f6f8fa;
  --row-active: #ddf4ff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; display: flex; flex-direction: column; height: 100vh; }
header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px 24px; display: flex; align-items: center; gap: 12px; flex-shrink: 0; justify-content: space-between; }
header h1 { font-size: 18px; font-weight: 600; }
header span { color: var(--muted); font-size: 13px; }
.header-left { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 10px; }
.user-badge { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; background: var(--surface2); border: 1px solid var(--border); border-radius: 16px; font-size: 12px; color: var(--text); max-width: 240px; cursor: pointer; user-select: none; }
.user-badge:hover { border-color: var(--muted); }
.user-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 160px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18); padding: 4px; z-index: 100; display: none; cursor: default; }
.user-menu.open { display: block; }
.user-menu a, .user-menu button { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px; background: transparent; border: none; color: var(--text); text-decoration: none; font: inherit; font-size: 12px; cursor: pointer; }
.user-menu a:hover, .user-menu button:hover { background: var(--border); }
.user-badge .user-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--link); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.user-badge .user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.user-badge-anonymous { opacity: .65; }
.user-badge-anonymous .user-avatar { background: var(--muted); }
.jira-search { display: flex; align-items: center; gap: 0; }
.jira-search-box { position: relative; }
.jira-suggest { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.35); max-height: 320px; overflow-y: auto; z-index: 1000; min-width: 280px; }
.jira-suggest-item { padding: 7px 10px; cursor: pointer; font-size: 12px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: baseline; }
.jira-suggest-item:last-child { border-bottom: none; }
.jira-suggest-item:hover, .jira-suggest-item.active { background: var(--surface2); }
.jira-suggest-key { color: var(--link); font-weight: 600; font-family: ui-monospace, monospace; flex-shrink: 0; }
.jira-suggest-summary { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jira-suggest-source { font-size: 10px; color: var(--warn); padding: 1px 6px; border: 1px solid rgba(210,153,34,.4); border-radius: 8px; margin-left: auto; flex-shrink: 0; }
.jira-suggest-empty { padding: 7px 10px; color: var(--muted); font-size: 12px; font-style: italic; }
.jira-search input { background: var(--surface2); border: 1px solid var(--border); border-right: none; color: var(--text); padding: 5px 10px; border-radius: 6px 0 0 6px; font-size: 12px; width: 260px; outline: none; }
.jira-search input:focus { border-color: var(--link); }
.jira-search button { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 5px 12px; border-radius: 0 6px 6px 0; cursor: pointer; font-size: 12px; }
.jira-search button:hover { border-color: var(--link); color: var(--link); }
.jira-search button:disabled { opacity: .6; cursor: wait; }
.jira-spinner-left { width: 14px; height: 14px; border: 2px solid var(--muted); border-top-color: var(--link); border-radius: 50%; animation: jira-spin .7s linear infinite; flex-shrink: 0; visibility: hidden; margin-right: 8px; }
.jira-search.loading .jira-spinner-left { visibility: visible; }
.jira-search.loading input { border-color: var(--link); }
@keyframes jira-spin { to { transform: rotate(360deg); } }
@keyframes jira-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(88,166,255,.25); } 50% { box-shadow: 0 0 0 3px rgba(88,166,255,.25); } }
.jira-search-msg { font-size: 12px; color: var(--muted); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jira-search-msg.err { color: var(--danger); }
.jira-search-msg.ok { color: var(--accent); }
tr.pending-row td { opacity: .7; }
.pending-badge { display: inline-block; padding: 1px 7px; font-size: 11px; font-weight: 600; border-radius: 10px; background: rgba(210,153,34,.15); color: var(--warn); border: 1px solid rgba(210,153,34,.35); }
.btn-main-chat { background: transparent; border: 1px solid var(--border); color: var(--link); padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; }
.btn-main-chat:hover { border-color: var(--link); background: rgba(88,166,255,.08); }
.btn-theme { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1; }
.btn-theme:hover { border-color: var(--text); color: var(--text); }

.workspace { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.left-pane { width: 100%; flex: 1; overflow-y: auto; overflow-x: auto; padding: 24px 24px; }
.left-pane.hidden { display: none; }
.dashboard-loading { display: flex; align-items: center; gap: 10px; padding: 14px 18px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 13px; }
.dashboard-loading[hidden] { display: none; }
.dashboard-loading .spinner { width: 14px; height: 14px; }
.right-pane { display: none; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; position: relative; }
.right-pane.open { display: flex; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.toolbar h2 { font-size: 16px; font-weight: 600; }
.btn-refresh { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-refresh:hover { border-color: var(--link); color: var(--link); }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
th { background: var(--surface2); text-align: left; padding: 10px 14px; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
td { padding: 6px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; min-height: 52px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--row-hover); }
tr.active-review td { background: var(--row-active) !important; }
.mr-title a { color: var(--link); text-decoration: none; font-weight: 500; }
.jira-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; font-size: 11px; font-weight: 600; font-family: ui-monospace, monospace; color: #4a8ce6; background: rgba(74,140,230,.12); border: 1px solid rgba(74,140,230,.3); border-radius: 10px; text-decoration: none; margin-right: 6px; vertical-align: middle; letter-spacing: .2px; }
.jira-pill:hover { background: rgba(74,140,230,.22); border-color: rgba(74,140,230,.55); color: #6aa1f0; text-decoration: none; }
:root.light .jira-pill { color: #1e5bbf; background: rgba(30,91,191,.1); border-color: rgba(30,91,191,.3); }
:root.light .jira-pill:hover { color: #164a9e; background: rgba(30,91,191,.18); }

.mr-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; font-size: 11px; font-weight: 600; font-family: ui-monospace, monospace; color: #e8912d; background: rgba(232,145,45,.12); border: 1px solid rgba(232,145,45,.3); border-radius: 10px; text-decoration: none; margin-right: 6px; vertical-align: middle; letter-spacing: .2px; }
.mr-pill:hover { background: rgba(232,145,45,.22); border-color: rgba(232,145,45,.55); color: #f0a050; text-decoration: none; }
:root.light .mr-pill { color: #b46a18; background: rgba(180,106,24,.1); border-color: rgba(180,106,24,.3); }
:root.light .mr-pill:hover { color: #8b5012; background: rgba(180,106,24,.18); }
.cell-link { color: var(--link); text-decoration: none; }
.cell-link:hover { text-decoration: underline; }
.mr-title a:hover { text-decoration: underline; }
.branch { font-family: monospace; font-size: 12px; color: var(--muted); background: var(--surface2); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }
.author-inner { display: flex; align-items: center; gap: 8px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; }
.btn-review { background: var(--accent); border: none; color: #fff; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; }
.btn-review:hover { background: var(--accent-hover); }
.btn-review:disabled { background: var(--surface2); color: var(--muted); cursor: not-allowed; }
.btn-open { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; }
.btn-open:hover { border-color: var(--link); color: var(--link); }
.btn-open:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-rereview { background: transparent; border: none; color: var(--muted); padding: 2px 4px; border-radius: 4px; cursor: pointer; font-size: 11px; white-space: nowrap; }
.btn-rereview:hover { color: var(--text); text-decoration: underline; }
.btn-rereview:disabled { color: var(--muted); cursor: not-allowed; opacity: 0.5; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 8px; border-radius: 12px; white-space: nowrap; cursor: default; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.status-idle { color: var(--muted); }
.status-running { color: var(--warn); background: rgba(210,153,34,.12); }
.status-done { color: var(--success); background: rgba(63,185,80,.12); cursor: pointer !important; }
.status-done:hover { text-decoration: underline; }
.status-error { color: var(--danger); background: rgba(218,54,51,.12); }
.spinner { display: inline-block; width: 10px; height: 10px; border: 2px solid transparent; border-top-color: var(--warn); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.updated { color: var(--muted); font-size: 12px; }

.review-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; gap: 12px; }
.review-header-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.review-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-author { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.review-author .avatar { width: 20px; height: 20px; }
.review-datetime { font-size: 11px; color: var(--muted); white-space: nowrap; }
.review-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-back { background: transparent; border: 1px solid var(--border); color: var(--link); padding: 7px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; }
.btn-back:hover { background: rgba(88,166,255,.08); border-color: var(--link); }
.btn-close-panel { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 7px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-close-panel:hover { color: var(--text); border-color: var(--text); }
.btn-close-panel.btn-danger:hover { color: var(--danger); border-color: var(--danger); }
.btn-admin-delete { background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 7px; border-radius: 5px; opacity: .5; transition: opacity .12s, color .12s, border-color .12s; }
.btn-admin-delete:hover { opacity: 1; color: var(--danger, #f85149); border-color: var(--danger, #f85149); }
.btn-copy-link { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 7px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-copy-link:hover { color: var(--link); border-color: var(--link); }

.review-body { flex: 1; overflow-y: auto; padding: 32px; color: var(--text); }
.review-body-inner { max-width: 1200px; margin: 0 auto; }
.review-body h1,h2,h3 { color: var(--text); margin: 1.2em 0 .5em; font-weight: 600; }
.review-body h2 { font-size: 16px; border-left: 3px solid var(--accent); padding: 8px 14px; margin: 1.8em 0 .8em; background: var(--surface); border-radius: 6px; }
.review-body h3 { font-size: 14px; margin: 1.5em 0 .5em; }
.review-body p { line-height: 1.7; margin-bottom: .8em; }
.review-body ul, .review-body ol { padding-left: 20px; margin-bottom: .8em; }
.review-body li { margin-bottom: .3em; line-height: 1.6; }
.review-body code { font-family: ui-monospace, monospace; padding: 2px 6px; border-radius: 4px; font-size: 12.5px; background: var(--surface2); border: 1px solid var(--border); }
.review-body pre { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 16px; overflow-x: auto; margin-bottom: 1em; }
.review-body pre code { background: none; padding: 0; border: none; }
.review-body blockquote { border-left: 3px solid var(--border); padding-left: 14px; color: var(--muted); margin-bottom: .8em; }
.review-body strong { color: var(--text); font-weight: 600; }
.review-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }
.review-preamble { margin-bottom: 24px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.review-preamble h2 { margin: 0 !important; font-size: 16px; background: none; border: none; padding: 0; }
.review-preamble p { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.comment-block { position: relative; border: 1px solid var(--border); border-radius: 10px; padding: 20px 24px; margin-bottom: 24px; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: border-color .3s, box-shadow .3s, background-color .3s; }
:root.light .comment-block { box-shadow: 0 1px 3px rgba(27,31,36,.06); }
.comment-block:hover { border-color: var(--muted); }
.comment-block-header { margin: -20px -24px 16px; padding: 14px 24px; background: linear-gradient(to right, rgba(88,166,255,.1), transparent 70%); border-bottom: 1px solid var(--border); border-radius: 10px 10px 0 0; }
:root.light .comment-block-header { background: linear-gradient(to right, rgba(9,105,218,.07), transparent 70%); }
.comment-block-header h2 { margin: 0 !important; background: none !important; border: none !important; padding: 0 !important; }
.comment-block-header h3 { padding-right: 36px !important; font-size: 17px; font-weight: 700; margin: 0; padding: 0; background: none; border: none; border-radius: 0; color: var(--text); line-height: 1.4; }
.comment-block p { line-height: 1.7; }
.comment-block.issue-highlight { border-color: var(--warn); box-shadow: 0 0 0 2px rgba(210,153,34,.35); background: rgba(210,153,34,.06); }
.btn-copy-issue { position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, background-color .15s, border-color .15s; z-index: 1; }
.comment-block:hover .btn-copy-issue { opacity: 1; }
.btn-copy-issue:hover { color: var(--text); border-color: var(--text); }
.btn-copy-issue:focus-visible { opacity: 1; outline: none; color: var(--text); border-color: var(--link); }
.btn-copy-issue.copied { opacity: 1; color: var(--accent); border-color: var(--accent); }

.chat-body { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px 0 24px; }
.chat-turn { padding: 20px 28px; border-bottom: 1px solid var(--border); }
.chat-turn.role-user { background: var(--surface); }
.chat-turn.role-assistant { background: transparent; }
.chat-turn-head { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.chat-turn-head .chat-role-icon { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.chat-turn.role-user .chat-role-icon { background: rgba(88,166,255,.18); color: var(--link); }
.chat-turn.role-assistant .chat-role-icon { background: rgba(210,118,35,.18); color: #e8912d; }
.chat-turn-body { color: var(--text); line-height: 1.6; font-size: 14px; }
.chat-turn-body p { margin: 0 0 .7em; }
.chat-turn-body p:last-child { margin-bottom: 0; }
.chat-turn-body code { font-family: ui-monospace, monospace; font-size: 12.5px; padding: 1px 5px; border-radius: 3px; background: var(--surface2); }
.chat-turn-body pre { position: relative; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 12px; overflow-x: auto; margin: .7em 0; }
.chat-turn-body pre code { background: none; padding: 0; font-size: 12.5px; }
.code-dl-btn { position: absolute; top: 6px; right: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--link); padding: 3px 9px; border-radius: 4px; cursor: pointer; font-size: 11px; font-family: inherit; line-height: 1.4; opacity: 0; transition: opacity .12s; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-turn-body pre:hover .code-dl-btn, .code-dl-btn:focus { opacity: 1; }
.code-dl-btn:hover { border-color: var(--link); background: rgba(88,166,255,.10); }
.chat-turn-body ul, .chat-turn-body ol { padding-left: 22px; margin: .3em 0 .7em; }
.chat-turn-body li { margin-bottom: .25em; }
.chat-turn-body strong { color: var(--text); font-weight: 600; }
.chat-cursor { display: inline-block; width: 8px; height: 15px; background: var(--link); vertical-align: text-bottom; animation: chat-blink 1s steps(2, start) infinite; }
@keyframes chat-blink { to { visibility: hidden; } }

.chat-empty { padding: 60px 28px 20px; text-align: center; color: var(--muted); }
.chat-empty h3 { font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 6px; }
.chat-empty p { font-size: 13px; margin: 0 0 18px; max-width: 440px; margin-left: auto; margin-right: auto; line-height: 1.5; }
.chat-suggestions { padding: 0 28px 18px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chat-suggestions.hidden { display: none; }
.chat-chip { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 8px 14px; border-radius: 18px; cursor: pointer; font-size: 12.5px; transition: border-color .15s, color .15s, background-color .15s; }
.chat-chip:hover { border-color: var(--link); color: var(--link); background: rgba(88,166,255,.06); }

.chat-input-form { flex-shrink: 0; padding: 10px 28px 18px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-input-wrap { position: relative; display: flex; align-items: flex-end; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 8px 8px 8px 14px; transition: border-color .15s; }
.chat-input-wrap:focus-within { border-color: var(--link); }
.chat-input-wrap textarea { flex: 1; background: transparent; border: none; outline: none; resize: none; color: var(--text); font-family: inherit; font-size: 14px; line-height: 1.5; max-height: 220px; padding: 6px 0; }
.chat-input-wrap textarea::placeholder { color: var(--muted); }
.chat-send-btn { background: var(--accent); color: #fff; border: none; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .15s, opacity .15s; }
.chat-send-btn:hover { background: var(--accent-hover); }
.chat-send-btn:disabled { opacity: .45; cursor: not-allowed; }
.chat-stop-btn { background: var(--danger); color: #fff; border: none; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-stop-btn:hover { opacity: .85; }
.chat-input-hint { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px 0; font-size: 11px; color: var(--muted); }
.chat-input-hint kbd { background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; font-family: inherit; font-size: 10.5px; }
.chat-reset-link { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 2px 4px; }
.chat-reset-link:hover { color: var(--danger); }
.chat-attach-btn { background: transparent; border: none; color: var(--muted); width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; align-self: flex-end; }
.chat-attach-btn:hover { color: var(--link); background: rgba(88,166,255,.08); }
.chat-attach-btn:disabled { opacity: .45; cursor: not-allowed; }
.chat-attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 8px; }
.chat-attachments:empty { display: none; }
.chat-attach-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 4px 4px 4px 9px; border-radius: 14px; font-size: 12px; max-width: 100%; }
.chat-attach-chip.is-uploading { color: var(--muted); font-style: italic; }
.chat-attach-chip.is-error { border-color: var(--danger); color: var(--danger); }
.chat-attach-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.chat-attach-chip-size { color: var(--muted); font-size: 11px; }
.chat-attach-chip-x { background: transparent; border: none; color: var(--muted); cursor: pointer; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; padding: 0; }
.chat-attach-chip-x:hover { background: rgba(248,81,73,.18); color: var(--danger); }
.chat-input-wrap.drag-over { border-color: var(--link); background: rgba(88,166,255,.06); }

.btn-scroll-top { display: none; position: absolute; bottom: 20px; right: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 16px; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.btn-scroll-top:hover { color: var(--text); border-color: var(--text); }
.btn-scroll-top.visible { display: flex; }
tr.reviewing td { background: rgba(210,153,34,.06) !important; }

.pane-section-title { display: none; padding: 8px 32px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.pane-section-title.visible { display: block; }
.btn-analyze { background: transparent; border: 1px solid #388bfd; color: #388bfd; padding: 4px 9px; border-radius: 5px; cursor: pointer; font-size: 11px; font-weight: 600; white-space: nowrap; }
.btn-analyze:hover { background: rgba(56,139,253,.15); }
.btn-analyze:disabled { opacity: 0.4; cursor: not-allowed; }
.filter-toggle { display: flex; align-items: center; gap: 8px; padding: 8px 0 12px; }
.filter-toggle label { font-size: 12px; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.filter-toggle input[type=checkbox] { accent-color: var(--link); width: 14px; height: 14px; cursor: pointer; }
.pane-card { background: transparent; border: none; box-shadow: none; border-radius: 0; margin-bottom: 18px; overflow: visible; }
.pane-card-header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.pane-card-title { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: .2px; }
.pane-card-count { color: var(--muted); font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 9px; background: rgba(139,148,158,.15); }
.pane-card table { border: none; border-radius: 0; box-shadow: none; }
.pane-card table th { background: transparent; }
.pane-card table tr:last-child td { border-bottom: none; }
.combined-table {
  border-collapse: separate;
  border-spacing: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.combined-table .section-banner td {
  background: transparent;
  padding: 0;
  border: none;
}
.combined-table .section-banner-inner {
  background: var(--surface2);
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}
.combined-table .section-banner .pane-card-title { margin-right: 10px; }
.combined-table tbody tr:not(.section-banner) > td,
.combined-table tbody tr:not(.section-banner) > th {
  background: var(--surface);
}
.combined-table tbody tr.mr-row:hover > td,
.combined-table tbody tr.merged-row:hover > td {
  background: var(--row-hover);
}
.combined-table tbody tr:not(.section-banner) > td:first-child,
.combined-table tbody tr:not(.section-banner) > th:first-child {
  border-left: 1px solid var(--border);
}
.combined-table tbody tr:not(.section-banner) > td:last-child,
.combined-table tbody tr:not(.section-banner) > th:last-child {
  border-right: 1px solid var(--border);
}
.combined-table tbody tr:last-child > td,
.combined-table tbody tr:last-child > th { border-bottom: 1px solid var(--border); }
.combined-table tbody tr:last-child > td:first-child,
.combined-table tbody tr:last-child > th:first-child { border-bottom-left-radius: 6px; }
.combined-table tbody tr:last-child > td:last-child,
.combined-table tbody tr:last-child > th:last-child { border-bottom-right-radius: 6px; }
.combined-table tbody + tbody .section-banner td { padding-top: 20px; }
.combined-table td.blank-col, .combined-table th.blank-col { padding: 0; }
.merged-row, .mr-row { cursor: pointer; }
.merged-row:hover td, .mr-row:hover td { background: var(--surface2); }
tr.merged-row.active-review td { background: rgba(88,166,255,.08); }
.pane-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.tab-btn { background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--muted); padding: 9px 18px; cursor: pointer; font-size: 13px; font-weight: 500; transition: color .15s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--link); border-bottom-color: var(--link); }

.main-cov-bar { display: flex; align-items: stretch; gap: 10px; padding: 12px 0; flex-wrap: wrap; }
.main-cov-card { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 5px 14px; text-align: center; min-width: 76px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 1px 0 rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.12); }
:root.light .main-cov-card { box-shadow: 0 1px 0 rgba(27,31,36,.04), 0 1px 3px rgba(27,31,36,.06); }
.main-cov-card-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.main-cov-card-value { font-size: 16px; font-weight: 700; }
.main-cov-meta-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px 10px; min-width: unset; }
.main-cov-meta-row { display: flex; align-items: center; gap: 6px; }
.main-cov-date { font-size: 11px; color: var(--muted); }
.btn-rerun-icon { background: transparent; border: none; color: #a371f7; font-size: 16px; cursor: pointer; padding: 0 2px; line-height: 1; border-radius: 4px; }
.btn-rerun-icon:hover { color: #c084fc; }
.btn-rerun-icon:disabled { opacity: 0.4; cursor: not-allowed; }
.main-cov-packages { display: none; width: fit-content; min-width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; margin-bottom: 12px; }
.main-cov-packages.open { display: block; }
#main-cs-issues { max-height: none; overflow-y: visible; padding: 8px; }
.main-cov-pkg-row { display: flex; align-items: center; gap: 16px; padding: 4px 12px; border-bottom: 1px solid var(--border); font-size: 11px; }
.main-cov-pkg-row:last-child { border-bottom: none; }
.main-cov-pkg-name { font-family: monospace; color: var(--muted); white-space: nowrap; flex: 1; }
.main-cov-pkg-pct { font-weight: 600; flex-shrink: 0; min-width: 36px; text-align: right; }
.btn-expand { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 2px 4px; }
.btn-expand:hover { color: var(--text); }

.analysis-body, .sonar-body { flex: 1; overflow-y: auto; padding: 32px; }
.analysis-body > *, .sonar-body > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.branch-cov-bar { display: none; flex-direction: column; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--surface2); flex-shrink: 0; }
.branch-cov-bar.visible { display: flex; }
.branch-cov-cards-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.branch-cs-card { cursor: pointer; transition: border-color .15s; }
.branch-cs-card:hover { border-color: var(--link); }
.branch-cs-card.active { border-color: var(--link); background: rgba(88,166,255,.08); }
.branch-cs-card-compact { flex-direction: row; padding: 6px 10px; gap: 6px; align-items: center; }
.main-cov-card.clickable { cursor: pointer; transition: border-color .15s; }
.main-cov-card.clickable:hover { border-color: var(--link); }
.main-cov-card.clickable.open { border-color: var(--link); background: rgba(88,166,255,.08); }
.cov-inline-files-wrap { margin-top: 6px; display: none; }
.cov-inline-files-wrap.open { display: block; }

.cov-summary { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cov-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 16px; text-align: center; }
.cov-stat-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.cov-stat-value { font-size: 18px; font-weight: 700; }
.cov-high { color: var(--success); }
.cov-mid  { color: var(--warn); }
.cov-low  { color: var(--danger); }
.cov-none { color: var(--muted); }
.cov-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: 13px; }
.cov-table th { background: var(--surface2); text-align: left; padding: 8px 12px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--border); }
.cov-table td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cov-table tr:last-child td { border-bottom: none; }
.cov-table tr:hover td { background: var(--row-hover); }
.cov-bar-wrap { width: 80px; height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.cov-bar { height: 100%; border-radius: 4px; transition: width .3s; }
.cov-pct-text { font-size: 12px; font-variant-numeric: tabular-nums; }
.tool-section { margin-bottom: 28px; }
.tool-section h2 { font-size: 16px; font-weight: 700; color: var(--text); background: none; border: none; padding: 0; margin: 0 0 14px; }
.finding-card { border: 1px solid var(--border); border-radius: 10px; padding: 20px 24px; margin-bottom: 16px; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
:root.light .finding-card { box-shadow: 0 1px 3px rgba(27,31,36,.06); }
.finding-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: linear-gradient(to right, rgba(88,166,255,.1), transparent 70%); border-radius: 10px 10px 0 0; padding: 12px 24px; margin: -20px -24px 14px; border-bottom: 1px solid var(--border); }
:root.light .finding-header { background: linear-gradient(to right, rgba(9,105,218,.07), transparent 70%); }
.finding-msg { font-size: 14px; color: var(--text); line-height: 1.7; }
.finding-loc { font-size: 12px; color: var(--muted); font-family: ui-monospace, monospace; margin-top: 6px; }
.sev { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; text-transform: uppercase; letter-spacing: .4px; flex-shrink: 0; }
.sev-1, .sev-BLOCKER  { background: rgba(218,54,51,.2); color: #f85149; }
.sev-2, .sev-CRITICAL { background: rgba(210,90,34,.2); color: #f0883e; }
.sev-3, .sev-MAJOR    { background: rgba(210,153,34,.2); color: #d29922; }
.sev-4, .sev-MINOR    { background: rgba(56,139,253,.15); color: #58a6ff; }
.sev-5, .sev-INFO     { background: rgba(139,148,158,.15); color: #8b949e; }
.sev-error   { background: rgba(218,54,51,.2); color: #f85149; }
.sev-warning { background: rgba(210,153,34,.2); color: #d29922; }
.sev-info    { background: rgba(139,148,158,.15); color: #8b949e; }
.finding-rule { font-size: 12px; color: var(--text); font-family: ui-monospace, monospace; font-weight: 600; }
.gate-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 20px; margin-bottom: 16px; }
.gate-OK   { background: rgba(63,185,80,.15); color: #3fb950; }
.gate-ERROR { background: rgba(218,54,51,.15); color: #f85149; }
.gate-WARN  { background: rgba(210,153,34,.15); color: #d29922; }
.gate-UNKNOWN { background: rgba(139,148,158,.15); color: #8b949e; }
.no-findings { text-align: center; color: var(--muted); padding: 60px 0; font-size: 15px; }
.pipeline-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; margin-left: 6px; vertical-align: middle; text-decoration: none; white-space: nowrap; }
.pipeline-failed { background: rgba(218,54,51,.15); color: #f85149; }
.pipeline-failed:hover { background: rgba(218,54,51,.3); }
.pipeline-running { background: rgba(210,153,34,.15); color: #d29922; }
.git-busy-bar { display: none; background: rgba(210,153,34,.1); border-bottom: 1px solid rgba(210,153,34,.3); padding: 6px 24px; font-size: 12px; color: var(--warn); align-items: center; gap: 8px; flex-shrink: 0; }
.git-busy-bar.visible { display: flex; }
.git-busy-bar.error { background: rgba(218,54,51,.1); border-bottom-color: rgba(218,54,51,.3); color: var(--danger); }
.git-busy-bar.error .spinner { display: none; }

.login-overlay { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 24px; }
.login-overlay[hidden] { display: none; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 28px 32px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 32px rgba(0,0,0,.32); }
.login-card h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.login-card input { background: var(--surface2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 12px; font-size: 14px; outline: none; font-family: inherit; }
.login-card input:focus { border-color: var(--link); }
.login-card button { background: var(--accent); color: #fff; border: none; padding: 9px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.login-card button:hover { background: var(--accent-hover); }
.login-card button:disabled { opacity: .6; cursor: wait; }
.login-error { font-size: 12px; color: var(--danger); padding: 6px 10px; border: 1px solid rgba(218,54,51,.3); background: rgba(218,54,51,.08); border-radius: 6px; }
.login-error[hidden] { display: none; }
.login-hint { font-size: 11px; color: var(--muted); text-align: center; }
.login-hint code { font-family: ui-monospace, monospace; background: var(--surface2); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--border); }
