:root {
    color-scheme: light;
    --ink: #14251d;
    --muted: #617069;
    --forest: #173b2b;
    --forest-dark: #0e281d;
    --lime: #c9f04d;
    --cream: #f4f1e8;
    --paper: #fffef9;
    --line: #dce1d8;
    --danger: #a33d32;
    --warning: #9a6415;
    --shadow: 0 18px 45px rgb(18 45 32 / 9%);

    /* Farbreihe der Diagramme. Die ersten beiden sind die Markenfarben, die
       uebrigen halten genug Abstand zueinander, um auch nebeneinander im
       Ring unterscheidbar zu bleiben. */
    --chart-1: #173b2b;
    --chart-2: #c9f04d;
    --chart-3: #4f8a68;
    --chart-4: #e2a03f;
    --chart-5: #8ab4a0;
    --chart-6: #a33d32;
    --chart-7: #6b7d90;
    --chart-8: #d4c48a;
    font-family: Inter, Aptos, "Segoe UI", sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    overflow-x: clip;
    background: var(--cream);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    line-height: 1.55;
}

a {
    color: inherit;
    text-underline-offset: .2em;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: .55;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.06;
}

h1:focus {
    outline: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 76px;
    padding: 10px clamp(20px, 4vw, 64px);
    color: white;
    background: rgb(14 40 29 / 96%);
    border-bottom: 1px solid rgb(255 255 255 / 10%);
    backdrop-filter: blur(14px);
}

.brand,
.login-brand {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    width: fit-content;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--forest-dark);
    background: var(--lime);
    border-radius: 50%;
    font-family: Georgia, serif;
    font-weight: 800;
    letter-spacing: -.06em;
}

.brand strong,
.login-brand strong {
    display: block;
    font-family: Georgia, serif;
    font-size: 1.15rem;
    line-height: 1;
}

.brand small,
.login-brand small {
    display: block;
    margin-top: 4px;
    color: #b9c7c0;
    font-size: .66rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgb(255 255 255 / 7%);
    border-radius: 999px;
}

.main-nav a {
    padding: 8px 18px;
    color: #cad5d0;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 650;
    text-decoration: none;
}

.main-nav a.active,
.main-nav a:hover {
    color: var(--forest-dark);
    background: var(--lime);
}

.logout-form {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-self: end;
}

.current-user {
    color: #b9c7c0;
    font-size: .75rem;
}

.main-content {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: clamp(28px, 5vw, 72px) clamp(18px, 5vw, 72px) 72px;
    flex: 1;
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px clamp(20px, 5vw, 72px);
    color: #b9c7c0;
    background: var(--forest-dark);
    font-size: .78rem;
}

.readonly-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.readonly-indicator span,
.login-note span {
    width: 7px;
    height: 7px;
    background: var(--lime);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgb(201 240 77 / 15%);
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .5fr);
    align-items: center;
    min-height: 440px;
    padding: clamp(36px, 7vw, 96px);
    overflow: hidden;
    color: white;
    background: var(--forest);
    border-radius: 2px 48px 2px 2px;
}

.hero::before {
    position: absolute;
    inset: 0;
    content: "";
    opacity: .1;
    background-image: linear-gradient(90deg, transparent 49%, white 50%, transparent 51%), linear-gradient(transparent 49%, white 50%, transparent 51%);
    background-size: 80px 80px;
    mask-image: linear-gradient(to right, transparent, black);
}

.eyebrow {
    margin-bottom: 14px;
    color: #52675d;
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .19em;
}

.hero .eyebrow,
.detail-hero .eyebrow {
    color: var(--lime);
}

.hero h1,
.detail-hero h1,
.page-header h1,
.login-copy h1 {
    margin-bottom: 22px;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    letter-spacing: -.045em;
}

.hero h1 {
    max-width: 800px;
    font-size: clamp(3.2rem, 7vw, 6.8rem);
}

.hero h1 span {
    color: var(--lime);
    font-style: italic;
}

.hero-copy {
    max-width: 610px;
    margin-bottom: 0;
    color: #c6d2cc;
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.hero-orbit {
    position: relative;
    display: grid;
    place-items: center;
    width: min(26vw, 320px);
    aspect-ratio: 1;
    justify-self: center;
}

.orbit-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgb(201 240 77 / 40%);
    border-radius: 50%;
    box-shadow: inset 0 0 0 28px rgb(201 240 77 / 3%), inset 0 0 0 65px rgb(201 240 77 / 3%);
}

