/* gitloox: the design system of the web interface (light and dark themes) */

:root {
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    --bg: #ffffff;
    --bg-subtle: #f6f7f9;
    --bg-muted: #eef0f3;
    --bg-hover: #f1f3f6;
    --bg-active: #e7eaf0;
    --surface: #ffffff;
    --border: #dde1e7;
    --border-strong: #c7cdd6;
    --text: #1f2328;
    --text-muted: #59636e;
    --text-subtle: #818b98;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-subtle: #eef0ff;
    --accent-text: #3f37c9;
    --brand: #ea580c;
    --header: #1e1b4b;
    --header-text: #e0e7ff;
    --header-muted: #a5b4fc;
    --header-hover: rgba(255, 255, 255, 0.08);

    --success: #1a7f37;
    --success-bg: #dafbe1;
    --danger: #cf222e;
    --danger-bg: #ffebe9;
    --warning: #9a6700;
    --warning-bg: #fff8c5;
    --orange: #c2620a;
    --info: #0969da;
    --info-bg: #ddf4ff;
    --neutral: #6e7781;
    --neutral-bg: #eaeef2;
    --purple: #8250df;
    --purple-bg: #fbefff;

    --diff-add-bg: #e6ffec;
    --diff-add-line: #ccffd8;
    --diff-del-bg: #ffebe9;
    --diff-del-line: #ffd7d5;
    --diff-hunk-bg: #ddf4ff;

    --log-bg: #0f1117;
    --log-text: #d6dbe4;

    --radius: 8px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(31, 35, 40, 0.06);
    --shadow: 0 1px 3px rgba(31, 35, 40, 0.08), 0 8px 24px rgba(31, 35, 40, 0.08);
    --shadow-lg: 0 16px 48px rgba(31, 35, 40, 0.18);
    --header-height: 52px;
    --sidebar-width: 244px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0d1117;
    --bg-subtle: #151b23;
    --bg-muted: #1c232d;
    --bg-hover: #1b222c;
    --bg-active: #242c38;
    --surface: #151b23;
    --border: #2b333e;
    --border-strong: #3d4653;
    --text: #e6edf3;
    --text-muted: #9ba6b2;
    --text-subtle: #737f8c;
    --accent: #7c74ff;
    --accent-hover: #918aff;
    --accent-subtle: #221f4a;
    --accent-text: #a8a2ff;
    --header: #0b0a24;
    --header-text: #e0e7ff;
    --header-muted: #a5b4fc;

    --success: #3fb950;
    --success-bg: #12261a;
    --danger: #f85149;
    --danger-bg: #2d1416;
    --warning: #d29922;
    --warning-bg: #2b2111;
    --orange: #f0883e;
    --info: #4493f8;
    --info-bg: #10233d;
    --neutral: #8b949e;
    --neutral-bg: #21262d;
    --purple: #ab7df8;
    --purple-bg: #251a3d;

    --diff-add-bg: #12261a;
    --diff-add-line: #1a3a26;
    --diff-del-bg: #2d1416;
    --diff-del-line: #4a1d21;
    --diff-hunk-bg: #10233d;

    --log-bg: #090b10;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

code, pre, kbd, .mono {
    font-family: var(--mono);
    font-size: 12.5px;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 22px;
}

h2 {
    font-size: 18px;
}

h3 {
    font-size: 15px;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

.boot {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    opacity: 0.6;
    animation: pulse 1.4s ease-in-out infinite;
}

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

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

/* ------------------------------------------------------------------------------------------------ layout */

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    background: var(--header);
    color: var(--header-text);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
}

.header a {
    color: var(--header-text);
}

.header .brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.2px;
    margin-right: 10px;
    text-decoration: none;
}

.header .brand img {
    width: 28px;
    height: 28px;
}

.header .nav-link {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--header-text);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.header .nav-link:hover, .header .nav-link.active {
    background: var(--header-hover);
    text-decoration: none;
}

.header .spacer {
    flex: 1;
}

.header .search {
    position: relative;
    width: 300px;
}

.header .search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--header-text);
    border-radius: var(--radius-sm);
    padding: 6px 10px 6px 30px;
    font-size: 13px;
}

