:root {
    color-scheme: dark;
    --bg: #0b0d12;
    --bg-soft: #141822;
    --bg-softer: #0f1218;
    --bg-glass: rgba(12, 16, 24, 0.82);
    --border: rgba(255, 255, 255, 0.08);
    --text: #f4f6ff;
    --text-muted: #a7b1c6;
    --accent: #00b4ff;
    --accent-strong: rgba(0, 180, 255, 0.45);
    --accent-soft: rgba(0, 180, 255, 0.16);
    --danger: #ff5470;
    --success: #4cd964;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --appbar-h: 68px;
    font-family: "system-ui", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

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

[data-debug="off"] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, rgba(0, 180, 255, 0.12), transparent 60%), var(--bg);
    color: var(--text);
}

body.modal-offen {
    overflow: hidden;
}

a {
    color: var(--accent);
}

a:focus-visible {
    outline: 2px dashed var(--accent);
    outline-offset: 3px;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
    background: var(--bg-soft);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.45rem 1rem;
    transition: border 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

button:hover,
input:hover,
select:hover,
textarea:hover {
    border-color: var(--accent);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 180, 255, 0.35);
}

button.primär {
    background: linear-gradient(135deg, var(--accent), #0081c7);
    border: none;
    color: #03121b;
    font-weight: 600;
}

.meldung {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    background: rgba(0, 180, 255, 0.14);
    color: var(--text);
    margin: 0.5rem 1rem;
}

.meldung.fehler {
    background: rgba(255, 84, 112, 0.18);
    color: #ffd7df;
}

.meldung.info {
    background: rgba(0, 180, 255, 0.25);
    color: #d7f4ff;
}

.app {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: var(--appbar-h) 1fr;
    grid-template-areas:
        "header header"
        "sidebar main";
    height: 100dvh;
    overflow: hidden;
}

.appbar {
    grid-area: header;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1.5rem;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.appbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.appbar__logo {
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.25rem 0.5rem;
}

.appbar__titel {
    font-size: 1.2rem;
    font-weight: 600;
}

.appbar__rolle {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.75rem;
    border-radius: 999px;
    background: rgba(0, 180, 255, 0.14);
    color: #8fe1ff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.appbar__verbindung {
    font-size: 0.8rem;
    color: #b8e3ff;
    background: rgba(0, 180, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.appbar__mitte {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: min(520px, 100%);
    margin: 0 auto;
}

.header-search {
    position: relative;
    width: 100%;
}

.header-search__eingabe {
    width: 100%;
    padding-right: 2.5rem;
}

.header-search__liste {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-soft);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    padding: 0.35rem 0;
    z-index: 220;
}

.header-search__liste[hidden] {
    display: none;
}

.header-search__option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    transition: background 120ms ease;
}

.header-search__option[aria-selected="true"],
.header-search__option:hover {
    background: rgba(0, 180, 255, 0.18);
}

.header-search__icon {
    font-size: 1.1rem;
}

.header-search__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.header-search__name {
    font-weight: 600;
}

.header-search__pfad {
    font-size: 0.8rem;
    color: var(--text-muted);
    word-break: break-all;
}

.header-search__leer {
    padding: 0.75rem 0.85rem;
    color: var(--text-muted);
}

.header-right {
    position: relative;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.4rem 0.55rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(0, 180, 255, 0.14);
    color: inherit;
    font-size: 1rem;
    cursor: pointer;
}

.icon-btn:hover {
    border-color: var(--accent);
}

#sidebarToggle {
    display: none;
}

.popover,
.menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(420px, 90vw);
    max-height: min(60vh, 520px);
    overflow: auto;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-soft);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    z-index: 200;
}

.popover[hidden],
.menu[hidden] {
    display: none !important;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    cursor: pointer;
}

.user-chip:hover,
.user-chip:focus-visible {
    border-color: var(--accent);
}

.menu button,
.menu a {
    display: flex;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.menu button:hover,
.menu a:hover {
    background: rgba(0, 180, 255, 0.12);
}

.menu hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 6px 0;
}

.stats-panel__grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.stats-panel__kachel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
}

.stats-panel__kachel span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stats-panel__kachel strong {
    font-variant-numeric: tabular-nums;
}

.stats-panel__status {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stats-panel__status.fehler {
    color: #ffd7df;
}

.app__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 250;
    pointer-events: none;
    opacity: 0;
    transition: opacity 160ms ease;
}

.app__overlay[hidden] {
    display: none;
}

.app__overlay[data-visible="true"] {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    grid-area: sidebar;
    width: 280px;
    min-width: 240px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: var(--bg-softer);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 0;
    overflow: hidden;
    position: relative;
    z-index: 40;
}

