:root {
  --gl-purple: #171321; --gl-purple-2: #2f2a3d; --gl-orange: #fc6d26; --gl-orange-dark: #e24329;
  --fg: #3a383f; --fg-2: #626168; --fg-3: #89888d; --line: #dcdcde; --bg: #fff; --bg-2: #fbfafd; --bg-3: #f0f0f0;
  --green: #108548; --green-soft: #ecf4ee; --red: #dd2b0e; --link: #1f75cb;
}
body { font-family: "GitLab Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; color: var(--fg); background: var(--bg); }
.top { height: 48px; background: var(--gl-purple); color: #fff; display: flex; align-items: center; gap: 16px; padding: 0 16px; position: sticky; top: 0; z-index: 20; }
.logo { display: flex; align-items: center; }
.search { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 4px; padding: 0 10px; height: 32px; width: 320px; }
.search input { background: transparent; border: 0; color: #fff; outline: none; width: 100%; }
.search input::placeholder { color: rgba(255,255,255,0.6); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.top-ico { font-size: 13px; opacity: 0.9; }
.top-ico b { background: var(--gl-orange); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 2px; }
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 48px); }
.sidenav { background: var(--bg-2); border-right: 1px solid var(--line); padding: 12px 8px; }
.proj { display: flex; align-items: center; gap: 10px; padding: 8px 10px 14px; }
.proj-avatar { width: 32px; height: 32px; border-radius: 4px; background: var(--gl-orange); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.proj b { display: block; font-size: 14px; }
.proj small { color: var(--fg-3); }
.sidenav nav { display: flex; flex-direction: column; gap: 2px; }
.sidenav nav a { padding: 8px 12px; border-radius: 4px; text-decoration: none; color: var(--fg); font-weight: 500; display: flex; justify-content: space-between; }
.sidenav nav a:hover { background: var(--bg-3); }
.sidenav nav a.active { background: #e9e5ee; box-shadow: inset 3px 0 0 var(--gl-purple-2); }
.cnt { background: var(--bg-3); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--fg-2); }
.main { padding: 12px 24px 48px; min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--fg-2); font-size: 13.5px; margin-bottom: 14px; }
.crumbs a { text-decoration: none; color: var(--fg-2); }
.crumbs a:hover { text-decoration: underline; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.92em; }
.branch { background: var(--bg-3); padding: 1px 6px; border-radius: 4px; color: var(--link); }
.grow { flex: 1; }

/* List */
.list-tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.list-tabs button { background: transparent; border: 0; padding: 10px 14px; color: var(--fg-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.list-tabs button.active { color: var(--fg); border-bottom-color: var(--gl-purple-2); }
.list-tabs button b { background: var(--bg-3); border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.btn-confirm { background: var(--green); color: #fff; border: 0; border-radius: 4px; padding: 7px 14px; font-weight: 600; }
.btn-confirm:hover { background: #0d6b3b; }
.mr-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 4px 4px; }
.mr-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mr-row:last-child { border-bottom: 0; }
.mr-empty { padding: 40px 16px; text-align: center; }
.mr-main { flex: 1; min-width: 0; }
.mr-title { font-weight: 600; color: var(--fg); text-decoration: none; }
.mr-title:hover { color: var(--link); text-decoration: underline; }
.mr-sub { font-size: 12.5px; color: var(--fg-2); margin-top: 4px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mr-side { display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.state-badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.state-badge.open { background: #e9f3fc; color: #0b5cad; }
.state-badge.merged { background: #f4f0ff; color: #5943b6; }
.pipe { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-2); }
.pipe i, .job i, .pipe-status i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; position: relative; border: 1.5px solid currentColor; }
.p-passed { color: var(--green); }
.p-passed::after, i.p-passed::after { content: ""; position: absolute; left: 4px; top: 1px; width: 3px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.p-failed { color: var(--red); }
i.p-failed::after { content: "×"; position: absolute; left: 2.5px; top: -3px; font-size: 12px; font-weight: 700; }
.p-pending { color: #ab6100; }
i.p-pending { border-style: dashed; }
.task-link { font-size: 12px; text-decoration: none; color: var(--link); background: #e9f3fc; padding: 2px 8px; border-radius: 4px; }

/* MR page */
.merged-banner { background: var(--green-soft); border: 1px solid #c3e6cb; color: #0d532f; padding: 12px 16px; border-radius: 4px; margin-bottom: 14px; }
.merged-banner code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 3px; }
.mr-head { display: flex; align-items: center; gap: 12px; }
.mr-head h1 { font-size: 22px; margin: 0; font-weight: 600; }
.mr-byline { display: flex; align-items: center; gap: 6px; color: var(--fg-2); margin: 8px 0 16px; flex-wrap: wrap; }
.mr-tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.mr-tabs button { background: transparent; border: 0; padding: 10px 14px; color: var(--fg-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mr-tabs button.active { color: var(--fg); border-bottom-color: var(--gl-purple-2); }
.mr-tabs button b { background: var(--bg-3); border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.btn-preview { text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; color: var(--fg); font-weight: 600; margin-bottom: 6px; }
.btn-preview:hover { background: var(--bg-3); }
.widget { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 4px; padding: 12px 16px; margin-bottom: 12px; background: #fff; }
.widget-text { flex: 1; line-height: 1.5; }
.pipe-status { display: inline-flex; margin-top: 3px; }
.pipe-status i { width: 22px; height: 22px; border-width: 2px; }
.pipe-status.p-passed i::after { left: 7px; top: 3px; width: 5px; height: 10px; border-width: 0 2px 2px 0; }
.pipe-status.p-failed i::after { left: 5px; top: -2px; font-size: 18px; }
.jobs { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; }
.job { display: inline-flex; align-items: center; gap: 5px; color: var(--fg-2); }
.merge-widget { background: var(--bg-2); }
.merge-widget.merged { background: var(--green-soft); }
.merge-row { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.chk { font-size: 13px; color: var(--fg-2); display: inline-flex; align-items: center; gap: 5px; }
h3 { font-size: 15px; margin: 22px 0 8px; }
.desc { line-height: 1.55; }
.desc a { color: var(--link); }
.desc ul { padding-left: 4px; list-style: none; margin: 8px 0; }
.commits { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 4px; }
.commit { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.commit:last-child { border-bottom: 0; }
.commit-text { flex: 1; min-width: 0; }
.commit-text .muted { font-size: 12.5px; }
.sha { color: var(--link); background: var(--bg-3); padding: 2px 6px; border-radius: 4px; }
.commits > li.muted { padding: 12px 14px; }
.changes-meta { font-size: 13px; color: var(--fg-2); margin-bottom: 10px; }
.diff { font-size: 12.5px; }

/* Deploy step */
.deployed-line { color: var(--green); font-weight: 600; margin-top: 8px; }
.deployed-line a { color: var(--link); font-weight: 400; word-break: break-all; }
.deploy-page .deploy-head { margin-bottom: 6px; }
.deploy-page h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.deploy-page .deploy-head p { margin: 4px 0; }
.env-badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); }
.role-hint { display: inline-block; background: #fdf1dd; color: #8f4700; padding: 6px 10px; border-radius: 4px; }
.deploy-page .mr-list { border-top: 1px solid var(--line); border-radius: 4px; margin-bottom: 8px; }
.deploy-url { color: var(--link); text-decoration: none; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deploy-url:hover { text-decoration: underline; }