.header .search input::placeholder {
    color: var(--header-muted);
}

.header .search input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--header-muted);
}

.header .search > .icon {
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    color: var(--header-muted);
    pointer-events: none;
}

.header .icon-button {
    background: none;
    border: 0;
    color: var(--header-text);
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
}

.header .icon-button:hover {
    background: var(--header-hover);
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    color: #fff;
    flex: none;
    user-select: none;
    text-transform: uppercase;
}

.avatar.square {
    border-radius: 8px;
}

.body {
    flex: 1;
    display: flex;
    min-height: 0;
}

.sidebar {
    width: var(--sidebar-width);
    flex: none;
    border-right: 1px solid var(--border);
    background: var(--bg-subtle);
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: 12px 8px 24px;
}

.sidebar .context {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.sidebar .context .name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar .context .sub {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar .section {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-subtle);
    padding: 14px 10px 4px;
}

.sidebar a.item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
    margin: 1px 0;
}

.sidebar a.item:hover {
    background: var(--bg-hover);
}

.sidebar a.item.active {
    background: var(--accent-subtle);
    color: var(--accent-text);
}

.sidebar a.item .icon {
    color: var(--text-muted);
    flex: none;
}

.sidebar a.item.active .icon {
    color: var(--accent-text);
}

.sidebar a.item.sub {
    padding-left: 36px;
    font-weight: 400;
    font-size: 13px;
}

.content {
    flex: 1;
    min-width: 0;
    padding: 20px 28px 48px;
}

.content.wide {
    padding: 0;
}

.page {
    max-width: 1280px;
    margin: 0 auto;
}

.page.narrow {
    max-width: 860px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.page-header .title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.page-header .subtitle {
    color: var(--text-muted);
    margin-top: 2px;
}

.page-header .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs .sep {
    color: var(--text-subtle);
}

.row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.row.wrap {
    flex-wrap: wrap;
}

.row.between {
    justify-content: space-between;
}

.grow {
    flex: 1;
    min-width: 0;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.muted {
    color: var(--text-muted);
}

.subtle {
    color: var(--text-subtle);
}

.small {
    font-size: 12px;
}

.nowrap {
    white-space: nowrap;
}

.ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.right {
    text-align: right;
}

.hidden {
    display: none !important;
}

/* ------------------------------------------------------------------------------------------------ controls */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 500;
    font-size: 13px;
    line-height: 20px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: background 0.12s, border-color 0.12s;
}

.btn:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

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

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn.primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn.danger {
    color: var(--danger);
}

.btn.danger.solid {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn.ghost {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.btn.ghost:hover {
    background: var(--bg-hover);
}

.btn.small {
    padding: 2px 8px;
    font-size: 12px;
}

.btn.icon-only {
    padding: 5px 7px;
}

.btn-group {
    display: inline-flex;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.btn-group .btn + .btn {
    margin-left: -1px;
}

input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="email"], input[type="date"],
input[type="url"], select, textarea {
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    width: 100%;
    line-height: 20px;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

input.mono, textarea.mono {
    font-family: var(--mono);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.field > label:not(.checkbox), .label {
    font-weight: 600;
    font-size: 13px;
}

.field .hint {
    font-size: 12px;
    color: var(--text-muted);
}

.field.inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 10px;
}

.checkbox input {
    margin-top: 3px;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group > .prefix {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: var(--bg-muted);
    border: 1px solid var(--border-strong);
    border-right: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

.input-group > .prefix + input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-group > input + .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-left: -1px;
}

.input-group > input:has(+ .btn) {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.segmented {
    display: inline-flex;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}

.segmented button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 5px;
    cursor: pointer;
}

.segmented button.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------------------------------------------ surfaces */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card > .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
    border-radius: var(--radius) var(--radius) 0 0;
    min-height: 46px;
}

.card > .card-body {
    padding: 16px;
}

.card > .card-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
    border-radius: 0 0 var(--radius) var(--radius);
}

.card.flat {
    box-shadow: none;
}

.stat {
    padding: 14px 16px;
}

.stat .value {
    font-size: 24px;
    font-weight: 700;
}

.stat .name {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list > li, .list > .li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.list > li:last-child, .list > .li:last-child {
    border-bottom: 0;
}

.list > li.clickable:hover {
    background: var(--bg-hover);
    cursor: pointer;
}

table.table {
    width: 100%;
    border-collapse: collapse;
}

table.table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
    white-space: nowrap;
}

table.table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

table.table tr:last-child td {
    border-bottom: 0;
}

table.table tr.clickable:hover td {
    background: var(--bg-hover);
    cursor: pointer;
}

.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty .icon {
    color: var(--text-subtle);
    margin-bottom: 10px;
}

.empty h3 {
    color: var(--text);
    margin-bottom: 6px;
}

.alert {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid;
    margin-bottom: 14px;
    align-items: flex-start;
}

.alert.danger {
    background: var(--danger-bg);
    border-color: color-mix(in srgb, var(--danger) 35%, transparent);
    color: var(--text);
}

.alert.warning {
    background: var(--warning-bg);
    border-color: color-mix(in srgb, var(--warning) 35%, transparent);
}

.alert.info {
    background: var(--info-bg);
    border-color: color-mix(in srgb, var(--info) 35%, transparent);
}

.alert.success {
    background: var(--success-bg);
    border-color: color-mix(in srgb, var(--success) 35%, transparent);
}

.alert ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
}

.tabs a, .tabs button {
    padding: 8px 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-muted);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: -1px;
    text-decoration: none;
}

.tabs a:hover, .tabs button:hover {
    color: var(--text);
    text-decoration: none;
}

.tabs a.active, .tabs button.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 0 6px;
    height: 18px;
    border-radius: 9px;
    background: var(--bg-muted);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--neutral-bg);
    color: var(--neutral);
    white-space: nowrap;
    line-height: 18px;
}