.sidebar__inhalt {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.menu-item:hover,
.menu-item:focus-visible {
    border-color: rgba(0, 180, 255, 0.25);
    outline: none;
}

.menu-item.strong {
    font-weight: 600;
    background: rgba(0, 180, 255, 0.12);
}

.panel-cta {
    margin-top: 24px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.sidebar__menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: auto;
    padding-right: 4px;
}

.sidebar__menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: inherit;
    text-align: left;
}

.sidebar__menu-item:hover {
    border-color: rgba(0, 180, 255, 0.25);
}

.sidebar__menu-item.is-active {
    border-color: rgba(42, 214, 255, 0.35);
    background: rgba(0, 180, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(0, 180, 255, 0.15) inset;
}

.sidebar__menu-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.sidebar__panels {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.upload-box {
    border: 2px dashed rgba(0, 180, 255, 0.35);
    border-radius: 18px;
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1rem;
    transition: border 150ms ease;
}

.upload-box.aktiv {
    border-color: var(--accent);
}

.admin-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-panel[hidden] {
    display: none;
}

.admin-panel__kopf {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.admin-panel__inhalt {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    overflow: auto;
}

.admin-tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.admin-tabelle th,
.admin-tabelle td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-tabelle tr:hover {
    background: rgba(0, 180, 255, 0.08);
}

.ordner-baum ul {
    list-style: none;
    padding-left: 1rem;
}

.ordner-baum li::before {
    content: '▸';
    margin-right: 0.5rem;
    color: var(--accent);
}


.content {
    grid-area: main;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
    background: rgba(20, 24, 34, 0.6);
    backdrop-filter: blur(6px);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    padding: 0 1.5rem;
    margin: 0.5rem 0 0.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breadcrumbs--header {
    justify-content: flex-start;
    margin: 0;
    padding: 0;
}

.link-button {
    background: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    color: #9fe6ff;
    border-radius: 8px;
}

.link-button:hover {
    background: rgba(0, 180, 255, 0.12);
}

.haupt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(20, 24, 34, 0.7);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 30;
}

.toolbar__links,
.toolbar__rechts {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}


.datei-liste {
    flex: 1;
    overflow: auto;
    padding: 1rem 1.5rem;
}

.datei-tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.datei-tabelle thead {
    background: rgba(255, 255, 255, 0.04);
}

.datei-tabelle th,
.datei-tabelle td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.col-checkbox {
    width: 40px;
}

.datei-tabelle tbody tr {
    transition: background 120ms ease, outline 120ms ease;
}

.datei-tabelle tbody tr:hover {
    background: rgba(0, 180, 255, 0.08);
}

.datei-tabelle tbody tr.selected {
    background: rgba(0, 180, 255, 0.10);
    outline: 2px solid var(--accent-strong);
    outline-offset: -2px;
}

.datei-tabelle tbody tr:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.kontextmenü {
    position: fixed;
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border);
    z-index: 210;
    max-height: calc(100dvh - 16px);
    overflow: auto;
}

.kontextmenü button {
    background: transparent;
    border: none;
    text-align: left;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    color: inherit;
}

.kontextmenü button:hover {
    background: rgba(0, 180, 255, 0.16);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 300;
}

.modal-overlay > .modal {
    background: var(--bg-soft);
    border-radius: var(--radius-lg);
    width: min(640px, 100%);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.modal-overlay > .modal.modal--groß {
    width: min(860px, 100%);
}

.modal-overlay > .modal header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal__close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
}

.modal__content {
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal__aktionen {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

#modal.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 300;
}

#modal[hidden] {
    display: none !important;
}

#modal .modal__dialog {
    width: min(920px, 96vw);
    max-height: 90vh;
    overflow: auto;
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

#modal .modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#modal .modal__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-container img,
.preview-container embed {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 16px;
}

.code-editor {
    width: 100%;
    min-height: 320px;
    background: #07090e;
    border-radius: 16px;
    padding: 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    border: 1px solid rgba(0, 180, 255, 0.25);
}

.logout-hinweis {
    display: none !important;
}

.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 350;
    pointer-events: none;
}

.toast {
    min-width: 240px;
    max-width: 360px;
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.75rem 1rem;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 160ms ease, transform 160ms ease;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast--sichtbar {
    opacity: 1;
    transform: translateY(0);
}

.toast--info {
    border-left: 3px solid rgba(0, 180, 255, 0.65);
}

.toast--fehler {
    border-left: 3px solid rgba(255, 84, 112, 0.8);
}

.toast__button {
    align-self: flex-start;
    border-radius: var(--radius-sm);
    border: none;
    background: rgba(0, 180, 255, 0.2);
    color: var(--text);
    padding: 0.35rem 0.9rem;
    cursor: pointer;
}

.toast__button:hover {
    background: rgba(0, 180, 255, 0.35);
}

.audit-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.audit-liste {
    max-height: 360px;
    overflow: auto;
}

.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.auth-card {
    width: min(100%, 720px);
    background: rgba(11, 13, 18, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: 0 32px 60px rgba(0, 0, 0, 0.35);
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-card__header {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-card__header h1 {
    margin: 0;
    font-size: 1.75rem;
}

.auth-card__subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-card__content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-section h2 {
    margin: 0;
    font-size: 1.1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid--zweispaltig {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.auth-card__actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.auth-hinweis {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.checkliste {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkliste__eintrag {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    align-items: flex-start;
}

.checkliste__eintrag--ok {
    border-color: rgba(76, 217, 100, 0.4);
}

.checkliste__eintrag--warnung {
    border-color: rgba(255, 84, 112, 0.45);
}

.checkliste__status {
    font-size: 1.2rem;
    line-height: 1;
}

.checkliste__text p {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.system-health {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.system-health__intro {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.system-health__status {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(0, 180, 255, 0.16);
    border: 1px solid rgba(0, 180, 255, 0.3);
    font-size: 0.9rem;
}

.system-health__status--error {
    background: rgba(255, 84, 112, 0.22);
    border-color: rgba(255, 84, 112, 0.4);
    color: #ffd7df;
}

.system-health__liste {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
}

.system-health__methode {
    margin: 0;
    font-weight: 600;
    color: var(--text-muted);
}

.system-health__wert {
    margin: 0;
    font-size: 0.9rem;
}

.system-health__wert--ok {
    color: var(--success);
}

.system-health__wert--warn {
    color: #ffd7df;
}

.system-health__wert--error {
    color: #ff6b7a;
    font-weight: 600;
}

.system-health__aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.system-health__fs {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.system-health__fs-status {
    font-size: 0.9rem;
}

.system-health__fs-ergebnis {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.fs-selftest__info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.fs-selftest__meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 0.75rem;
    margin: 0;
}

.fs-selftest__meta dt {
    font-weight: 600;
}

.fs-selftest__meta dd {
    margin: 0;
}

.fs-selftest__tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.fs-selftest__tabelle th,
.fs-selftest__tabelle td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.fs-selftest__tabelle td:first-child {
    font-family: 'Fira Code', 'Courier New', monospace;
}

.fs-selftest__row--warn {
    background: rgba(255, 84, 112, 0.16);
}

@media (max-width: 720px) {
    .auth-card {
        padding: 1.75rem;
    }
}

@media (max-width: 560px) {
    .auth-card {
        padding: 1.5rem;
    }

    .form-grid--zweispaltig {
        grid-template-columns: 1fr;
    }

    .auth-card__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-card__actions button {
        width: 100%;
    }
}

.sitzungs-liste,
.token-liste,
.share-inhalt {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sitzungs-zeile {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 0.75rem 1rem;
}

.share-formular {
    display: grid;
    gap: 0.75rem;
}

.struktur-formular {
    display: grid;
    gap: 0.75rem;
}

.struktur-vorschau {
    max-height: 240px;
    overflow: auto;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
}

.hinweis {
    padding: 0.75rem 1rem;
    background: rgba(0, 180, 255, 0.08);
    border-radius: 12px;
}

.struktur-vorschau ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.struktur-vorschau li {
    padding: 0.25rem 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (max-width: 1024px) {
    .app {
        grid-template-columns: 260px 1fr;
    }

    .sidebar {
        width: 260px;
    }

    #statsPanel {
        width: min(360px, 90vw);
    }
}

@media (max-width: 768px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: var(--appbar-h);
        left: 0;
        height: calc(100dvh - var(--appbar-h));
        transform: translateX(-100%);
        transition: transform 180ms ease;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: none;
        z-index: 55;
    }

    body.sidebar-offen .sidebar {
        transform: translateX(0);
    }

    #sidebarToggle {
        display: inline-flex;
    }

    .haupt-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 540px) {
    #statsPanel {
        right: 8px;
        left: 8px;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

.panel--zentriert {
    max-width: 360px;
    margin: 4rem auto;
}

.panel--freigabe {
    max-width: 720px;
    margin: 4rem auto;
}

.share-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
    align-items: center;
}

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

.share-table th,
.share-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.5rem;
    text-align: left;
}

.share-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.share-table .is-right {
    text-align: right;
}
