/* ============================================================
   Lugit design system — dark, modern, single source of truth
   for dashboard, repo, PR and blob pages.
   ============================================================ */

:root {
    --bg: #0a0c12;
    --bg-soft: #0e111a;
    --panel: #131722;
    --panel-2: #181d2b;
    --panel-3: #1e2434;
    --border: #232a3b;
    --border-strong: #303950;
    --text: #e7ebf4;
    --muted: #8b94a8;
    --faint: #59617a;
    --accent: #6d8cff;
    --accent-2: #22d3ee;
    --green: #34d399;
    --amber: #fbbf24;
    --red: #f87171;
    --grad: linear-gradient(135deg, #6d8cff 0%, #22d3ee 100%);
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 40px rgba(0, 0, 0, .45);
    --shadow-soft: 0 2px 12px rgba(0, 0, 0, .3);
    --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --mono: 'SF Mono', 'JetBrains Mono', Monaco, Consolas, 'Liberation Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background:
        radial-gradient(900px 500px at 12% -8%, rgba(109, 140, 255, .13), transparent 60%),
        radial-gradient(800px 480px at 92% -12%, rgba(34, 211, 238, .10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-2); }

::selection { background: rgba(109, 140, 255, .35); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3c4763; }

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 36px 22px 80px;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }

/* ---------------- brand / headers ---------------- */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand .logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--grad);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(109, 140, 255, .35);
    flex: none;
}
.brand .logo-mark svg { width: 20px; height: 20px; stroke: #fff; }
.brand h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
}
.brand .tagline {
    font-size: .78rem;
    color: var(--faint);
    margin-top: -2px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.user-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.topbar .crumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--text);
    flex-wrap: wrap;
}
.topbar .crumbs .sep { color: var(--faint); font-weight: 400; }

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
    margin-bottom: 4px;
}
.page-sub { color: var(--muted); font-size: .92rem; }

/* ---------------- buttons ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform .15s, box-shadow .15s, background .15s, border-color .15s, color .15s;
    user-select: none;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 4px 16px rgba(109, 140, 255, .30);
}
.btn-primary:hover {
    box-shadow: 0 6px 22px rgba(109, 140, 255, .45);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: var(--panel-2);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--panel-3); border-color: var(--border-strong); }

.btn-danger {
    background: rgba(248, 113, 113, .12);
    color: var(--red);
    border-color: rgba(248, 113, 113, .25);
}
.btn-danger:hover { background: rgba(248, 113, 113, .2); }

.btn-ghost {
    background: transparent;
    color: var(--muted);
}
.btn-ghost:hover { color: var(--text); background: var(--panel-2); }

.btn-small { padding: 5px 12px; font-size: .78rem; border-radius: 7px; }
.btn-block { width: 100%; }

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

/* ---------------- login ---------------- */

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 390px;
    background: linear-gradient(180deg, rgba(24, 29, 43, .9), rgba(19, 23, 34, .9));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 34px 30px 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    animation: rise .4s cubic-bezier(.2, .7, .3, 1);
}
.login-card .brand { justify-content: center; margin-bottom: 6px; }
.login-card .brand .logo-mark { width: 46px; height: 46px; border-radius: 13px; }
.login-card .brand .logo-mark svg { width: 24px; height: 24px; }
.login-card .brand h1 { font-size: 1.5rem; }
.login-sub {
    text-align: center;
    color: var(--faint);
    font-size: .85rem;
    margin-bottom: 26px;
}

/* ---------------- forms ---------------- */

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .01em;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    color: var(--text);
    font-size: .92rem;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-group input::placeholder { color: var(--faint); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(109, 140, 255, .18);
    background: var(--bg);
}
.form-group select { cursor: pointer; }
.form-group textarea,
.edit-form textarea {
    min-height: 120px;
    resize: vertical;
    font-family: var(--mono);
    font-size: .84rem;
    line-height: 1.55;
}
.edit-form textarea {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.edit-form textarea::placeholder { color: var(--faint); }
.edit-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(109, 140, 255, .18);
    background: var(--bg);
}
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.form-actions .btn { flex: 1; }
.form-hint { font-size: .78rem; color: var(--faint); margin-top: 8px; }