.badge.success {
    background: var(--success-bg);
    color: var(--success);
}

.badge.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge.info {
    background: var(--info-bg);
    color: var(--info);
}

.badge.purple {
    background: var(--purple-bg);
    color: var(--purple);
}

.badge.accent {
    background: var(--accent-subtle);
    color: var(--accent-text);
}

.badge.outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
}

.ref-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--mono);
    font-size: 12px;
    background: var(--bg-muted);
    color: var(--text);
    padding: 1px 7px;
    border-radius: 5px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.sha {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent-text);
}

/* status of pipelines and jobs */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 12px;
    padding: 2px 9px 2px 6px;
    border-radius: 999px;
    border: 1px solid;
    white-space: nowrap;
    line-height: 18px;
    text-transform: capitalize;
}

.status.success {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 45%, transparent);
    background: var(--success-bg);
}

.status.failed {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 45%, transparent);
    background: var(--danger-bg);
}

.status.running, .status.canceling {
    color: var(--info);
    border-color: color-mix(in srgb, var(--info) 45%, transparent);
    background: var(--info-bg);
}

.status.pending, .status.scheduled, .status.created, .status.waiting {
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning) 45%, transparent);
    background: var(--warning-bg);
}

.status.manual {
    color: var(--purple);
    border-color: color-mix(in srgb, var(--purple) 45%, transparent);
    background: var(--purple-bg);
}

.status.canceled, .status.skipped {
    color: var(--neutral);
    border-color: var(--border-strong);
    background: var(--neutral-bg);
}

.status.warning {
    color: var(--orange);
    border-color: color-mix(in srgb, var(--orange) 45%, transparent);
    background: var(--warning-bg);
}

.status-icon {
    display: inline-flex;
    flex: none;
}

.status-icon.success {
    color: var(--success);
}

.status-icon.failed {
    color: var(--danger);
}

.status-icon.running, .status-icon.canceling {
    color: var(--info);
}

.status-icon.pending, .status-icon.scheduled, .status-icon.created {
    color: var(--warning);
}

.status-icon.manual {
    color: var(--purple);
}

.status-icon.warning {
    color: var(--orange);
}

.status-icon.canceled, .status-icon.skipped {
    color: var(--neutral);
}

.spinner {
    animation: spin 1s linear infinite;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-muted);
}

