/*
 * crt.rdp.sh
 *
 * One hand-written stylesheet, no framework, no build step, no CDN.
 * The idiom is the legacy GOV.UK Design System — flat colours, a black
 * masthead, generous body text, tables ruled with a single hairline —
 * which is also where bgp.tools gets its look. The palette below is
 * that toolkit's: #0b0c0c black, #bfc1c3 and #dee0e2 greys, #454a4c
 * footer text. The accent is ours.
 */

:root {
    --accent: #005ea5;
    --accent-dark: #00436f;
    --black: #0b0c0c;
    --grey-border: #bfc1c3;
    --grey-panel: #dee0e2;
    --grey-text: #454a4c;
    --page: #ffffff;
    --text: #0b0c0c;
    --muted: #6f777b;
    --good: #00703c;
    --warn: #b58840;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --page: #14171a;
        --text: #e8eaed;
        --grey-border: #3a4046;
        --grey-panel: #1d2126;
        --grey-text: #b6bcc2;
        --muted: #90979e;
        --accent: #6db3f2;
        --accent-dark: #9ecbf5;
        --good: #5ac48c;
        --warn: #d8a95a;
    }
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    background: var(--page);
    color: var(--text);
}

* { box-sizing: border-box; }

body {
    display: flex;
    flex-direction: column;
}

.wrap {
    margin: 0 auto;
    max-width: 1020px;
    width: 100%;
}

/* ---------------------------------------------------------- header */

#global-header {
    flex: 0 0 auto;
    background: var(--black);
    padding: 0.9rem 1rem;
}

#global-header .wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

#global-header a.site {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: -0.02em;
}

/* The masthead sits on near-black, where the link blue is too dark to
   read. These separators get their own lighter tone. */
#global-header a.site span { color: #8ab8dd; }

#global-header nav {
    margin-left: auto;
    display: flex;
    gap: 1.1rem;
}

#global-header nav a {
    color: #fff;
    font-size: 15px;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

#global-header nav a:hover { border-bottom-color: #fff; }

#accent-bar { height: 6px; background: var(--accent); flex: 0 0 auto; }

/* --------------------------------------------------------- content */

#content {
    flex: 1 1 auto;
    padding: 1.5rem 1rem 3rem;
    font-size: 17px;
    line-height: 1.5;
}

h1 { font-size: 32px; margin: 0 0 0.6rem; letter-spacing: -0.02em; }
h2 { font-size: 22px; margin: 2rem 0 0.6rem; }
h3 { font-size: 18px; margin: 1.4rem 0 0.4rem; }

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

p { margin: 0.5rem 0 1rem; }

code, kbd, pre, .mono, td.name, .feed li {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

code {
    background: var(--grey-panel);
    padding: 0.1em 0.35em;
    font-size: 0.9em;
}

pre {
    background: var(--grey-panel);
    padding: 0.8rem 1rem;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.45;
    margin: 0.6rem 0 1.2rem;
}

pre code { background: none; padding: 0; font-size: inherit; }

/* ---------------------------------------------------------- search */

form.search { display: flex; margin: 0.8rem 0 0.4rem; }

form.search input[type=text] {
    flex: 1 1 auto;
    font-size: 19px;
    padding: 0.55rem 0.7rem;
    border: 2px solid var(--black);
    border-right: 0;
    background: var(--page);
    color: var(--text);
    font-family: inherit;
    min-width: 0;
}

form.search input[type=text]:focus {
    outline: 3px solid #ffbf47;
    outline-offset: 0;
}

form.search button {
    font-size: 19px;
    padding: 0.55rem 1.3rem;
    border: 2px solid var(--accent);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
}

form.search button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.hint { color: var(--muted); font-size: 14px; margin: 0.2rem 0 1.2rem; }

/* ---------------------------------------------------------- tables */

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 15px;
    margin: 0.5rem 0 1rem;
}

table th, table td {
    border-bottom: 1px solid var(--grey-border);
    padding: 0.45rem 0.7rem 0.45rem 0;
    text-align: left;
    vertical-align: top;
}

table th {
    font-weight: bold;
    border-bottom: 2px solid var(--black);
    white-space: nowrap;
}

table td.num, table th.num { text-align: right; padding-right: 1rem; font-variant-numeric: tabular-nums; }

td.name { font-size: 14px; word-break: break-all; }

.scroll { overflow-x: auto; }

/* ------------------------------------------------------------ misc */

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-top: 4px solid var(--accent);
    background: var(--grey-panel);
    margin: 0 0 1.5rem;
}

.stats div {
    flex: 1 1 150px;
    padding: 0.7rem 1rem;
}

.stats .n {
    display: block;
    font-size: 26px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.stats .k { font-size: 13px; color: var(--grey-text); text-transform: uppercase; letter-spacing: 0.04em; }

.panel {
    background: var(--grey-panel);
    border-left: 5px solid var(--accent);
    padding: 0.8rem 1rem;
    margin: 1rem 0;
}

.panel.warn { border-left-color: var(--warn); }

.feed { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.7; }
.feed li { border-bottom: 1px solid var(--grey-border); padding: 0.15rem 0; word-break: break-all; }

.cols { display: flex; gap: 2rem; flex-wrap: wrap; }
.cols > * { flex: 1 1 300px; min-width: 0; }

.bar {
    display: block;
    height: 6px;
    background: var(--grey-border);
    min-width: 60px;
    position: relative;
}

.bar span { display: block; height: 100%; width: 0; background: var(--good); }

.cov { font-size: 12px; color: var(--muted); }

.tag {
    display: inline-block;
    font-size: 12px;
    padding: 0.05rem 0.4rem;
    background: var(--grey-border);
    color: var(--black);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tag.tiled { background: var(--accent); color: #fff; }

.pager { margin: 1.2rem 0; display: flex; gap: 0.8rem; align-items: center; }

.pager a {
    border: 2px solid var(--accent);
    padding: 0.35rem 0.9rem;
    text-decoration: none;
    font-size: 15px;
}

.pager a:hover { background: var(--accent); color: #fff; }

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

/* ---------------------------------------------------------- footer */

#global-footer {
    flex: 0 0 auto;
    border-top: 10px solid var(--accent);
    background: var(--grey-panel);
    padding: 1rem;
    font-size: 14px;
    color: var(--grey-text);
}

#global-footer a { color: var(--grey-text); }
#global-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
#global-footer p { margin: 0.2rem 0; }

@media (max-width: 640px) {
    #content { font-size: 16px; }
    h1 { font-size: 26px; }
    .stats .n { font-size: 21px; }
    #global-header nav { margin-left: 0; width: 100%; }
}