/* ---------------- tabs ---------------- */

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.tab {
    padding: 9px 16px 11px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-size: .88rem;
    font-weight: 600;
    font-family: inherit;
    transition: color .15s, border-color .15s, background .15s;
    margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.section { display: none; }
.section.active { display: block; animation: fade .25s ease; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.section-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

/* ---------------- cards & lists ---------------- */

.card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.repo-list { display: flex; flex-direction: column; gap: 12px; }

.repo-item {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: transform .18s, border-color .18s, box-shadow .18s;
    animation: rise .3s cubic-bezier(.2, .7, .3, 1) backwards;
}
.repo-item:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}
.repo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}
.repo-name {
    font-size: 1.02rem;
    font-weight: 650;
    color: var(--accent);
    letter-spacing: -.01em;
}
.repo-name:hover { color: var(--accent-2); }
.repo-meta {
    display: flex;
    gap: 16px;
    color: var(--muted);
    font-size: .82rem;
    flex-wrap: wrap;
}
.repo-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------------- badges ---------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    flex: none;
}
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.badge-public, .badge-ready { background: rgba(52, 211, 153, .13); color: var(--green); }
.badge-private { background: rgba(248, 113, 113, .13); color: var(--red); }
.badge-pending { background: rgba(251, 191, 36, .13); color: var(--amber); }

/* ---------------- code / diffs / markdown ---------------- */

code {
    font-family: var(--mono);
    background: var(--panel-3);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: .86em;
}
pre {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    overflow-x: auto;
    margin: 10px 0;
    font-size: .86rem;
    line-height: 1.55;
}
pre code { background: none; padding: 0; font-size: 1em; }

.diff {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-family: var(--mono);
    font-size: .82rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 540px;
    overflow-y: auto;
}

/* ============================================================
   Markdown body — README, PR descriptions, blob previews
   ============================================================ */

.markdown-body {
    color: var(--text);
    font-size: 16px;
    line-height: 1.65;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    overflow-x: hidden;
    /* сброс того, что убил глобальный * { margin: 0 } */
    text-rendering: optimizeLegibility;
}

/* ---------- единый вертикальный ритм ---------- */
.markdown-body > * { margin-top: 0; margin-bottom: 16px; }
.markdown-body > *:last-child { margin-bottom: 0; }

/* ---------- заголовки ---------- */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    color: var(--text);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.015em;
    margin-top: 28px;
    margin-bottom: 16px;
    scroll-margin-top: 80px;
}
.markdown-body > h1:first-child,
.markdown-body > h2:first-child,
.markdown-body > h3:first-child { margin-top: 0; }