/* ------------------------------------------------------------------------------------------------ overlays */

.dropdown {
    position: relative;
    display: inline-flex;
}

.menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 100;
    color: var(--text);
}

.menu.left {
    right: auto;
    left: 0;
}

.menu .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    background: none;
    border: 0;
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}

.menu .menu-item:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

.menu .menu-header {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    margin: -6px -6px 6px;
}

.menu .menu-sep {
    border-top: 1px solid var(--border);
    margin: 6px -6px;
}

.menu .menu-item.danger {
    color: var(--danger);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(13, 17, 23, 0.55);
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 9vh 16px 16px;
    animation: fade 0.12s ease-out;
}

@keyframes fade {
    from {
        opacity: 0;
    }
}

.modal {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.modal.wide {
    max-width: 820px;
}

.modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.modal .modal-body {
    padding: 18px;
    overflow-y: auto;
}

.modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
    border-radius: 0 0 12px 12px;
}

.toasts {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 280px;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--info);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 10px 14px;
    animation: slide 0.18s ease-out;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

@keyframes slide {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
}

.secret-box {
    font-family: var(--mono);
    background: var(--bg-muted);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    word-break: break-all;
}

/* ------------------------------------------------------------------------------------------------ repository */

.file-table td.name {
    width: 40%;
}

.file-table td.name a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.file-table td.name .icon {
    color: var(--text-muted);
}

.file-table td.name .icon.folder {
    color: #54aeff;
}

.file-table td.commit a {
    color: var(--text-muted);
}

.file-table td.date {
    width: 140px;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

.commit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.commit-row:last-child {
    border-bottom: 0;
}

.commit-row .title {
    font-weight: 600;
    color: var(--text);
}

.commit-day {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 14px 0 6px;
}

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

.code-view > .code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
    flex-wrap: wrap;
}

.editor-host {
    width: 100%;
    min-height: 200px;
}

.markdown {
    line-height: 1.65;
    word-wrap: break-word;
}

.markdown h1, .markdown h2 {
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
    margin: 20px 0 12px;
}

.markdown h1:first-child, .markdown h2:first-child {
    margin-top: 0;
}

.markdown h3, .markdown h4 {
    margin: 18px 0 8px;
}

.markdown p, .markdown ul, .markdown ol, .markdown table, .markdown pre, .markdown blockquote {
    margin: 0 0 12px;
}

.markdown code {
    background: var(--bg-muted);
    padding: 1px 5px;
    border-radius: 4px;
}

.markdown pre {
    background: var(--bg-muted);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.markdown pre code {
    background: none;
    padding: 0;
}

.markdown blockquote {
    border-left: 4px solid var(--border-strong);
    padding-left: 12px;
    color: var(--text-muted);
}

.markdown table {
    border-collapse: collapse;
}

.markdown th, .markdown td {
    border: 1px solid var(--border);
    padding: 6px 10px;
}

.markdown img {
    max-width: 100%;
}

/* differences */
.diff-file {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
    background: var(--surface);
    overflow: hidden;
}

.diff-file > .diff-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: var(--header-height);
    z-index: 5;
}

.diff-file > .diff-header .path {
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 600;
}

table.diff {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 20px;
    table-layout: fixed;
}

table.diff td {
    padding: 0 8px;
    white-space: pre-wrap;
    word-break: break-all;
    vertical-align: top;
}

table.diff td.num {
    width: 52px;
    color: var(--text-subtle);
    text-align: right;
    user-select: none;
    padding: 0 8px;
    background: var(--bg-subtle);
}

table.diff td.sign {
    width: 18px;
    user-select: none;
    padding: 0 0 0 6px;
}

table.diff tr.add td {
    background: var(--diff-add-bg);
}

table.diff tr.add td.num {
    background: var(--diff-add-line);
}

table.diff tr.del td {
    background: var(--diff-del-bg);
}

table.diff tr.del td.num {
    background: var(--diff-del-line);
}

table.diff tr.hunk td {
    background: var(--diff-hunk-bg);
    color: var(--text-muted);
}

.diff-stat {
    font-family: var(--mono);
    font-size: 12px;
}