.orbit-ring::before,
.orbit-ring::after {
    position: absolute;
    width: 12px;
    height: 12px;
    content: "";
    background: var(--lime);
    border-radius: 50%;
}

.orbit-ring::before {
    top: 12%;
    right: 16%;
}

.orbit-ring::after {
    bottom: 5%;
    left: 28%;
}

.orbit-core {
    display: grid;
    place-items: center;
    width: 42%;
    aspect-ratio: 1;
    color: var(--forest-dark);
    background: var(--lime);
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: clamp(2rem, 5vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -.08em;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin-top: 30px;
    background: var(--line);
    border: 1px solid var(--line);
}

.metric-card {
    min-height: 165px;
    padding: 28px;
    background: var(--paper);
}

.metric-card.metric-primary {
    color: white;
    background: var(--forest-dark);
}

.metric-card strong {
    display: block;
    margin: 10px 0 0;
    font-family: Georgia, serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 500;
    line-height: 1;
}

.metric-label,
.metric-card small {
    display: block;
    color: var(--muted);
    font-size: .78rem;
}

.metric-card.metric-primary .metric-label,
.metric-card.metric-primary small {
    color: #b7c7bf;
}

.section-block {
    margin-top: clamp(48px, 7vw, 90px);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp(1.75rem, 3vw, 2.7rem);
    font-weight: 500;
    letter-spacing: -.025em;
}

.section-heading .eyebrow {
    margin-bottom: 6px;
}

.text-link,
.back-link {
    color: var(--forest);
    font-weight: 750;
    text-decoration: none;
}

/* Als Schaltflaeche gesetzte Textlinks - etwa zum Aufklappen einer Liste - sollen
   wie ein Link aussehen und nicht wie ein Formularknopf. */
button.text-link {
    padding: 0;
    background: none;
    border: 0;
}

.text-link:hover,
.back-link:hover {
    text-decoration: underline;
}

.event-list {
    border-top: 1px solid var(--ink);
}

.event-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto 30px;
    gap: 24px;
    align-items: center;
    padding: 18px 10px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: padding .2s ease, background .2s ease;
}

.event-row:hover {
    padding-inline: 18px;
    background: var(--paper);
}

.date-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    color: white;
    background: var(--forest);
}

.date-tile strong {
    font-family: Georgia, serif;
    font-size: 1.75rem;
    line-height: 1;
}

.date-tile span {
    color: var(--lime);
    font-size: .65rem;
    font-weight: 800;
}

.event-row-main,
.order-table td > span {
    min-width: 0;
}

.event-row-main strong,
.event-row-main small {
    display: block;
}

