:root {
    color-scheme: light dark;
    --bg: #f6f7f9;
    --card: #ffffff;
    --text: #1b1f24;
    --muted: #5b6470;
    --line: #d9dee5;
    --accent: #1f5fd1;
    --accent-text: #ffffff;
    --error: #b3261e;
    --ok: #1e7a46;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14171b;
        --card: #1d2228;
        --text: #eceff3;
        --muted: #a2abb7;
        --line: #343c47;
        --accent: #6ea0ff;
        --accent-text: #0d1117;
        --error: #ff8a80;
        --ok: #6fd69b;
    }
}

* {
    box-sizing: border-box;
}

/* Rules further down give labels, links and bars their own "display". Without
   this, an element marked as hidden in the page would show anyway. */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem 2rem;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

nav {
    width: 100%;
    max-width: 58rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.25rem;
    padding: 1rem 0;
}

nav a {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

nav a[aria-current='page'] {
    color: var(--accent);
}

nav .who {
    margin-left: auto;
    color: var(--muted);
}

main {
    width: 100%;
    max-width: 34rem;
    margin-top: 6vh;
    padding: 2rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
}

h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

h2 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    color: var(--ok);
}

.lead {
    margin: 0 0 1.5rem;
    color: var(--muted);
}

label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

input:not([type='checkbox']),
select,
textarea {
    width: 100%;
    margin-bottom: 0.9rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
}

textarea {
    resize: vertical;
    line-height: 1.45;
}

fieldset {
    margin: 0 0 1rem;
    padding: 1rem 1rem 0.2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0 1rem;
}

main.wide {
    max-width: 58rem;
    margin-top: 0;
    /* On a phone the tables are wider than the screen: let the card scroll sideways. */
    overflow-x: auto;
}

nav + main:not(.wide) {
    margin-top: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.55rem 0.75rem 0.55rem 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-weight: 600;
}

td.actions {
    white-space: nowrap;
    text-align: right;
}

td.actions > :not(:first-child) {
    margin-left: 0.9rem;
}

.list {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.list h2 {
    color: var(--text);
}

label.inline {
    font-weight: 400;
}

button.plain {
    width: auto;
    margin: 0;
    padding: 0;
    background: none;
    color: var(--accent);
    font-weight: 400;
}

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

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button {
    margin-top: 0.1rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button:disabled {
    opacity: 0.6;
    cursor: progress;
}

.status {
    margin: 1rem 0 0;
    color: var(--muted);
}

.error {
    margin: 1rem 0 0;
    color: var(--error);
}

.status:empty,
.error:empty {
    display: none;
}

.result {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1rem;
    margin: 0 0 1rem;
}

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

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

.download {
    display: block;
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--ok);
    color: var(--card);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.note {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

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

/* ---- Radar ---- */

.status-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0 0 1rem;
    color: var(--muted);
}

.filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0 1rem;
    align-items: end;
}

.filter button[type='submit'] {
    margin-bottom: 0.9rem;
}

.filter label.inline {
    margin-bottom: 1.6rem;
}

.tabs button {
    margin-left: 1rem;
}

.tabs button[aria-pressed='true'] {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
}

button.left {
    text-align: left;
}

.pager {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin: 1rem 0 0;
    color: var(--muted);
}

.pager button:disabled {
    color: var(--muted);
    cursor: default;
}

#karte {
    height: 32rem;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.plain-list {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.plain-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--line);
}

dialog {
    width: min(46rem, calc(100vw - 2rem));
    max-height: calc(100vh - 4rem);
    padding: 1.5rem 2rem 2rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
}

dialog::backdrop {
    background: rgb(0 0 0 / 45%);
}

dialog h2 {
    margin-top: 1rem;
    color: var(--text);
}

.ad-text {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
