:root {
    color-scheme: light;
    --color-text: #26332e;
    --color-muted: #586660;
    --color-border: #d6dfda;
    --color-surface: #ffffff;
    --color-green: #86bc21;
    --color-blue: #0049b0;
    --color-error: #a02026;
    --radius: 6px;
    font-family: Bahnschrift, 'Trebuchet MS', sans-serif;
    font-size: 16px;
    letter-spacing: 0;
    line-height: 1.5;
    color: var(--color-text);
    background: #f5f8f6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 280px;
}

a {
    color: var(--color-blue);
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

a:hover {
    text-decoration-thickness: 2px;
}

button,
input {
    font: inherit;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid var(--color-blue);
    outline-offset: 3px;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

h2 {
    font-size: 20px;
    font-weight: 600;
}

.skip-link {
    position: absolute;
    top: -80px;
    left: 16px;
    z-index: 2;
    padding: 8px 16px;
    background: white;
}

.skip-link:focus {
    top: 8px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    min-height: 80px;
    padding: 16px 32px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text);
    font-size: 24px;
    font-weight: 600;
    text-decoration: none;
}

.brand img {
    flex: 0 0 32px;
}

.account {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    min-width: 0;
}

.account-name {
    display: flex;
    flex-direction: column;
    overflow-wrap: anywhere;
}

.account-name small {
    color: var(--color-muted);
    font-size: 12px;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.main-centered {
    display: grid;
    place-items: start center;
    max-width: none;
    min-height: calc(100svh - 80px);
    padding-top: 64px;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 39px, #eaf0ec 40px);
}

.login-panel {
    width: min(100%, 420px);
    padding: 32px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.login-panel h1 {
    margin-bottom: 24px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.field label {
    font-weight: 600;
    font-size: 14px;
}

.field input {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #85968d;
    border-radius: var(--radius);
    color: var(--color-text);
    background: white;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 24px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--color-blue);
}

.checkbox-label span {
    overflow-wrap: anywhere;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: normal;
    overflow-wrap: anywhere;
}

.button-primary {
    color: #142006;
    background: var(--color-green);
}

.button-primary:hover {
    background: #77a91b;
}

.button-secondary {
    color: var(--color-text);
    background: white;
    border-color: var(--color-border);
}

.button-secondary:hover {
    background: #edf3ef;
}

.button:disabled {
    opacity: .7;
    cursor: progress;
}

.login-submit {
    width: 100%;
}

.notice {
    margin-bottom: 20px;
    padding: 12px;
    border-left: 3px solid currentColor;
    overflow-wrap: anywhere;
}

.notice-error {
    color: var(--color-error);
    background: #fff0ef;
}

.page-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 12px 0 24px;
}

.section-label {
    color: var(--color-muted);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

.breadcrumbs span {
    color: var(--color-muted);
    overflow-wrap: anywhere;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: var(--color-surface);
}

th,
td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
    overflow-wrap: anywhere;
}

th {
    font-size: 12px;
    color: var(--color-muted);
    background: #eaf0ec;
    font-weight: 600;
}

td:first-child,
th:first-child {
    width: 60%;
}

td a {
    font-weight: 600;
    text-decoration: none;
}

td a:hover {
    text-decoration: underline;
}

.number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

tbody tr:hover {
    background: #f2f7f3;
}

.status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #edf0ee;
    color: #45554c;
    overflow-wrap: anywhere;
}

.status-1 {
    background: #e3f2d1;
    color: #345c11;
}

.status-2 {
    background: #e0edff;
    color: #17417a;
}

.status-3 {
    background: #ffebe9;
    color: #92262c;
}

.status-4 {
    background: #fff1cd;
    color: #71530a;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 24px;
    font-size: 14px;
}

.pagination span {
    color: var(--color-muted);
}

.empty-state {
    padding: 24px 0;
    color: var(--color-muted);
    border-block: 1px solid var(--color-border);
}

.project-description {
    max-width: 800px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.project-tickets {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.ticket-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin: 20px 0 0;
}

.ticket-summary div {
    border-left: 3px solid var(--color-border);
    padding-left: 16px;
}

.ticket-summary div:nth-child(2) {
    border-color: #5795f7;
}

.ticket-summary div:nth-child(3) {
    border-color: #f7cf57;
}

.ticket-summary div:nth-child(4) {
    border-color: var(--color-green);
}

.ticket-summary dt {
    color: var(--color-muted);
    font-size: 12px;
}

.ticket-summary dd {
    margin: 4px 0 0;
    font-size: 28px;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.board-ticket .ticket-title a {
    color: inherit;
    text-decoration: none;
}

.board-ticket .ticket-title a:hover {
    text-decoration: underline;
}

.ticket-detail-section h2 {
    margin-bottom: 16px;
}

.ticket-metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 20px;
    margin: 24px 0;
    padding: 24px 0;
    border-block: 1px solid var(--color-border);
}

.ticket-metadata dt {
    color: var(--color-muted);
    font-size: 14px;
}

.ticket-metadata dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.ticket-comment summary {
    padding: 12px 0;
    font-weight: 600;
    cursor: pointer;
}

.ticket-rich-text {
    min-width: 0;
    overflow-x: auto;
    overflow-wrap: anywhere;
}

.ticket-rich-text > * + * {
    margin-top: 12px;
}

.ticket-rich-text :is(h1, h2, h3, h4, h5, h6) {
    font-size: 20px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.ticket-rich-text pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ticket-rich-text table {
    min-width: 0;
    table-layout: fixed;
}

.ticket-rich-text :is(th, td) {
    width: auto;
    overflow-wrap: anywhere;
}

.error-panel {
    width: min(100%, 560px);
}

.error-panel h1 {
    margin-bottom: 24px;
}

.error-reference {
    margin-bottom: 24px;
    color: var(--color-muted);
    font-size: 14px;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .app-header {
        padding: 16px;
    }

    .account {
        gap: 12px;
    }

    .main-content {
        padding: 24px 16px;
    }

    .main-centered {
        padding-top: 32px;
    }

    .login-panel {
        padding: 24px;
    }

    h1 {
        font-size: 24px;
    }

    th,
    td {
        padding: 12px 8px;
    }

    td:first-child,
    th:first-child {
        width: 50%;
    }

    .ticket-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}