:root {
    color-scheme: light;
    --ground: #f3f5f0;
    --paper: #fff;
    --ink: #20302b;
    --muted: #52635c;
    --line: #dde4de;
    --forest: #172d28;
    --accent: #245c49;
    --accent-hover: #194533;
    --soft: #e7f0e9;
    --sun: #e4d99e;
    font: 1rem/1.55 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--ground); }
a { color: var(--accent); text-underline-offset: .16em; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid #6a9854; outline-offset: 3px; }
h1, h2, h3 { line-height: 1.17; letter-spacing: -.025em; margin: 0; }
h1 { font-size: clamp(2rem, 3.5vw, 3.25rem); font-weight: 650; }
h2 { font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 650; }
h3 { font-size: 1.1rem; font-weight: 650; }
h1 + p, h2 + p, h3 + p { margin-top: .55rem; }
p { margin: 0 0 .65rem; }
p:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin-block: 1.3rem; }
time, .number { font-variant-numeric: tabular-nums; }
main { width: min(100%, 89rem); margin-inline: auto; padding: 3.2rem clamp(1rem, 4vw, 4.5rem) 4rem; }
main > * + * { margin-top: 1.2rem; }
.workspace { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); align-items: start; }
.sidebar {
    position: sticky; top: 0; height: 100dvh;
    display: flex; flex-direction: column; padding: 2rem 1.25rem 1.35rem;
    background: var(--forest); color: #f2f7ef;
}
.brand { display: flex; align-items: center; gap: .75rem; font-weight: 650; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand img { display: block; flex: none; border-radius: .65rem; }
.sidebar nav { display: grid; gap: .3rem; margin-top: 2.45rem; }
.sidebar nav a {
    display: block; padding: .7rem .75rem; border-radius: .55rem;
    text-decoration: none; color: #c9d9d1; font-weight: 550; font-size: .94rem;
}
.sidebar nav a:hover, .sidebar nav a[aria-current] { background: #294740; color: #fff; }
.sidebar nav a[aria-current] { box-shadow: inset 3px 0 var(--sun); }
.session { display: flex; align-items: center; gap: .7rem; margin-top: auto; padding: 1rem .15rem 0; border-top: 1px solid #3c544d; }
.session-name { overflow-wrap: anywhere; min-width: 0; font-size: .9rem; }
.avatar { flex: 0 0 2.15rem; display: grid; place-items: center; aspect-ratio: 1; background: #dce8df; color: #254838; border-radius: 50%; font-weight: 700; }
.logout { background: transparent; padding: 0; font-size: .85rem; color: #c9d9d1; min-height: auto; text-align: left; }
.logout:hover { background: transparent; color: white; text-decoration: underline; }
.guest { background: radial-gradient(ellipse at 85% 0, #e1ece1, transparent 55%), var(--ground); }
.guest-header { padding: clamp(1.1rem, 4vw, 2.8rem) clamp(1.1rem, 5vw, 4rem); }
.guest main { padding-top: clamp(.9rem, 7vh, 5rem); }
.auth-panel { width: min(100%, 30rem); margin-inline: auto; }
.auth-panel h1 { font-size: 2.25rem; }
.page-header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-header p { color: var(--muted); }
.panel {
    background: var(--paper); border: 1px solid var(--line); border-radius: .9rem;
    padding: clamp(1rem, 2.5vw, 1.65rem); min-width: 0; overflow-wrap: anywhere;
    box-shadow: 0 1px 2px #1f38200a;
}
.panel > h2 + :not(p) { margin-top: .8rem; }
.narrow { max-width: 42rem; }
.stack { display: grid; gap: .9rem; align-content: start; }
.stack > * { margin-block: 0; min-width: 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .8rem; }
.layout-aside { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); }
.muted, .helptext, small { color: var(--muted); }
.eyebrow, .stat-label { color: var(--muted); font-weight: 650; font-size: .85rem; }
.eyebrow { margin-bottom: .5rem; letter-spacing: .035em; }
.stat { min-width: 0; }
.stat-value { display: block; font-size: clamp(1.45rem, 3vw, 2.2rem); font-weight: 650; letter-spacing: -.03em; }
.notice, .notices li { padding: .65rem .85rem; border-radius: .5rem; color: #153f2d; background: #e2efe6; }
.notices { margin-top: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.button, button {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.55rem;
    border: 1px solid transparent; border-radius: .5rem; padding: .54rem .95rem;
    background: var(--accent); color: #fff; font-weight: 620; font-size: .9rem; line-height: 1.25;
    cursor: pointer; text-decoration: none; text-align: center;
}
.button:hover, button:hover { color: #fff; background: var(--accent-hover); }
.button.secondary, button.secondary { color: var(--accent); background: #fbfdfa; border-color: #b6c8bb; }
.button.secondary:hover, button.secondary:hover { color: var(--accent-hover); background: var(--soft); }
button:disabled { opacity: .6; cursor: default; }
.danger, .errorlist { color: #9c2c2c; }
ul.errorlist { margin: .25rem 0; padding: .1rem 0 .1rem 1.4rem; font-size: .9rem; }
label, legend { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 .3rem; }
label:has(input[type="checkbox"]), label:has(input[type="radio"]) { display: flex; gap: .55rem; align-items: center; font-weight: 500; }
input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"]), textarea, select {
    width: 100%; min-width: 0; padding: .59rem .68rem; border: 1px solid #bac9bf;
    border-radius: .5rem; color: var(--ink); background: #fff; font-size: 1rem;
}
input[type="date"] { min-height: 2.65rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
input[readonly] { background: #f4f7f3; }
textarea { display: block; resize: vertical; line-height: 1.5; min-height: 5rem; }
fieldset { padding: .65rem .8rem; margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: .5rem; }
.helptext { font-size: .85rem; margin-top: .3rem; }
.helptext ul { margin-block: .35rem; padding-left: 1.35rem; }
.table-wrap, .table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .65rem .7rem; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: .88rem; font-weight: 650; background: var(--soft); }
tbody tr:last-child td { border-bottom: 0; }
details > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details[open] > summary { margin-bottom: .75rem; }
pre, .preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.skip-link { position: absolute; transform: translateY(-150%); z-index: 3; background: #fff; padding: .5rem 1rem; }
.skip-link:focus { transform: none; }
[hidden] { display: none !important; }

@media (max-width: 54rem) {
    .workspace { display: block; }
    .sidebar { position: static; height: auto; padding: .9rem 1rem; display: grid; grid-template-columns: 1fr auto; gap: .85rem; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: .2rem; grid-column: 1 / -1; margin: 0; }
    .sidebar nav a { padding: .48rem .59rem; }
    .session { grid-column: 2; grid-row: 1; margin: 0; padding: 0; border: 0; justify-self: end; }
    main { padding-top: 1.8rem; }
}
@media (max-width: 39rem) {
    .layout-aside { grid-template-columns: 1fr; }
    .sidebar .avatar { display: none; }
    .sidebar .brand { gap: .5rem; }
    .sidebar .brand img { width: 32px; height: 32px; }
}
@media print {
    .sidebar, .guest-header, .skip-link, .notices { display: none; }
    body.workspace { display: block; background: white; }
    main { padding: 0; }
    .panel { box-shadow: none; }
}
