:root {
    color-scheme: light;
    --bg-color: #f2f6f3;
    --input-bg: #ffffff;
    --text-color: #26352e;
    --input-text: #26352e;
    --primary: #176b4a;
    --primary-hover: #10553a;
    --heading-color: #173c2c;
    --card-bg: #ffffff;
    --card-shadow: 0 12px 34px rgba(29, 59, 43, 0.08);
    --border-color: #d7e4dc;
    --input-border: #c9d7ce;
    --note-color: #64746a;
    --title-color: #173c2c;
    --highlight-bg: #e4eee7;
    --input-placeholder: #77877d;
    --accent: #e5a84b;
}

.dark {
    color-scheme: dark;
    --bg-color: #17211b;
    --input-bg: #202d25;
    --text-color: #e5eee8;
    --input-text: #e5eee8;
    --primary: #77c49c;
    --primary-hover: #95d7b3;
    --heading-color: #e5eee8;
    --card-bg: #202d25;
    --card-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
    --border-color: #3a5143;
    --input-border: #52665a;
    --note-color: #a8b8ad;
    --title-color: #e5eee8;
    --highlight-bg: #26382c;
    --input-placeholder: #a8b8ad;
    --accent: #e5a84b;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    line-height: 1.65;
}

h1, h2, h3 {
    color: var(--heading-color);
    line-height: 1.2;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    max-width: 1240px;
    min-height: 82px;
    padding: 10px 32px;
    margin: 0 auto;
}

.logo-schrift {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-brand {
    color: inherit;
    text-decoration: none;
}

img#logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

h1#title {
    margin: 0;
    color: var(--title-color);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
    font-weight: 700;
}

.darkmode-toggle-label {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

#darkmode-toggle {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

img#lmg-bild {
    display: block;
    width: 100%;
    height: clamp(150px, 23vw, 290px);
    object-fit: cover;
    object-position: center 45%;
    background: var(--highlight-bg);
}

.main-content {
    width: min(100% - 48px, 1080px);
    margin: 0 auto;
    padding: 52px 0 88px;
}

.page-back {
    display: inline-flex;
    align-items: center;
    margin-bottom: 30px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.page-back:hover {
    text-decoration: underline;
}

.page-title {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 5vw, 48px);
}

.page-intro {
    max-width: 640px;
    margin: 12px 0 28px;
    color: var(--note-color);
    font-size: 17px;
}

.welcome-block {
    padding: 0 0 38px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.welcome-block h2 {
    max-width: 680px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 5vw, 54px);
    letter-spacing: 0;
}

.welcome-block > p:not(.eyebrow) {
    max-width: 640px;
    margin: 14px 0 28px;
    color: var(--note-color);
    font-size: 17px;
}

.entry-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.entry-action {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 112px;
    padding: 20px 22px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #ffffff;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.archive-action {
    background: #176b4a;
}

.upload-action {
    background: #a84e36;
    border-color: #a84e36;
}

.entry-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.archive-action:hover {
    background: #10553a;
}

.upload-action:hover {
    background: #8f402d;
}

.entry-action:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.action-number {
    flex: 0 0 auto;
    color: #f4cf8f;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    white-space: nowrap;
}

.action-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.action-copy strong {
    font-size: 17px;
}

.action-copy small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 1.4;
}

.action-arrow {
    margin-left: auto;
    font-size: 24px;
}

.about-block {
    padding-top: 34px;
    border-top: 1px solid var(--border-color);
}

.about-block > h2,
.section-heading {
    margin: 0 0 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
}

.about-block > p {
    max-width: 820px;
    margin: 0 0 36px;
    color: var(--note-color);
}

#archive,
#upload {
    scroll-margin-top: 24px;
}

.about-block > h3 {
    margin: 24px 0 10px;
    font-size: 17px;
}

.about-block > p:has(.klasse),
.about-block > p:has(.fach) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.filter-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.filter-section h3 {
    margin: 0 0 12px;
    font-size: 17px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-options label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    cursor: pointer;
}

.filter-options input {
    margin: 0;
    accent-color: var(--primary);
}

.about-block > p label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    cursor: pointer;
}

.klasse, .fach {
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.section-heading {
    padding-top: 32px;
    margin: 38px 0 14px;
    border-top: 1px solid var(--border-color);
}

.upload-select,
#user, #pwrd {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--input-text);
    font: inherit;
}

.upload-select {
    width: 100%;
    max-width: 240px;
    margin: 0 8px 12px 0;
}

.upload-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.upload-fields > div {
    width: 100%;
    max-width: 240px;
}

.upload-fields > div .upload-select {
    max-width: 100%;
}

input::placeholder {
    color: var(--input-placeholder);
}

button {
    min-height: 42px;
    padding: 10px 20px;
    border: 0;
    border-radius: 4px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: var(--primary-hover);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.upload-guidance {
    margin: 20px 0 10px;
    color: var(--note-color);
    font-weight: 700;
}

uc-file-uploader-minimal[inert] {
    opacity: 0.5;
}

uc-file-uploader-minimal {
    display: block;
    max-width: 620px;
    margin: 4px 0 14px;
}

.hidden {
    display: none;
}

.beschreibung {
    margin: 2px 0 15px;
    color: var(--note-color);
    font-style: italic;
}

.arbeit-wrapper {
    margin: 15px 0;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
}

.filter-reset {
    margin-top: 14px;
}

.result-count {
    margin: 12px 0 0;
    color: var(--note-color);
    font-size: 14px;
    font-weight: 700;
}

.archive-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 14px;
    margin-top: 10px;
}

.archive-results-list .arbeit-wrapper {
    margin: 0;
}

.arbeit-wrapper h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.arbeit-link {
    color: var(--primary);
    font-weight: 700;
}

.arbeit-metadata {
    display: grid;
    gap: 7px;
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.arbeit-metadata > div {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 8px;
}

.arbeit-metadata dt {
    color: var(--note-color);
    font-size: 13px;
}

.arbeit-metadata dd {
    margin: 0;
    color: var(--text-color);
    font-weight: 700;
}

.empty-results {
    color: var(--note-color);
}

#gallery img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
}

.upload-status {
    color: var(--primary);
    font-weight: 700;
}

.upload-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    max-width: 800px;
}

.upload-preview-item {
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
}

.upload-preview-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-item.file-preview {
    display: grid;
    min-height: 96px;
    padding: 16px;
    place-items: center;
    color: var(--primary);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

@media (max-width: 640px) {
    .top-bar {
        min-height: 72px;
        padding: 8px 16px;
    }

    img#logo {
        width: 40px;
        height: 40px;
    }

    h1#title {
        max-width: 180px;
        font-size: 17px;
    }

    .darkmode-toggle-label {
        gap: 5px;
        font-size: 12px;
    }

    img#lmg-bild {
        height: 170px;
    }

    .main-content {
        width: min(100% - 32px, 1080px);
        padding: 36px 0 60px;
    }

    .welcome-block h2 {
        font-size: 38px;
    }

    .entry-actions {
        grid-template-columns: 1fr;
    }

    .entry-action {
        min-height: 96px;
        padding: 16px;
    }

    .about-block > h2,
    .section-heading {
        font-size: 26px;
    }

    .upload-select {
        max-width: none;
    }

    .page-back {
        margin-bottom: 22px;
    }
}