.diff-stat .add {
    color: var(--success);
}

.diff-stat .del {
    color: var(--danger);
}

/* ------------------------------------------------------------------------------------------------ CI */

.pipeline-graph {
    display: flex;
    gap: 36px;
    overflow-x: auto;
    padding: 16px 4px 22px;
    position: relative;
}

.pipeline-graph .stage {
    min-width: 230px;
    position: relative;
}

.pipeline-graph .stage-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: capitalize;
}

.pipeline-graph .stage + .stage::before {
    content: "";
    position: absolute;
    left: -36px;
    top: 50px;
    width: 36px;
    border-top: 2px solid var(--border-strong);
}

.job-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    margin-bottom: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
}

.job-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover);
    text-decoration: none;
}

.job-card .name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-card .action {
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    flex: none;
}

.job-card .action:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.mini-pipeline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.mini-pipeline .connector {
    width: 6px;
    border-top: 2px solid var(--border-strong);
}

/* job log */
.log-panel {
    background: var(--log-bg);
    color: var(--log-text);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #1f2430;
}

.log-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: #161b24;
    color: #aab3c0;
    font-size: 12px;
    border-bottom: 1px solid #222a36;
}

.log-toolbar .btn {
    background: #1d2430;
    border-color: #2d3644;
    color: #d6dbe4;
    box-shadow: none;
}

.log-toolbar .btn:hover {
    background: #252e3c;
}

.log {
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.55;
    padding: 10px 0;
    overflow-x: auto;
    max-height: calc(100vh - 230px);
    min-height: 240px;
    overflow-y: auto;
}

.log .line {
    display: flex;
    padding: 0 16px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.log .line:hover {
    background: rgba(255, 255, 255, 0.04);
}

.log .line .ln {
    flex: none;
    width: 56px;
    text-align: right;
    padding-right: 14px;
    color: #5c6676;
    user-select: none;
}

.log .line .text {
    flex: 1;
    min-width: 0;
}

.log.nowrap .line {
    white-space: pre;
    word-break: normal;
}

.log.nowrap .line .text {
    min-width: auto;
}

.log .line .ts {
    flex: none;
    padding-right: 12px;
    color: #6b7686;
    user-select: none;
    font-variant-numeric: tabular-nums;
}

.log.hide-ts .line .ts {
    display: none;
}

.log-toolbar .btn.off {
    color: #6b7686;
}

.log .section-head {
    cursor: pointer;
}

.log .section-head .chevron {
    display: inline-block;
    width: 14px;
    color: #7d8796;
    transition: transform 0.1s;
}

.log .section-head.collapsed .chevron {
    transform: rotate(-90deg);
}

.log .duration {
    float: right;
    color: #7d8796;
    margin-left: 12px;
}

.log .cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: #8892a0;
    animation: blink 1s steps(1) infinite;
    vertical-align: text-bottom;
    margin-left: 16px;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.ansi-bold {
    font-weight: 700;
}

.ansi-italic {
    font-style: italic;
}

.ansi-underline {
    text-decoration: underline;
}

.sidebar-info dl {
    margin: 0;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px 12px;
    font-size: 13px;
}

.sidebar-info dt {
    color: var(--text-muted);
}

.sidebar-info dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------------------------------------ web IDE */

.ide {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 320px;
    height: calc(100vh - var(--header-height));
}

.ide .panel {
    border-right: 1px solid var(--border);
    background: var(--bg-subtle);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ide .panel:last-child {
    border-right: 0;
    border-left: 1px solid var(--border);
}

.ide .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.ide .panel-body {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.ide .editor-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.ide .tabs-bar {
    display: flex;
    overflow-x: auto;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    min-height: 37px;
}

.ide .tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px 7px 12px;
    border-right: 1px solid var(--border);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    background: var(--bg-subtle);
}

.ide .tab.active {
    background: var(--bg);
    color: var(--text);
    box-shadow: inset 0 2px 0 var(--accent);
}

.ide .tab .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
}

.ide .tab .close {
    border: 0;
    background: none;
    color: inherit;
    padding: 0 2px;
    cursor: pointer;
    opacity: 0.6;
    display: inline-flex;
}

.ide .tab .close:hover {
    opacity: 1;
}

.ide .editor-host {
    flex: 1;
    min-height: 0;
}

.tree {
    font-size: 13px;
    padding: 4px 0;
    user-select: none;
}

.tree .node {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text);
}