.markdown-body h1 { font-size: 1.75rem; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.markdown-body h2 { font-size: 1.4rem;  padding-bottom: 8px;  border-bottom: 1px solid var(--border); }
.markdown-body h3 { font-size: 1.15rem; }
.markdown-body h4 { font-size: 1rem; }
.markdown-body h5 { font-size: .9rem; color: var(--muted); }
.markdown-body h6 { font-size: .85rem; color: var(--muted); }

/* заголовок сразу после заголовка — уменьшаем верхний отступ */
.markdown-body h1 + h2,
.markdown-body h2 + h3,
.markdown-body h3 + h4 { margin-top: 16px; }

/* ---------- параграфы ---------- */
.markdown-body p { margin: 0 0 16px; }
.markdown-body p:last-child { margin-bottom: 0; }

/* ---------- списки (вот тут основная боль) ---------- */
.markdown-body ul,
.markdown-body ol {
    margin: 0 0 16px;
    padding-left: 28px;      /* маркеры не вылезают за контейнер */
}
.markdown-body ul { list-style: disc; }
.markdown-body ul ul { list-style: circle; }
.markdown-body ul ul ul { list-style: square; }
.markdown-body ol { list-style: decimal; }
.markdown-body ol ol { list-style: lower-alpha; }
.markdown-body ol ol ol { list-style: lower-roman; }

.markdown-body li { margin: 0; padding: 0; }
.markdown-body li + li { margin-top: 6px; }

/* параграф внутри li — убираем двойной отступ */
.markdown-body li > p { margin: 0 0 6px; }
.markdown-body li > p:last-child { margin-bottom: 0; }

/* вложенные списки — плотнее, без лишнего воздуха */
.markdown-body li > ul,
.markdown-body li > ol {
    margin: 6px 0 0;
    padding-left: 24px;
}

/* task-list — выравниваем чекбокс ровно по базовой линии текста */
.markdown-body ul.contains-task-list {
    list-style: none;
    padding-left: 4px;
}
.markdown-body li.task-list-item {
    list-style: none;
    margin-top: 4px;
}
.markdown-body li.task-list-item > input[type="checkbox"] {
    margin: 0 8px 0 0;
    vertical-align: -1px;
    accent-color: var(--accent);
}

/* ---------- цитаты ---------- */
.markdown-body blockquote {
    margin: 0 0 16px;
    padding: 8px 16px;
    border-left: 3px solid var(--accent);
    background: rgba(109, 140, 255, .06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--muted);
}
.markdown-body blockquote > :last-child { margin-bottom: 0; }
.markdown-body blockquote > :first-child { margin-top: 0; }

/* ---------- код ---------- */
.markdown-body code {
    font-family: var(--mono);
    background: var(--panel-3);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: .85em;
    white-space: break-spaces;
}
.markdown-body pre {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin: 0 0 16px;
    overflow-x: auto;
    font-size: .85rem;
    line-height: 1.55;
    max-width: 100%;
}
.markdown-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 1em;
    white-space: pre;
}

/* ---------- картинки ---------- */
.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    vertical-align: middle;
}
/* бейджи (shields.io и т.п.) — инлайновые, без бордера и без сжатия */
.markdown-body p > img,
.markdown-body p > a > img {
    display: inline-block;
    margin: 2px 6px 2px 0;
    border: none;
    border-radius: 4px;
    max-height: 20px;
    width: auto;
}
/* одиночная большая картинка — центрим, ограничиваем высоту */
.markdown-body p > img:only-child {
    display: block;
    margin: 16px auto;
    max-height: 520px;
    width: auto;
    object-fit: contain;
}

/* ---------- таблицы ---------- */
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px;
    font-size: .88rem;
    display: block;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.markdown-body thead { background: var(--panel-2); }
.markdown-body th,
.markdown-body td {
    padding: 9px 14px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
.markdown-body th { font-weight: 700; white-space: nowrap; }
.markdown-body tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .015); }
.markdown-body tbody tr:hover td { background: rgba(109, 140, 255, .05); }

/* ---------- hr ---------- */
.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* ---------- details / summary ---------- */
.markdown-body details {
    margin: 0 0 16px;
    padding: 10px 14px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.markdown-body summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    margin: -10px -14px;
    padding: 10px 14px;
}
.markdown-body details[open] summary {
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ---------- kbd ---------- */
.markdown-body kbd {
    font-family: var(--mono);
    font-size: .8em;
    padding: 2px 6px;
    background: var(--panel-3);
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    color: var(--text);
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
    .markdown-body { font-size: 15px; }
    .markdown-body h1 { font-size: 1.45rem; }
    .markdown-body h2 { font-size: 1.2rem; }
    .markdown-body h3 { font-size: 1.05rem; }
    .markdown-body pre { padding: 12px; font-size: .8rem; }
    .markdown-body table { font-size: .82rem; }
    .markdown-body th,
    .markdown-body td { padding: 7px 10px; }
    .markdown-body p > img:only-child { max-height: 340px; }
}


/* ---------------- repo page ---------------- */

.clone-box { margin-bottom: 20px; }
.clone-label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--faint);
    margin-bottom: 10px;
}
.clone-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.clone-row input {
    flex: 1;
    min-width: 0;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: .85rem;
}
.clone-row .proto {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    background: var(--panel-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--faint);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
}

