:root {
    color-scheme: light;
    --paper: #fbf7f2;
    --ink: #351c25;
    --muted: #6b5259;
    --plum: #58243c;
    --peach: #f5bc9c;
    --line: #dbc9ca;
    font: 100%/1.55 system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--plum); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #a54d63; outline-offset: 4px; }
.shell {
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.brand {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4rem;
    min-width: 0;
    padding: clamp(2rem, 6vw, 6rem);
    background: var(--plum);
    color: var(--paper);
}
.brand::before, .brand::after {
    position: absolute;
    z-index: -1;
    width: 48vw;
    aspect-ratio: 1;
    left: 54%;
    top: 20%;
    border-radius: 50% 50% 12% 50%;
    transform: rotate(-33deg);
    content: "";
}
.brand::before { background: #75344c; }
.brand::after { border: 1px solid #b67583; top: 26%; left: 45%; }
.brand-label { display: flex; align-items: center; gap: .75rem; font-weight: 650; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 2.3rem;
    aspect-ratio: 1;
    border: 1px solid var(--peach);
    border-radius: 50%;
    color: var(--peach);
    font: italic 1.4rem Georgia, serif;
}
.brand-name { margin: 0; font: 400 clamp(3.1rem, 9vw, 9rem)/.94 Georgia, serif; letter-spacing: -.065em; }
.brand-caption { margin: .8rem 0 0; color: var(--peach); }
.panel {
    align-self: center;
    width: min(100%, 39rem);
    margin-inline: auto;
    padding: clamp(2rem, 6vw, 6rem);
    overflow-wrap: anywhere;
}
h1, h2 { font-family: Georgia, serif; font-weight: 400; line-height: 1.12; }
h1 { margin: 0 0 .65rem; font-size: clamp(2.5rem, 5vw, 4.5rem); letter-spacing: -.045em; }
.lead { color: var(--muted); margin: 0 0 2rem; }
.fields { display: grid; gap: 1rem; }
.fields p { margin: 0; }
label { display: block; font-weight: 625; }
input:not([type=hidden]) {
    display: block;
    width: 100%;
    margin-top: .4rem;
    padding: .8rem .9rem;
    font: inherit;
    font-weight: 400;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: .55rem;
    background: #fff;
}
.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .65rem;
    min-height: 3rem;
    padding: .7rem 1.05rem;
    border: 1px solid var(--plum);
    border-radius: .55rem;
    background: var(--plum);
    color: #fff;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { background: #70324e; }
.button.secondary { background: transparent; color: var(--plum); }
.button.secondary:hover { background: #f3e6e6; }
.login-button { width: 100%; margin-top: 1.35rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.alert { border-left: 3px solid #a54d63; padding: .7rem .85rem; background: #f7e5e8; }
.spinner {
    display: none;
    width: 1rem;
    aspect-ratio: 1;
    border: 2px solid #ffffff70;
    border-top-color: #fff;
    border-radius: 50%;
}
[aria-busy=true] .spinner { display: inline-block; animation: spin .75s linear infinite; }
[aria-busy=true] .login-button { cursor: wait; }
@keyframes spin { to { transform: rotate(360deg); } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.staff-page { width: min(100% - 2rem, 46rem); margin: 2rem auto 4rem; }
.staff-page section { border-top: 1px solid var(--line); padding: .85rem 0; overflow-wrap: anywhere; }
.staff-page input:not([type=hidden]) { max-width: 27rem; }
.staff-page details { margin-top: .7rem; }
@media (max-width: 720px) {
    .shell { grid-template-columns: 1fr; align-content: start; }
    .brand { gap: 2.25rem; padding: 1.5rem 1.5rem 2rem; }
    .brand-name { font-size: clamp(3.4rem, 13vw, 5.5rem); }
    .panel { padding: 2rem 1.5rem 3rem; }
}
@media (prefers-reduced-motion: reduce) {
    [aria-busy=true] .spinner { display: none; animation: none; }
}

.dash-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem max(1rem, calc((100vw - 70rem) / 2));
    background: var(--plum);
    color: var(--paper);
}
.dash-bar a { color: var(--paper); }
.dash-brand { font: 1.5rem Georgia, serif; text-decoration: none; }
.dash-brand span { margin-left: .5rem; color: var(--peach); font: 625 .8rem system-ui, sans-serif; }
.dashboard { width: min(100% - 2rem, 70rem); margin: 2.5rem auto 4rem; }
.dash-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.dash-heading .lead { margin-bottom: 0; }
.dash-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
    margin: 1.6rem 0 2rem;
}
.dash-stats > div { border: 1px solid var(--line); border-top: .22rem solid var(--plum); border-radius: .45rem; padding: .85rem; background: #fff; }
.dash-stats dt { color: var(--muted); font-size: .9rem; }
.dash-stats dd { margin: .3rem 0 0; font: 2rem Georgia, serif; }
.dash-section { margin: 1.7rem 0 2rem; }
.dash-section h2 { margin-bottom: .65rem; font-size: 1.65rem; }
.dash-section .lead { margin-bottom: .8rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: .55rem; background: #fff; }
.dashboard table { width: 100%; border-collapse: collapse; text-align: left; }
.dashboard th, .dashboard td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.dashboard thead th { font-size: .875rem; color: var(--plum); background: #f3e6e6; }
.dashboard tbody tr:last-child > * { border-bottom: 0; }
.status { display: inline-block; border-radius: 1rem; padding: .12rem .55rem; font-size: .85rem; font-weight: 650; white-space: nowrap; }
.status.positive { background: #dfefe4; color: #1e553a; }
.status.negative { background: #f7e5e8; color: #7c283f; }
.status.neutral { background: #eee6e8; color: #674b52; }
@media (max-width: 500px) {
    .dashboard th, .dashboard td { padding: .6rem; }
    .dash-stats { gap: .35rem; }
    .dash-stats > div { padding: .5rem; }
}

.api-editor { margin-top: .9rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .55rem; background: #fff; }
.api-editor summary { color: var(--plum); font-weight: 650; cursor: pointer; }
.api-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; margin: .8rem 0 1rem; }
.api-fields select { display: block; width: 100%; margin-top: .4rem; padding: .8rem .9rem; font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: .55rem; background: #fff; }
@media (max-width: 600px) { .api-fields { grid-template-columns: 1fr; } }