.tree .node:hover {
    background: var(--bg-hover);
}

.tree .node.selected {
    background: var(--accent-subtle);
    color: var(--accent-text);
}

.tree .node .icon {
    color: var(--text-muted);
    flex: none;
}

.tree .node .icon.folder {
    color: #54aeff;
}

.tree .node.changed .label {
    color: var(--brand);
}

.tree .node.added .label {
    color: var(--success);
}

.tree .node .actions {
    margin-left: auto;
    display: none;
    gap: 2px;
}

.tree .node:hover .actions {
    display: inline-flex;
}

.tree .node .actions button {
    border: 0;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 1px 3px;
    border-radius: 4px;
    display: inline-flex;
}

.tree .node .actions button:hover {
    color: var(--text);
    background: var(--bg-active);
}

.change {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
}

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

.change .kind {
    font-family: var(--mono);
    font-weight: 700;
    width: 14px;
    text-align: center;
}

.change .kind.A {
    color: var(--success);
}

.change .kind.M {
    color: var(--brand);
}

.change .kind.D {
    color: var(--danger);
}

.change .kind.R {
    color: var(--info);
}

.kbd {
    font-family: var(--mono);
    font-size: 11px;
    padding: 1px 5px;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.palette {
    position: fixed;
    top: 12vh;
    left: 50%;
    transform: translateX(-50%);
    width: 560px;
    max-width: calc(100vw - 32px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 250;
    overflow: hidden;
}

.palette input {
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 12px 14px;
    font-size: 14px;
}

.palette input:focus {
    box-shadow: none;
}

.palette .results {
    max-height: 360px;
    overflow-y: auto;
}

.palette .result {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
}

.palette .result.selected, .palette .result:hover {
    background: var(--accent-subtle);
}

.palette .result .dir {
    color: var(--text-muted);
    font-size: 12px;
}

/* ------------------------------------------------------------------------------------------------ misc */

.project-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.project-row:last-child {
    border-bottom: 0;
}

.project-row .name {
    font-weight: 600;
    font-size: 14.5px;
    color: var(--text);
}

.project-row .description {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

.hero {
    padding: 40px 32px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #7c2d12 130%);
    color: #eef2ff;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 26px;
    margin-bottom: 6px;
}

.hero p {
    color: #c7d2fe;
    margin: 0 0 18px;
    max-width: 640px;
}

.clone-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

.clone-box input {
    font-family: var(--mono);
    font-size: 12px;
}

.steps {
    counter-reset: step;
    padding-left: 0;
    list-style: none;
}

.steps li {
    position: relative;
    padding-left: 34px;
    margin-bottom: 16px;
}

.steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: var(--accent-text);
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

pre.snippet {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    overflow-x: auto;
    margin: 6px 0 0;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.tooltip {
    position: relative;
}

.split {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.settings-section {
    padding: 22px 0;
    border-bottom: 1px solid var(--border);
}

.settings-section:first-child {
    padding-top: 0;
}

.settings-section:last-child {
    border-bottom: 0;
}

.settings-section h3 {
    margin-bottom: 4px;
}

.settings-section > .split > div:first-child p {
    color: var(--text-muted);
    font-size: 13px;
    margin: 4px 0 0;
}

.danger-zone {
    border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
    border-radius: var(--radius);
}

.danger-zone .li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.danger-zone .li:last-child {
    border-bottom: 0;
}

@media (max-width: 1100px) {
    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .ide {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .ide .panel:last-child {
        display: none;
    }
}

@media (max-width: 820px) {
    .sidebar {
        display: none;
    }

    .header .search {
        display: none;
    }

    .content {
        padding: 16px;
    }

    .split {
        grid-template-columns: minmax(0, 1fr);
    }

    .ide {
        grid-template-columns: minmax(0, 1fr);
    }

    .ide .panel {
        display: none;
    }
}
