:root {
    --ink: #1c2230;
    --muted: #5c6678;
    --line: #dde2ea;
    --paper: #ffffff;
    --page: #f4f6f9;
    --accent: #2f5596;
    --accent-ink: #ffffff;
    --error: #b3261e;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--page);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
}

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

h1 {
    margin: 0 0 12px;
    font-size: 22px;
    line-height: 1.3;
}

h2 {
    margin: 0 0 10px;
    font-size: 17px;
}

.page {
    min-height: 100vh;
}

.top {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.top .brand {
    margin-right: auto;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
}

.top .who {
    color: var(--muted);
}

.top form {
    margin: 0;
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    font: inherit;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
}

button.primary,
.button.primary {
    color: var(--accent-ink);
    background: var(--accent);
    border-color: var(--accent);
}

button.link {
    padding: 0;
    color: var(--accent);
    background: none;
    border: 0;
}

input,
textarea,
select {
    width: 100%;
    padding: 8px 10px;
    font: inherit;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid #c9d0db;
    border-radius: 6px;
}

input[type=file] {
    padding: 6px;
}

textarea {
    resize: vertical;
}

label {
    display: block;
    margin: 14px 0 4px;
    font-weight: 600;
}

.error {
    color: var(--error);
}

.hint,
.empty,
.meta,
.crumbs,
.count {
    color: var(--muted);
}

.hint {
    margin: 4px 0 0;
    font-size: 13px;
}

.crumbs {
    margin: 0 0 4px;
}

.heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.heading h1 {
    margin: 0;
    flex: 1 1 300px;
}

.number {
    color: var(--muted);
    font-weight: 400;
}

/* Sign in */
.signin {
    max-width: 360px;
    margin: 12vh auto 0;
    padding: 28px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.signin button {
    width: 100%;
    margin-top: 18px;
}

.validation-message {
    margin: 4px 0 0;
    color: var(--error);
    font-size: 13px;
}

/* Lists */
.projects,
.issues {
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.projects li,
.issues li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
}

.projects li:first-child,
.issues li:first-child {
    border-top: 0;
}

.projects a,
.issues .title {
    flex: 1 1 320px;
    font-weight: 600;
    text-decoration: none;
}

.issues .title:hover,
.projects a:hover {
    text-decoration: underline;
}

.issues .meta {
    flex-basis: 100%;
    font-size: 13px;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
}

.tabs a {
    padding: 6px 12px;
    color: var(--ink);
    text-decoration: none;
    border-radius: 6px;
}

.tabs a[aria-current=page] {
    font-weight: 600;
    background: var(--paper);
    box-shadow: inset 0 0 0 1px var(--line);
}

/* Status badges */
.status {
    display: inline-block;
    padding: 1px 9px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 999px;
}

.status.open { color: #1d5b2e; background: #dcf1e2; }
.status.inprogress { color: #1f4a8a; background: #dde8f8; }
.status.waitingonclient { color: #7a4b00; background: #fbeccc; }
.status.done { color: #4b3a8a; background: #e8e2f7; }
.status.parked { color: #505a68; background: #e6e9ee; }

/* An issue's thread */
.thread {
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.entry {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.entry.latest {
    border-color: #b9c8e3;
}

.entry .meta {
    margin: 0;
    font-size: 13px;
}

.entry .meta b {
    color: var(--ink);
}

.entry .body {
    margin-top: 8px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.files img {
    display: block;
    max-width: min(100%, 420px);
    max-height: 320px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.reply {
    padding: 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.issue-form .actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.reply select {
    max-width: 260px;
}
