:root {
    --bg: #f7f6f3;
    --surface: #ffffff;
    --text: #2b2a28;
    --muted: #8a8577;
    --rule: #e4e1d8;

    --accent: #b5502e;
    --accent-dim: #8f3f24;

    --add-bg: #eaf3e6;
    --add-text: #266a35;
    --add-marker: #4c9a4c;
    --error: #ae3327;

    --lang-go: #3aa6a6;
    --lang-python: #4472c4;
    --lang-php: #7a5ea8;
    --lang-java: #b5502e;
    --lang-lua: #3a6bb5;
    --lang-default: #8a8577;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 15px;
    line-height: 1.6;
}

main {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 1.5rem 5rem;
}

a {
    color: var(--accent);
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.cmd {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0 0 2.5rem;
}

.cmd::before {
    content: '$ ';
    color: var(--accent);
}

.patches {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

.patch {
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: var(--surface);
    overflow: hidden;
}

.patch-header {
    padding: 0.9rem 1.1rem 0.8rem;
    border-bottom: 1px dashed var(--rule);
    color: var(--muted);
    font-size: 0.78rem;
}

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

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

.patch-header .subject {
    color: var(--text);
    font-weight: 600;
    margin-top: 0.3rem;
}

.patch-header .subject a {
    color: inherit;
    text-decoration: none;
}

.patch-header .subject a:hover,
.patch-header .subject a:focus-visible {
    color: var(--accent);
}

.diff-meta {
    padding: 0.7rem 1.1rem 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.diff-hunk {
    color: #6b5fa8;
    font-size: 0.78rem;
    padding: 0.4rem 1.1rem;
}

.diff-line {
    display: flex;
    gap: 0.6rem;
    padding: 0.2rem 1.1rem;
    font-size: 0.86rem;
}

.diff-line.add {
    background: var(--add-bg);
    color: var(--add-text);
}

.diff-line .marker {
    color: var(--add-marker);
    font-weight: 700;
    user-select: none;
}

.diff-line .key {
    color: var(--muted);
    min-width: 4.2rem;
}

.diff-line.add .key {
    color: var(--add-marker);
}

.diff-file-footer {
    height: 0.7rem;
}

.lang-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dot-color, var(--lang-default));
    margin-right: 0.4rem;
}

.meta {
    margin-top: 2.5rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.diff {
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--surface);
    padding: 1.5rem;
}

.field-group {
    margin-bottom: 1.25rem;
}

.field-group:last-of-type {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

label::before {
    content: '+ ';
    color: var(--add-marker);
}

input,
textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 3px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.65rem 0.75rem;
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    min-height: 140px;
}

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

button {
    margin-top: 1.5rem;
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
}

button:hover,
button:focus-visible {
    background: var(--accent-dim);
}

button:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.status {
    border-radius: 3px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.status.ok {
    border: 1px solid var(--add-marker);
    background: var(--add-bg);
    color: var(--add-text);
}

.status.err {
    border: 1px solid var(--error);
    background: #fbebe9;
    color: var(--error);
}

.status ul {
    margin: 0.4rem 0 0;
    padding-left: 1.1rem;
}

footer {
    border-top: 1px solid var(--rule);
    background: var(--surface);
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
}

footer .branch {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

footer .branch svg {
    width: 14px;
    height: 14px;
    opacity: 0.75;
}

footer .links {
    display: flex;
    gap: 1.1rem;
    align-items: center;
}

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

footer a:hover,
footer a:focus-visible {
    color: var(--accent);
}

footer .gitlab-icon {
    width: 18px;
    height: 18px;
    display: block;
}

@media (prefers-reduced-motion: no-preference) {
    .patch {
        animation: fadeIn 0.35s ease backwards;
    }
}

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

@media (max-width: 480px) {
    .diff-line { flex-wrap: wrap; }
    .diff-line .key { min-width: auto; }
}