:root {
    --brand: hsl(160 60% 26%);
    --primary: hsl(165 45% 16%);
    --text: hsl(200 20% 15%);
    --muted: hsl(200 8% 42%);
    --muted-surface: hsl(160 15% 95%);
    --line: hsl(160 12% 88%);
    --surface: #ffffff;
    --background: hsl(150 20% 98%);
    --refused: #a32020;
    --done: #1d6b3a;
    --radius: 0.5rem;
    font-family: system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
}

body {
    margin: 0;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--brand);
    font-weight: 600;
    text-underline-offset: 0.2em;
}

header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.site-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
    max-width: 64rem;
    min-height: 4rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-bar nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex: 1;
}

.brand {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.button-link {
    display: inline-block;
    padding: 0.5rem 1.125rem;
    color: #ffffff;
    background: var(--brand);
    border-radius: calc(var(--radius) - 2px);
    text-decoration: none;
}

.admin-bar {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--line);
}

.admin-bar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
}

.admin-bar a {
    padding: 0.75rem 0;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.admin-bar a.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.details dt {
    margin-top: 1rem;
    font-weight: 600;
}

.details dd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0 0;
}

.details code {
    overflow-wrap: anywhere;
}

main {
    flex: 1;
    width: 100%;
    max-width: 48rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    box-sizing: border-box;
}

h1, h2 {
    color: var(--primary);
    line-height: 1.25;
}

h1:focus {
    outline: none;
}

h1 {
    margin-top: 0;
    font-size: 2rem;
}

h2 {
    font-size: 1.375rem;
}

form {
    display: grid;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
}

label {
    display: grid;
    gap: 0.375rem;
    font-weight: 600;
}

input, select, button {
    font: inherit;
}

input, select {
    padding: 0.5rem 0.75rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) - 2px);
    min-width: 0;
}

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

button {
    justify-self: start;
    padding: 0.5rem 1.125rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
}

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

button.secondary {
    color: var(--brand);
    background: transparent;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    overflow: hidden;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

th {
    color: var(--primary);
    background: var(--muted-surface);
}

tr:last-child td {
    border-bottom: none;
}

.hint {
    color: var(--muted);
    font-weight: 400;
}

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

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

.loading {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
}

footer {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 1.25rem;
    background: #fff4c2;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    cursor: pointer;
}
