/* The platform board, on app.css's tokens, grid and tables: dense tables
 * take the whole width, numbers line up in tabular figures, a zero recedes,
 * and one strong colour marks what failed, always beside its word. */

main {
    max-width: none;
}

h2 {
    margin: 0;
    color: var(--ink);
    font: var(--type-body);
    font-weight: 600;
}

/* a page's blocks read apart; a block's heading reads with its table */
.board {
    gap: 2rem;
}

.board > :is(section, header) {
    gap: 0.5rem;
}

/* the title and its window share a row while they fit; on a narrow screen
 * the window drops below the title instead of over it */
.board .view_header.split {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.meta {
    margin: 0;
}

table {
    font-variant-numeric: tabular-nums;
}

/* a board's table holds a dozen columns: cells pad less than the app's, and
 * a heading takes a second line before the table scrolls */
.board :is(th, td) {
    padding: 0.5rem;
}

.board th {
    vertical-align: bottom;
    white-space: normal;
}

.num {
    text-align: right;
}

.none {
    color: var(--text-disabled);
}

.alarm {
    color: var(--danger);
    font-weight: 600;
}

/* messages in, by hour: ClickHouse's sparkbar, one block a bar */
.trend {
    color: var(--text-secondary);
    font: var(--type-caption);
    font-family: var(--font-mono);
}

/* a note or a summary wraps; every other cell keeps to one line */
td.wrap {
    min-width: 16rem;
    white-space: normal;
}

td > a {
    text-decoration: none;
}

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

td .caption {
    margin-left: 0.5rem;
    color: var(--text-muted);
    font: var(--type-caption);
}

/* the trail keeps to the brand's row and wraps within itself */
#crumb > nav {
    min-width: 0;
    flex: 1 1 10rem;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font: var(--type-body);
}

.crumbs > li + li::before {
    margin-right: 0.5rem;
    color: var(--text-disabled);
    content: "›";
}

.crumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.crumbs a:hover {
    color: var(--ink);
}

.crumbs [aria-current] {
    color: var(--ink);
    font-weight: 600;
}

.find {
    position: relative;
    width: min(22rem, 40vw);
}

.find > input {
    width: 100%;
}

.find_results {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    z-index: 2;
    width: max(100%, 22rem);
    max-width: calc(100vw - 2rem);
    display: grid;
    gap: 0.125rem;
    margin: 0;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(28, 25, 23, 0.12);
    list-style: none;
}

.find_results a,
.find_results .empty {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr) max-content;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
}

.find_results a:is(:hover, :focus-visible) {
    background: var(--surface-subtle);
}

.find_results .empty {
    display: block;
}

.find_results span:first-child {
    color: var(--text-muted);
    font: var(--type-caption);
    line-height: inherit;
}

.find_results code {
    color: var(--text-muted);
    font: var(--type-code);
}

/* one choice of a set, a link each: the window, a turn's ending, a filter */
.pills {
    gap: 0.25rem;
}

.pills > a {
    padding: calc(0.25rem - 1px) 0.625rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    font: var(--type-caption);
    text-decoration: none;
}

.pills > a:hover {
    border-color: var(--border-control);
    color: var(--ink);
}

.pills > a[aria-current] {
    border-color: var(--ink);
    background: var(--surface-selected);
    color: var(--ink);
    font-weight: 600;
}

.pills > a.alarm {
    color: var(--danger);
}

.pills > a > span {
    margin-left: 0.375rem;
}

/* the board's counts in one strip, hairlines between; a wrapped row's
 * counts widen to fill it rather than leave a grey hole */
.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--border);
}

.stats > div {
    flex: 1 1 7rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
}

.stats dt {
    color: var(--text-muted);
    font: var(--type-caption);
}

.stats dd {
    margin: 0;
    color: var(--ink);
    font: var(--type-subheading);
    font-variant-numeric: tabular-nums;
}

.facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.25rem 1.5rem;
    margin: 0;
}

.facts dt {
    color: var(--text-muted);
}

.facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

code {
    font-family: var(--font-mono);
}

pre {
    margin: 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: var(--type-code);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.trace_id {
    color: var(--text-secondary);
    font: var(--type-code);
    user-select: all;
}

/* the flame is its own page, framed at most a viewport tall below the top
 * bar, so a long one's sticky axis scrolls inside the frame */
.flame {
    width: 100%;
    height: calc(100dvh - 4rem);
    min-height: 12rem;
    max-height: calc(100dvh - 4rem);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.severity {
    padding: calc(0.125rem - 1px) 0.5rem;
    border: 1px solid currentColor;
    border-radius: 4px;
    color: var(--text-secondary);
    font: var(--type-caption);
    font-weight: 600;
    align-self: center;
}

.severity.alarm {
    color: var(--danger);
}

.open_link {
    font-weight: 600;
}

.command code {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--ink);
    font: var(--type-code);
    user-select: all;
}

/* a phone puts find on its own row, so the trail keeps the top bar's width */
@media (max-width: 700px) {
    #top.split {
        grid-auto-flow: row;
    }

    .find {
        width: 100%;
    }
}