.file-list { list-style: none; }
.file-list li {
    padding: 7px 10px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .9rem;
}
.file-list li:hover { background: var(--panel-3); }
.file-list li::before {
    content: '';
    width: 14px;
    height: 14px;
    flex: none;
    background: var(--faint);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.commit-list { list-style: none; }
.commit-list li {
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: .9rem;
    flex-wrap: wrap;
}
.commit-list li:last-child { border-bottom: none; }
.commit-list .sha {
    font-family: var(--mono);
    font-size: .78rem;
    background: var(--panel-3);
    padding: 2px 7px;
    border-radius: 6px;
    color: var(--accent);
    flex: none;
}
.commit-author { color: var(--faint); font-size: .8rem; margin-left: auto; }

.pr-list { list-style: none; }
.pr-list li {
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.pr-list li:last-child { border-bottom: none; }
.pr-list li:hover { background: rgba(255, 255, 255, .015); }
.pr-list .meta { color: var(--muted); font-size: .84rem; }

.rules { list-style: none; margin-left: 0; }
.rules li {
    position: relative;
    padding-left: 26px;
    margin: 9px 0;
    font-size: .92rem;
    color: var(--muted);
}
.rules li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--green);
    font-weight: 700;
}

.steps { margin-left: 22px; }
.steps li { margin: 12px 0; }
.steps li::marker { color: var(--accent); font-weight: 700; }

/* ---------------- PR page ---------------- */

.admin-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.edit-form { margin-top: 20px; }
.meta-line { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.meta-line strong { color: var(--text); font-weight: 650; }

/* ---------------- modal / toast / states ---------------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 12, .72);
    backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}
.modal-overlay.active { display: flex; animation: fade .18s ease; }
.modal {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 26px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: rise .25s cubic-bezier(.2, .7, .3, 1);
}
.modal h3 { color: var(--text); margin-bottom: 18px; font-size: 1.15rem; }
.modal p { color: var(--muted); font-size: .92rem; margin: 6px 0; }

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 13px 20px;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(16px) scale(.97);
    transition: opacity .25s, transform .25s;
    z-index: 2000;
    box-shadow: var(--shadow);
    pointer-events: none;
    max-width: min(420px, calc(100vw - 48px));
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast-success { background: rgba(52, 211, 153, .15); color: var(--green); border: 1px solid rgba(52, 211, 153, .3); }
.toast-error { background: rgba(248, 113, 113, .15); color: var(--red); border: 1px solid rgba(248, 113, 113, .3); }

.empty-state {
    text-align: center;
    padding: 46px 20px;
    color: var(--faint);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    font-size: .92rem;
}
.loading { text-align: center; padding: 42px; color: var(--faint); }
.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid var(--faint);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    vertical-align: -2px;
}

/* ---------------- private / error pages ---------------- */

.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}
.center-page .icon { font-size: 64px; margin-bottom: 18px; line-height: 1; }
.center-page h1 { font-size: 1.4rem; color: var(--text); margin-bottom: 8px; }
.center-page p { color: var(--muted); }
.center-page .btn { margin-top: 22px; }
.error-code {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: -.04em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.1;
}

/* ---------------- animations ---------------- */

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- responsive ---------------- */

@media (max-width: 640px) {
    .container { padding: 24px 14px 60px; }
    .header, .topbar { flex-direction: column; align-items: flex-start; }
    .repo-actions { flex-direction: column; }
    .repo-actions .btn { width: 100%; }
    .tabs { flex-wrap: wrap; }
    .clone-row { flex-wrap: wrap; }
    .clone-row input { flex-basis: 100%; }
    .page-title { font-size: 1.25rem; }
}
