/* Copyright (c) 2026 Michael D Henderson. */

/* One stylesheet, served from the binary. It is plain CSS on purpose: a build
   step for the UI would mean the UI could not be changed by the people who
   change the rest of this repository. */

:root {
    --ink: #16181d;
    --muted: #5f6672;
    --line: #d8dce3;
    --paper: #ffffff;
    --shade: #f4f6f9;
    --accent: #1c4f8f;
    --warn: #8a4b00;
    --bad: #9b1c1c;
    --good: #14622f;
    --radius: 5px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--shade);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

pre { white-space: pre-wrap; word-break: break-word; }

/* Navigation */

header.top {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

header.top nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    max-width: 68rem;
    margin: 0 auto;
    padding: 0.6rem 1rem;
}

header.top .brand { font-weight: 700; letter-spacing: 0.02em; }
header.top .spacer { flex: 1; }
header.top a { text-decoration: none; }
header.top a:hover { text-decoration: underline; }
header.top form { margin: 0; }

.badge {
    display: inline-block;
    min-width: 1.4em;
    padding: 0 0.35em;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    text-align: center;
}

.banner {
    background: #fdf3d8;
    border-bottom: 1px solid #e6d08a;
    color: var(--warn);
    padding: 0.35rem 1rem;
    text-align: center;
    font-size: 13px;
}

main { max-width: 68rem; margin: 0 auto; padding: 1.25rem 1rem 4rem; }

h1 { font-size: 22px; margin: 0 0 0.25rem; }
h2 { font-size: 17px; margin: 0 0 0.5rem; }
h3 { font-size: 15px; margin: 0 0 0.4rem; }

.sub { color: var(--muted); margin: 0 0 1.25rem; }

/* Cards and grids */

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 0 0 1rem;
}

.grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 60rem) { .grid { grid-template-columns: 1fr; } }

.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* Tables */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: 0; }

/* Forms */

label { display: block; font-size: 13px; color: var(--muted); margin: 0.6rem 0 0.2rem; }
input, select, textarea {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: inherit;
    font: inherit;
}
textarea { min-height: 7rem; resize: vertical; }
.inline { display: inline-block; width: auto; }

button, .button {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button[disabled] { color: var(--muted); background: var(--shade); cursor: not-allowed; }

form.inline-form { display: inline; margin: 0; }

/* The action bar: every transition the engine declares, refused ones drawn
   disabled with the reason beside them. */

.actions { display: flex; flex-direction: column; gap: 0.5rem; }
.action { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.action .why { color: var(--muted); font-size: 13px; }
.action .guard { color: var(--warn); font-size: 12px; font-family: ui-monospace, Menlo, monospace; }

/* Status words */

.pill {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--shade);
    font-size: 12px;
}
.pill.state { border-color: #b9cbe4; background: #eaf1fa; color: var(--accent); }
.pill.late { border-color: #eab9b9; background: #fbeaea; color: var(--bad); }
.pill.locked { border-color: #e6d08a; background: #fdf3d8; color: var(--warn); }
.pill.open { border-color: #e6d08a; background: #fdf3d8; color: var(--warn); }
.pill.resolved { border-color: #a9d5b8; background: #eaf7ee; color: var(--good); }

.notice { border-left: 3px solid var(--good); background: #eaf7ee; padding: 0.5rem 0.75rem; border-radius: var(--radius); margin: 0 0 1rem; }
.problem { border-left: 3px solid var(--bad); background: #fbeaea; padding: 0.5rem 0.75rem; border-radius: var(--radius); margin: 0 0 1rem; }
.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }

/* Comments */

.thread { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 0.75rem; margin: 0 0 0.75rem; }
.thread .who { font-size: 13px; color: var(--muted); }
.thread .body { white-space: pre-wrap; margin: 0.25rem 0; }
.reply { border-left: 2px solid var(--line); margin: 0.5rem 0 0 0.75rem; padding-left: 0.75rem; }

/* Diff */

.diff ins { background: #dff3e4; text-decoration: none; }
.diff del { background: #fbdcdc; }
.diff .field { margin: 0 0 1rem; }