.event-row-main strong {
    overflow: hidden;
    font-family: Georgia, serif;
    font-size: 1.2rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-row-main small,
.muted,
.simple-list small {
    color: var(--muted);
}

.row-arrow {
    color: var(--forest);
    font-size: 1.3rem;
    font-weight: 800;
    text-decoration: none;
}

.status-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 25px;
    padding: 3px 10px;
    color: #4d5d55;
    background: #e8ece8;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-live,
.status-p {
    color: #183d1e;
    background: #d9efc4;
}

.status-test,
.status-warning,
.status-approval {
    color: #704708;
    background: #f5dea6;
}

.status-c,
.status-e,
.status-denied {
    color: #76352e;
    background: #f3d2ce;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    align-items: end;
    margin-bottom: 34px;
}

.page-header h1 {
    margin-bottom: 12px;
    font-size: clamp(3.2rem, 7vw, 6.2rem);
}

.page-header p:last-child {
    max-width: 680px;
    margin-bottom: 0;
    color: var(--muted);
}

.result-count {
    padding: 5px 12px;
    color: var(--muted);
    background: #e4e7df;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 750;
    white-space: nowrap;
}

.filter-bar,
.context-selector,
.stats-toolbar {
    display: flex;
    gap: 12px;
    align-items: end;
    margin-bottom: 28px;
    padding: 14px;
    background: var(--paper);
    border: 1px solid var(--line);
}

.filter-bar label,
.context-selector label,
.stats-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.context-selector label {
    flex: 1;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.filter-bar input,
.filter-bar select,
.context-selector select,
.stats-toolbar select,
.login-form input {
    min-height: 46px;
    padding: 9px 13px;
    color: var(--ink);
    background: white;
    border: 1px solid #ccd3cb;
    border-radius: 2px;
    outline: none;
}

.filter-bar input:focus,
.filter-bar select:focus,
.context-selector select:focus,
.stats-toolbar select:focus,
.login-form input:focus {
    border-color: var(--forest);
    box-shadow: 0 0 0 3px rgb(23 59 43 / 10%);
}

.search-field {
    position: relative;
    min-width: min(440px, 100%);
    flex: 1;
}

.search-field > span:not(.sr-only) {
    position: absolute;
    top: 10px;
    left: 14px;
    color: var(--muted);
    font-size: 1.2rem;
}

.search-field input {
    width: 100%;
    padding-left: 42px;
}

.event-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.event-card {
    display: flex;
    min-height: 340px;
    flex-direction: column;
    padding: 24px;
    background: var(--paper);
    border: 1px solid var(--line);
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.event-card:nth-child(4n + 1) {
    border-top: 5px solid var(--forest);
}

.event-card:nth-child(4n + 2) {
    border-top: 5px solid var(--lime);
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.event-card-top,
.event-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.event-card-top time {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.event-card-top time strong {
    font-family: Georgia, serif;
    font-size: 2.5rem;
    line-height: 1;
}

.event-card-top time span,
.event-card-body small,
.event-card-footer {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.event-card-body {
    margin: auto 0;
}

.event-card-body h2 {
    margin: 9px 0 12px;
    font-family: Georgia, serif;
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    font-weight: 500;
}

.event-card-body p {
    margin: 0;
    color: var(--muted);
}

.event-card-footer {
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    padding: 8px 17px;
    border: 1px solid transparent;
    border-radius: 2px;
    font-weight: 750;
    text-decoration: none;
}

.button-primary {
    color: var(--forest-dark);
    background: var(--lime);
    border-color: var(--lime);
}

.button-primary:hover {
    background: #d7fa67;
}

.button-secondary {
    color: var(--forest);
    background: transparent;
    border-color: #aeb8b0;
}

.button-secondary:hover {
    background: white;
}

.button-quiet {
    min-height: 36px;
    color: #cad5d0;
    background: transparent;
    border-color: rgb(255 255 255 / 18%);
    font-size: .8rem;
}

.button-wide {
    width: 100%;
}

.back-link {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 30px;
    font-size: .85rem;
}

.detail-hero {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    align-items: end;
    padding: clamp(30px, 6vw, 70px);
    color: white;
    background: var(--forest);
    border-radius: 2px 34px 2px 2px;
}

.detail-hero h1 {
    max-width: 920px;
    margin-bottom: 10px;
    font-size: clamp(2.5rem, 6vw, 5.2rem);
}

.detail-lead {
    margin-bottom: 0;
    color: #c2cec8;
    font-size: 1.05rem;
}

.badge-row,
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-actions {
    justify-content: flex-end;
    flex-shrink: 0;
}

.metric-grid.compact {
    margin-top: 1px;
}

.metric-grid.compact .metric-card {
    min-height: 145px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 34px;
}

.info-panel {
    padding: clamp(22px, 4vw, 36px);
    background: var(--paper);
    border: 1px solid var(--line);
}

.info-panel .section-heading h2 {
    font-size: 1.65rem;
}

.data-list,
.answer-list {
    margin: 0;
}

.data-list > div,
.answer-list > div {
    display: grid;
    grid-template-columns: minmax(120px, .75fr) minmax(0, 1.25fr);
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.data-list > div:last-child,
.answer-list > div:last-child {
    border-bottom: 0;
}

.data-list dt,
.answer-list dt {
    color: var(--muted);
    font-size: .78rem;
}

.data-list dd,
.answer-list dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 650;
}

.data-list.columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 36px;
}

.simple-list > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.simple-list > div:last-child {
    border-bottom: 0;
}

.simple-list span > strong,
.simple-list span > small {
    display: block;
}

.context-selector {
    margin-bottom: 12px;
    background: var(--forest);
    border-color: var(--forest);
}

.context-selector label {
    color: #b8c7c0;
}

.context-selector select {
    min-height: 50px;
}

.table-shell {
    overflow-x: auto;
    background: var(--paper);
    border: 1px solid var(--line);
}

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

.order-table th {
    padding: 13px 18px;
    color: var(--muted);
    background: #edf0e9;
    font-size: .68rem;
    letter-spacing: .09em;
    text-align: left;
    text-transform: uppercase;
}

.order-table td {
    min-width: 120px;
    padding: 18px;
    border-top: 1px solid var(--line);
    vertical-align: middle;
}

.order-table tbody tr:hover {
    background: #f8f8f2;
}

.order-table td strong,
.order-table td small {
    display: block;
}

.order-table td small {
    margin-top: 4px;
    color: var(--muted);
    font-size: .72rem;
}

.order-code {
    font-family: ui-monospace, "Cascadia Mono", monospace;
    font-weight: 800;
}

.test-order {
    box-shadow: inset 4px 0 #d69a2b;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 18px;
    align-items: center;
    margin-top: 24px;
    color: var(--muted);
    font-size: .82rem;
}

.order-total {
    min-width: 210px;
    padding: 20px;
    color: var(--forest-dark);
    background: var(--lime);
}

.order-total span,
.order-total small,
.order-total strong {
    display: block;
}

.order-total span,
.order-total small {
    font-size: .72rem;
    font-weight: 750;
    text-transform: uppercase;
}

.order-total strong {
    margin: 6px 0;
    font-family: Georgia, serif;
    font-size: 2.2rem;
}

.attention-box {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding: 16px 20px;
    color: #684509;
    background: #f7e4b8;
    border-left: 4px solid #bc7a12;
}

.address-card {
    display: flex;
    flex-direction: column;
    width: fit-content;
}

.address-card small {
    margin-top: 9px;
    color: var(--muted);
}

.position-list {
    display: grid;
    gap: 18px;
}

.position-card {
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--line);
}

.position-card.is-canceled {
    opacity: .68;
    box-shadow: inset 5px 0 var(--danger);
}

.position-card > header {
    display: grid;
    grid-template-columns: 45px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 20px 24px;
    background: #edf0e9;
}

.position-card h3,
.position-card p {
    margin: 0;
}

.position-card h3 {
    font-family: Georgia, serif;
    font-size: 1.25rem;
}

.position-card p {
    color: var(--muted);
    font-size: .78rem;
}

.position-number {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: white;
    background: var(--forest);
    border-radius: 50%;
    font-weight: 800;
}

.position-price {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.strike {
    text-decoration: line-through;
}

.position-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
    padding: 24px;
}

.answers-block h4 {
    margin: 0 0 8px;
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.answer-image {
    display: grid;
    gap: 8px;
    justify-items: start;
}

.answer-image img {
    display: block;
    width: min(320px, 100%);
    max-height: 280px;
    object-fit: contain;
    background: #edf0e9;
    border: 1px solid var(--line);
}

.answer-image .text-link {
    font-size: .75rem;
}

.position-card > footer {
    padding: 11px 24px;
    color: var(--muted);
    background: #f6f7f2;
    border-top: 1px solid var(--line);
    font-size: .74rem;
}

.comment-box {
    padding: 18px;
    margin-bottom: 18px;
    background: #f3f0e5;
    border-left: 3px solid var(--forest);
}

.comment-box p {
    margin: 6px 0 0;
    white-space: pre-wrap;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    gap: 24px;
}

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

.admin-list {
    max-height: 320px;
    overflow-y: auto;
}

.admin-form {
    display: grid;
    gap: 10px;
    padding-top: 20px;
    margin-top: 16px;
    border-top: 1px solid var(--line);
}

.admin-form input,
.admin-form select {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    color: var(--ink);
    background: white;
    border: 1px solid #ccd3cb;
}

.admin-form .checkbox-field {
    display: flex;
    gap: 9px;
    align-items: center;
    color: var(--muted);
    font-size: .8rem;
}

.admin-form .checkbox-field input {
    width: 18px;
    min-height: 18px;
}

.admin-form .validation-errors {
    margin: 0;
    color: var(--danger);
    font-size: .75rem;
}

.settings-panel,
.settings-aside {
    align-self: start;
}

.settings-explanation {
    max-width: 720px;
    color: var(--muted);
}

.settings-hint {
    max-width: 720px;
    margin-top: 12px;
    color: var(--muted);
    font-size: .9rem;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.sync-progress {
    margin: 20px 0;
    padding: 16px 18px;
    background: var(--paper);
    border: 1px solid var(--line);
}

.sync-progress-bar {
    height: 8px;
    overflow: hidden;
    background: var(--line);
}

.sync-progress-bar span {
    display: block;
    height: 100%;
    background: var(--forest);
    transition: width .3s ease;
}

.sync-progress-label {
    margin: 12px 0 0;
}

.sync-progress-counts {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: .9rem;
}

@media (prefers-reduced-motion: reduce) {
    .sync-progress-bar span {
        transition: none;
    }
}

.secret-placeholder {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 24px 0;
    padding: 16px 18px;
    color: #b8c8c0;
    background: var(--forest-dark);
    border-left: 4px solid var(--lime);
}

.secret-placeholder span {
    overflow: hidden;
    font-family: ui-monospace, "Cascadia Mono", monospace;
    letter-spacing: .12em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.secret-placeholder small {
    color: #8fa299;
    font-size: .7rem;
}

.settings-form {
    display: flex;
    gap: 12px;
    align-items: end;
    margin-top: 24px;
}

.settings-form label {
    display: grid;
    flex: 1;
    gap: 7px;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 750;
}

.settings-form input {
    width: 100%;
    min-height: 46px;
    padding: 9px 13px;
    color: var(--ink);
    background: white;
    border: 1px solid #ccd3cb;
    border-radius: 2px;
    outline: none;
}

.settings-form input:focus {
    border-color: var(--forest);
    box-shadow: 0 0 0 3px rgb(23 59 43 / 10%);
}

.validation-message {
    color: var(--danger);
    font-size: .72rem;
}

.settings-message {
    margin-top: 18px;
    padding: 13px 15px;
    border-left: 4px solid;
}

.settings-message.is-success {
    color: #214d2c;
    background: #dcefd4;
    border-color: #438453;
}

.settings-message.is-error {
    color: #76352e;
    background: #f3d2ce;
    border-color: var(--danger);
}

.settings-aside h2 {
    font-family: Georgia, serif;
    font-size: 1.65rem;
    font-weight: 500;
}

.step-list {
    display: grid;
    gap: 16px;
    padding: 0;
    margin: 28px 0 0;
    list-style: none;
}

.step-list li {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    align-items: start;
}

.step-list li > span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: var(--forest-dark);
    background: var(--lime);
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 850;
}

.step-list p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .85rem;
}

.settings-warning {
    flex-direction: column;
    gap: 4px;
    margin-top: 28px;
}

.loading-state,
.error-state,
.empty-state,
.page-loading {
    display: flex;
    min-height: 220px;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
    padding: 32px;
    color: var(--muted);
    background: var(--paper);
    border: 1px solid var(--line);
    text-align: center;
}

.error-state {
    flex-direction: column;
    color: var(--danger);
}

.error-state p {
    margin: 0;
}

.loader {
    width: 22px;
    height: 22px;
    border: 2px solid #cbd2cb;
    border-top-color: var(--forest);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-page {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(360px, .85fr) minmax(400px, 1.15fr);
    min-height: 100vh;
    overflow-y: auto;
    background: var(--paper);
}

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(520px, 100%);
    padding: clamp(28px, 7vw, 90px);
    margin: 0 auto;
}

.login-brand {
    margin-bottom: auto;
    color: var(--ink);
}

.login-brand small {
    color: var(--muted);
}

.login-copy {
    margin-top: clamp(40px, 8vh, 100px);
}

.login-copy h1 {
    margin-bottom: 16px;
    font-size: clamp(3rem, 6vw, 5.5rem);
}

.login-copy > p:last-child {
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.login-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 750;
}

.login-note {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: auto 0 0;
    padding-top: 36px;
    color: var(--muted);
    font-size: .7rem;
}

.login-visual {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--lime);
    background: var(--forest-dark);
}

.visual-grid {
    position: absolute;
    inset: 0;
    opacity: .14;
    background-image: linear-gradient(90deg, transparent 49%, white 50%, transparent 51%), linear-gradient(transparent 49%, white 50%, transparent 51%);
    background-size: 90px 90px;
}

.login-visual strong {
    z-index: 2;
    font-family: Georgia, serif;
    font-size: clamp(5rem, 12vw, 12rem);
    font-weight: 500;
    letter-spacing: -.08em;
    line-height: .72;
    text-align: center;
}

.visual-circle {
    position: absolute;
    border: 1px solid rgb(201 240 77 / 35%);
    border-radius: 50%;
}

.visual-circle-one {
    width: 65%;
    aspect-ratio: 1;
}

.visual-circle-two {
    width: 42%;
    aspect-ratio: 1;
    border-width: 25px;
    opacity: .25;
}

.inline-error {
    padding: 11px 13px;
    color: #7b3028;
    background: #f7d9d4;
    border-left: 3px solid var(--danger);
    font-size: .8rem;
}

#blazor-error-ui {
    position: fixed;
    z-index: 1000;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    padding: 12px 20px;
    color: white;
    background: var(--danger);
    text-align: center;
}

#blazor-error-ui .dismiss {
    margin-left: 16px;
    cursor: pointer;
}

@media (max-width: 1050px) {
    .topbar {
        grid-template-columns: 1fr auto;
        backdrop-filter: none;
    }

    .main-nav {
        position: fixed;
        z-index: 30;
        right: 12px;
        bottom: 12px;
        left: 12px;
        justify-content: space-around;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 8px 4px;
        background: rgb(14 40 29 / 92%);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgb(255 255 255 / 12%);
        border-radius: 16px;
        box-shadow: 0 8px 32px rgb(0 0 0 / 28%);
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a {
        flex: 1;
        padding-inline: 4px;
        text-align: center;
        font-size: .68rem;
        white-space: nowrap;
    }

    .main-content {
        padding-bottom: 120px;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .hero-orbit {
        position: absolute;
        right: -80px;
        bottom: -80px;
        opacity: .3;
    }

    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .event-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .login-page {
        grid-template-columns: minmax(360px, 1fr) minmax(280px, .7fr);
    }
}

@media (max-width: 760px) {
    .main-content {
        padding: 24px 14px 100px;
    }

    .topbar {
        min-height: 66px;
        padding-inline: 16px;
    }

    .brand small {
        display: none;
    }

    .button-quiet {
        padding-inline: 10px;
    }

    .current-user {
        display: none;
    }

    .hero {
        min-height: 390px;
        padding: 32px 22px;
        border-radius: 2px 28px 2px 2px;
    }

    .hero h1 {
        font-size: clamp(2.8rem, 14vw, 4.2rem);
    }

    .metric-grid,
    .event-card-grid,
    .detail-grid,
    .settings-grid,
    .admin-grid,
    .position-columns,
    .data-list.columns {
        grid-template-columns: 1fr;
    }

    .settings-form {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-form .button {
        width: 100%;
    }

    .main-nav a {
        font-size: .62rem;
    }

    .metric-card {
        min-height: 130px;
        padding: 22px;
    }

    .metric-card strong {
        font-size: 2.7rem;
    }

    .event-row {
        grid-template-columns: 62px minmax(0, 1fr) 20px;
        gap: 12px;
    }

    .event-row .status-badge {
        display: none;
    }

    .date-tile strong {
        font-size: 1.4rem;
    }

    .page-header,
    .detail-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header h1 {
        font-size: 3.7rem;
    }

    .filter-bar,
    .context-selector,
    .stats-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-bar label,
    .filter-bar select,
    .context-selector label,
    .context-selector select,
    .stats-toolbar label,
    .stats-toolbar select,
    .filter-bar .button {
        width: 100%;
    }

    .search-field {
        min-width: 0;
    }

    .event-card-grid {
        gap: 12px;
    }

    .event-card {
        min-height: 300px;
    }

    .detail-hero {
        padding: 30px 22px;
    }

    .detail-actions,
    .detail-actions .button,
    .order-total {
        width: 100%;
    }

    .order-table,
    .order-table tbody,
    .order-table tr,
    .order-table td {
        display: block;
        width: 100%;
    }

    .order-table thead {
        display: none;
    }

    .order-table tr {
        padding: 14px 18px;
        border-top: 1px solid var(--line);
    }

    .order-table tr:first-child {
        border-top: 0;
    }

    .order-table td {
        display: grid;
        grid-template-columns: minmax(100px, .65fr) minmax(0, 1.35fr);
        min-width: 0;
        padding: 7px 0;
        border: 0;
    }

    .order-table td::before {
        grid-row: 1;
        grid-column: 1;
        content: attr(data-label);
        color: var(--muted);
        font-size: .7rem;
    }

    /* Zellen mit mehr als einem Wert (Name, E-Mail, Telefon) wuerden sonst in die
       Labelspalte umbrechen und sich gegenseitig ueberlagern. */
    .order-table td > * {
        grid-column: 2;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .order-table td:last-child {
        display: none;
    }

    .position-card > header {
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 17px;
    }

    .position-card > header > strong {
        grid-column: 2;
    }

    .position-columns {
        gap: 24px;
        padding: 18px;
    }

    .data-list > div,
    .answer-list > div {
        grid-template-columns: minmax(90px, .65fr) minmax(0, 1.35fr);
    }

    /* position: fixed aus der Basisregel bleibt bestehen, sonst scheinen Topbar und
       Footer des MainLayouts durch und die Marke steht doppelt auf der Seite. */
    .login-page {
        display: block;
        min-height: 100dvh;
    }

    .login-panel {
        min-height: 100dvh;
        padding: 28px 22px;
    }

    .login-brand,
    .login-note {
        margin: 0;
    }

    .login-copy {
        margin-top: auto;
        padding-top: 60px;
    }

    .login-note {
        padding-top: 50px;
        margin-top: auto;
    }

    .login-visual {
        display: none;
    }

    .footer {
        padding-bottom: 88px;
    }
}

/* Sehr schmale Geraete: fuenf Navigationspunkte muessen weiterhin vollstaendig
   in die untere Leiste passen. */
@media (max-width: 400px) {
    .main-nav {
        right: 8px;
        left: 8px;
    }

    .main-nav a {
        padding-inline: 2px;
        font-size: .58rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
    }
}

/* ── Excel-Export ── */
.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.export-anchor {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.export-trigger {
    gap: 8px;
    white-space: nowrap;
}

.export-trigger > span:first-child {
    font-size: 1.05rem;
    line-height: 1;
}

.button-quiet-line {
    min-height: 34px;
    padding: 4px 12px;
    color: var(--forest);
    background: white;
    border-color: #ccd3cb;
    font-size: .78rem;
}

.button-quiet-line:hover {
    background: var(--cream);
    border-color: var(--forest);
}

.export-backdrop {
    position: fixed;
    z-index: 60;
    inset: 0;
    background: rgb(14 40 29 / 22%);
}

.export-popover {
    position: absolute;
    z-index: 61;
    top: calc(100% + 8px);
    right: 0;
    display: flex;
    flex-direction: column;
    width: min(340px, calc(100vw - 32px));
    padding: 16px;
    text-align: left;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 3px;
    box-shadow: var(--shadow);
}

.export-popover-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

.export-popover-head .eyebrow {
    margin-bottom: 2px;
}

.export-popover-head strong {
    font-size: 1.05rem;
}

.export-close {
    padding: 2px 6px;
    color: var(--muted);
    background: transparent;
    border: 0;
    font-size: .95rem;
    line-height: 1;
}

.export-close:hover {
    color: var(--ink);
}

.export-popover-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: .78rem;
}

.export-popover-tools .text-link {
    padding: 0;
    background: transparent;
    border: 0;
    font-size: .78rem;
}

.export-selection-count {
    margin-left: auto;
    white-space: nowrap;
}

.export-column-list {
    display: flex;
    flex-direction: column;
    max-height: 260px;
    margin: 4px -4px;
    padding: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.export-column {
    display: flex;
    gap: 9px;
    align-items: start;
    padding: 5px 4px;
    border-radius: 2px;
    font-size: .86rem;
    cursor: pointer;
}

.export-column:hover {
    background: var(--cream);
}

.export-column input {
    width: 15px;
    height: 15px;
    margin: 3px 0 0;
    accent-color: var(--forest);
    flex: 0 0 auto;
}

.export-note {
    margin: 10px 0 0;
    color: var(--warning);
    font-size: .78rem;
}

.export-message {
    margin: 8px 0 0;
    color: var(--danger);
    font-size: .8rem;
}

.export-popover-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.export-popover-foot small {
    color: var(--muted);
    font-size: .76rem;
}

.export-popover-foot .button {
    min-height: 36px;
    padding: 6px 14px;
    font-size: .82rem;
}

@media (max-width: 560px) {
    .export-popover {
        position: fixed;
        top: auto;
        right: 16px;
        bottom: 16px;
        left: 16px;
        width: auto;
        max-height: 70vh;
    }

    .export-column-list {
        max-height: none;
    }
}

/* Emojis und Symbole einer Tabellenzeile, etwa vegetarisches Essen oder das
   Verbot, Fotos zu veroeffentlichen. */
.row-indicators {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 1.1rem;
    line-height: 1.2;
}

.indicator-icon {
    width: 1.15em;
    height: 1.15em;
    vertical-align: -.22em;
    flex: none;
}


/* ── Statistik und Diagramme ── */
.stats-toolbar {
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.stats-toolbar > label {
    flex: 1 1 240px;
    min-width: 0;
}

.stats-toolbar label > span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Das Kontrollkaestchen steht neben seiner Beschriftung, nicht darunter wie die
   Auswahlfelder. */
.stats-toolbar .stats-toggle {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 9px;
    align-items: center;
    min-height: 46px;
    cursor: pointer;
}

.stats-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--forest);
    cursor: pointer;
}

.stats-toolbar .stats-toggle span {
    color: var(--ink);
    font-size: .84rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.stats-subheading {
    margin-top: 46px;
}

.stats-warning {
    margin: 0 0 18px;
    padding: 12px 16px;
    color: var(--warning);
    background: #fdf6e7;
    border-left: 3px solid var(--warning);
    font-size: .85rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.chart-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    /* Ohne diese Angabe waere die Mindestbreite der Karte die ihres breitesten
       Inhalts. Eine Saeulenreihe mit vielen Werten wuerde damit die Spalte des
       Rasters aufziehen - und mit ihr jede andere Karte. */
    min-width: 0;
    padding: 22px 24px 24px;
    background: var(--paper);
    border: 1px solid var(--line);
}

.chart-card-wide {
    grid-column: 1 / -1;
}

.chart-head {
    display: flex;
    gap: 14px;
    justify-content: space-between;
    align-items: flex-start;
}

.chart-head h3 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: -.015em;
}

.chart-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: .77rem;
    line-height: 1.35;
}

.chart-badge {
    padding: 4px 11px;
    color: white;
    background: var(--forest);
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.chart-empty {
    margin: 0;
    color: var(--muted);
    font-size: .85rem;
}

.chart-more {
    align-self: flex-start;
    margin: 0;
    font-size: .8rem;
}

/* ── Ringdiagramm ── */
.donut {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
}

.donut svg {
    width: 100%;
    max-width: 168px;
    height: auto;
}

.donut-track {
    fill: none;
    stroke: var(--cream);
    stroke-width: 26;
}

.donut-slice {
    fill: none;
    stroke-width: 26;
    transition: stroke-width .12s ease-out;
}

.donut-slice:hover {
    stroke-width: 31;
}

.donut-total {
    fill: var(--ink);
    font-family: Georgia, serif;
    font-size: 34px;
    text-anchor: middle;
}

.donut-caption {
    fill: var(--muted);
    font-size: 11px;
    letter-spacing: .08em;
    text-anchor: middle;
    text-transform: uppercase;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chart-legend li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    font-size: .83rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-value {
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.legend-value small,
.bar-value small {
    margin-left: 7px;
    color: var(--muted);
    font-weight: 500;
}

/* ── Liegende Balken ── */
.bar-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bar-list li {
    display: grid;
    grid-template-columns: minmax(84px, .85fr) minmax(0, 2fr) auto;
    gap: 12px;
    align-items: center;
    font-size: .83rem;
}

.bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    height: 14px;
    background: var(--cream);
    border-radius: 2px;
    overflow: hidden;
}

.bar-fill {
    display: block;
    min-width: 2px;
    height: 100%;
    border-radius: 2px;
}

.bar-value {
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ── Stehende Saeulen ── */
.column-chart {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    min-width: 0;
    overflow-x: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    scrollbar-width: thin;
}

.column-chart li {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    min-width: 34px;
}

.column-value {
    color: var(--ink);
    font-size: .76rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.column-track {
    display: flex;
    align-items: flex-end;
    width: 100%;
    height: 150px;
    background: var(--cream);
    border-radius: 2px;
}

.column-fill {
    width: 100%;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
}

.column-label {
    color: var(--muted);
    font-size: .68rem;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
}

@media (max-width: 1050px) {
    .donut {
        grid-template-columns: 140px minmax(0, 1fr);
        gap: 16px;
    }
}

@media (max-width: 760px) {
    /* Die Werkzeugleiste steht hier untereinander. Die Flex-Basis der Auswahlfelder
       waere in dieser Richtung eine Hoehe und wuerde die Felder auseinanderziehen. */
    .stats-toolbar > label {
        flex: 0 0 auto;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .chart-card {
        padding: 20px 18px;
    }

    .donut {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .donut svg {
        max-width: 190px;
    }

    .chart-legend {
        width: 100%;
    }

    .bar-list li {
        grid-template-columns: minmax(70px, 1fr) minmax(0, 1.4fr) auto;
        gap: 9px;
        font-size: .78rem;
    }

    /* Auf schmalen Geraeten wird die Saeulenreihe gescrollt, statt die Saeulen
       auf unlesbare Breiten zusammenzudruecken. */
    .column-chart li {
        flex: 0 0 42px;
    }
}
