:root {
    --bg: #f3f6fa;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-blue: #edf5ff;
    --text: #152235;
    --muted: #66758a;
    --muted-strong: #435268;
    --line: #dce3ec;
    --line-strong: #c8d2df;
    --navy: #12243a;
    --navy-soft: #203650;
    --blue: #2474e5;
    --blue-dark: #185fbe;
    --blue-light: #d9eaff;
    --red: #c93642;
    --red-dark: #a52631;
    --red-soft: #fff0f1;
    --green: #19794b;
    --green-soft: #eaf8f0;
    --amber: #9a6500;
    --amber-soft: #fff7df;
    --shadow-sm: 0 1px 2px rgba(17, 36, 58, 0.05), 0 4px 14px rgba(17, 36, 58, 0.04);
    --shadow-md: 0 18px 50px rgba(17, 36, 58, 0.15);
    --radius-sm: 8px;
    --radius: 13px;
    --radius-lg: 20px;
    --topbar-height: 68px;
    --sidebar-width: 268px;
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-size: 16px;
    line-height: 1.5;
}

button, input, select {
    font: inherit;
}

button, a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(36, 116, 229, 0.28);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

svg {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

h1 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.65rem, 3vw, 2.2rem);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

h2 {
    margin-bottom: 0.25rem;
    font-size: 1.18rem;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.eyebrow {
    margin-bottom: 0.35rem;
    color: var(--blue-dark);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.68rem 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:active:not(:disabled) {
    transform: translateY(0);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.button svg {
    width: 1.1rem;
    height: 1.1rem;
}

.button-primary {
    color: #fff;
    background: var(--blue);
    box-shadow: 0 6px 16px rgba(36, 116, 229, 0.18);
}

.button-primary:hover:not(:disabled) {
    background: var(--blue-dark);
    box-shadow: 0 8px 20px rgba(36, 116, 229, 0.24);
}

.button-secondary {
    color: var(--text);
    border-color: var(--line-strong);
    background: var(--surface);
}

.button-secondary:hover:not(:disabled) {
    border-color: #a9b7c7;
    background: var(--surface-soft);
}

.button-danger {
    color: #fff;
    background: var(--red);
}

.button-danger:hover:not(:disabled) {
    background: var(--red-dark);
}

.button-danger-quiet {
    color: var(--red);
    border-color: #f0c5c9;
    background: var(--red-soft);
}

.button-wide {
    width: 100%;
}

.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
}

.icon-button:hover {
    background: var(--surface-soft);
}

.field {
    display: grid;
    gap: 0.42rem;
}

.field > span {
    color: var(--muted-strong);
    font-size: 0.9rem;
    font-weight: 700;
}

.field small {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.field-grow {
    flex: 1 1 200px;
}

input, select {
    width: 100%;
    min-height: 46px;
    padding: 0.7rem 0.82rem;
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--surface);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:hover, select:hover {
    border-color: #9faec0;
}

input:focus, select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36, 116, 229, 0.12);
    outline: none;
}

.alert {
    margin: 1rem 0;
    padding: 0.78rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 650;
}

.alert-error {
    color: #8c202a;
    border: 1px solid #f1c3c7;
    background: var(--red-soft);
}

/* Anmeldung und Ersteinrichtung */
.auth-page {
    background:
        radial-gradient(circle at 12% 10%, rgba(36, 116, 229, 0.12), transparent 30rem),
        radial-gradient(circle at 90% 86%, rgba(18, 36, 58, 0.09), transparent 34rem),
        #f5f8fc;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: min(100%, 480px);
    padding: clamp(1.55rem, 5vw, 2.4rem);
    border: 1px solid rgba(200, 210, 223, 0.86);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 28px 80px rgba(18, 36, 58, 0.14);
}

.brand-mark {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    margin-bottom: 1.35rem;
    color: #fff;
    border-radius: 16px;
    background: linear-gradient(145deg, #2d82ef, #185fbe);
    box-shadow: 0 12px 26px rgba(36, 116, 229, 0.24);
}

.brand-mark svg {
    width: 30px;
    height: 30px;
    stroke-width: 1.5;
}

.auth-intro {
    margin-bottom: 1.5rem;
    color: var(--muted);
}

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

/* App-Rahmen */
.app-page {
    overflow: hidden;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    position: fixed;
    z-index: 50;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    height: var(--topbar-height);
    align-items: center;
    padding: 0 1.25rem;
    color: #fff;
    background: var(--navy);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.015em;
    text-decoration: none;
}

.brand-mark-small {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    margin: 0;
    border-radius: 10px;
    box-shadow: none;
}

.brand-mark-small svg {
    width: 21px;
    height: 21px;
}

.mobile-menu-button {
    display: none;
    margin-right: 0.45rem;
    color: #fff;
}

.mobile-menu-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.topbar-account {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
    color: #d9e2ed;
    font-size: 0.9rem;
    font-weight: 650;
}

.account-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: var(--navy-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.sidebar {
    position: fixed;
    z-index: 40;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    padding: 1.1rem 0.8rem 0.8rem;
    border-right: 1px solid var(--line);
    background: var(--surface);
}

.main-nav {
    display: grid;
    gap: 0.25rem;
}

.nav-item,
.tree-root,
.tree-button {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    gap: 0.72rem;
    padding: 0.58rem 0.72rem;
    color: var(--muted-strong);
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    background: transparent;
    text-align: left;
    font-size: 0.92rem;
    font-weight: 680;
}

.nav-item:hover,
.tree-root:hover,
.tree-button:hover {
    color: var(--text);
    background: var(--surface-soft);
}

.nav-item.is-active {
    color: #145ebd;
    background: var(--surface-blue);
}

.nav-item svg,
.tree-root svg,
.tree-button svg {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 1.15rem;
}

.nav-count {
    min-width: 1.45rem;
    margin-left: auto;
    padding: 0.08rem 0.38rem;
    color: #fff;
    border-radius: 999px;
    background: var(--red);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
}

.nav-count-shares {
    background: var(--blue);
}

.folder-tree-section {
    min-height: 0;
    flex: 1 1 auto;
    margin-top: 1.3rem;
    overflow-y: auto;
}

.sidebar-label {
    padding: 0 0.72rem 0.45rem;
    color: #8a97a8;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.tree-root,
.tree-button {
    min-height: 36px;
    gap: 0.5rem;
    padding-top: 0.38rem;
    padding-bottom: 0.38rem;
    font-size: 0.84rem;
    font-weight: 600;
}

.tree-root.is-current,
.tree-button.is-current {
    color: var(--blue-dark);
    background: var(--surface-blue);
}

.tree-level {
    display: grid;
}

.tree-level .tree-level {
    margin-left: 0.78rem;
    padding-left: 0.22rem;
    border-left: 1px solid #e6ebf1;
}

.tree-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-footer {
    flex: 0 0 auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.sidebar-version {
    padding: 0 0.8rem 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.02em;
}

.sidebar-overlay {
    position: fixed;
    z-index: 35;
    inset: var(--topbar-height) 0 0;
    background: rgba(12, 27, 44, 0.4);
    backdrop-filter: blur(2px);
}

.workspace {
    height: 100vh;
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    overflow: auto;
}

.view-panel {
    width: min(100%, 1500px);
    min-height: calc(100vh - var(--topbar-height));
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2.2rem);
}

.view-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.2rem;
    margin-bottom: 1.25rem;
}

.files-heading {
    align-items: center;
}

.view-heading h1 {
    margin: 0;
}

.view-description {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.toolbar {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.breadcrumbs {
    display: flex;
    min-height: 35px;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.28rem;
}

.breadcrumb-button {
    max-width: 280px;
    padding: 0.18rem 0.3rem;
    overflow: hidden;
    color: var(--muted-strong);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    font-weight: 760;
    letter-spacing: -0.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb-button:hover {
    color: var(--blue-dark);
    background: var(--surface-blue);
}

.breadcrumb-separator {
    color: #a0adbd;
    font-size: 1.4rem;
}

.folder-protection-button {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 0.42rem;
    margin-top: 0.28rem;
    padding: 0.28rem 0.62rem;
    color: var(--green);
    border: 1px solid #bfe4cf;
    border-radius: 999px;
    cursor: pointer;
    background: var(--green-soft);
    font-size: 0.76rem;
    font-weight: 780;
}

.folder-protection-button:hover {
    border-color: #8fceb0;
    background: #dff4e8;
}

.folder-protection-button.is-off {
    color: var(--amber);
    border-color: #ead59d;
    background: var(--amber-soft);
}

.folder-protection-button.is-off:hover {
    border-color: #d8b95f;
    background: #fff0c3;
}

.folder-protection-button svg {
    width: 0.95rem;
    height: 0.95rem;
}

.dropzone {
    display: flex;
    width: 100%;
    min-height: 86px;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
    padding: 1rem;
    color: var(--muted-strong);
    border: 1.5px dashed #a9bfd8;
    border-radius: var(--radius);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.55);
    text-align: left;
    transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
    color: var(--blue-dark);
    border-color: var(--blue);
    background: var(--surface-blue);
}

.dropzone-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    color: var(--blue);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.dropzone strong,
.dropzone small {
    display: block;
}

.dropzone small {
    margin-top: 0.12rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.selection-bar {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.65rem 0.75rem 0.65rem 0.9rem;
    color: #174f8b;
    border: 1px solid #bfd8f5;
    border-radius: var(--radius);
    background: #eaf4ff;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.selection-summary,
.selection-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.selection-summary {
    flex-wrap: wrap;
}

.selection-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.selection-actions .button {
    min-height: 38px;
    padding: 0.52rem 0.72rem;
    font-size: 0.84rem;
}

.selection-clear-button {
    padding: 0.25rem 0.15rem;
    color: var(--blue-dark);
    border: 0;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 700;
}

.selection-clear-button:hover {
    border-bottom-color: currentColor;
}

.selection-clear-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.selection-summary-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #fff;
    border-radius: 10px;
    background: var(--blue);
}

.selection-summary-icon svg {
    width: 18px;
    height: 18px;
}

.content-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.file-card {
    overflow: hidden;
}

.file-list-header,
.file-row {
    display: grid;
    grid-template-columns: 34px minmax(240px, 1fr) 105px 175px 46px;
    align-items: center;
    gap: 0.75rem;
}

.file-list-header {
    min-height: 43px;
    padding: 0 1rem;
    color: #7b899b;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    font-size: 0.75rem;
    font-weight: 780;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.file-row {
    min-height: 68px;
    padding: 0.58rem 1rem;
    border-bottom: 1px solid #edf0f4;
    transition: background-color 120ms ease;
}

.file-row:last-child {
    border-bottom: 0;
}

.file-row:hover {
    background: #f9fbfd;
}

.file-row.is-selected,
.file-row.is-selected:hover {
    background: #eef6ff;
}

.selection-cell {
    display: grid;
    min-width: 28px;
    min-height: 38px;
    place-items: center;
    cursor: pointer;
}

.selection-cell input {
    width: 19px;
    height: 19px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--blue);
}

.selection-header {
    min-height: 32px;
}

.file-name-button {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    overflow: hidden;
    color: var(--text);
    border: 0;
    cursor: pointer;
    background: transparent;
    text-align: left;
    font-weight: 700;
}

.file-name-button:hover .file-name-text {
    color: var(--blue-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.file-name-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-icon,
.file-thumbnail {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    overflow: hidden;
    color: var(--blue-dark);
    border-radius: 9px;
    background: var(--surface-blue);
}

.file-icon.folder {
    color: #a66305;
    background: #fff4dc;
}

.file-icon svg {
    width: 22px;
    height: 22px;
}

.file-icon .extension-label {
    font-size: 0.64rem;
    font-weight: 850;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-meta {
    color: var(--muted);
    font-size: 0.84rem;
}

.more-button {
    color: var(--muted-strong);
}

.more-button:hover {
    color: var(--text);
    background: #eaf0f7;
}

.loading-state,
.empty-state,
.error-state {
    display: flex;
    min-height: 220px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.65rem;
    padding: 2rem;
    color: var(--muted);
    text-align: center;
}

.empty-state-icon {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    color: #8493a7;
    border-radius: 16px;
    background: var(--surface-soft);
}

.empty-state strong,
.error-state strong {
    color: var(--muted-strong);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #dce6f2;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

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

/* Papierkorb */
.trash-row {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(160px, 0.8fr) 110px auto;
    align-items: center;
    gap: 1rem;
    min-height: 76px;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #edf0f4;
}

.trash-row:last-child {
    border-bottom: 0;
}

.trash-name {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.72rem;
    font-weight: 700;
}

.trash-name > span:last-child,
.trash-path {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trash-path,
.trash-time {
    color: var(--muted);
    font-size: 0.82rem;
}

.trash-origin {
    display: grid;
    gap: 0.08rem;
}

.trash-origin-label {
    color: #8a97a8;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.trash-origin-path {
    min-width: 0;
    overflow: hidden;
    color: var(--muted-strong);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trash-actions {
    display: flex;
    gap: 0.5rem;
}

.trash-actions .button {
    min-height: 38px;
    padding: 0.48rem 0.7rem;
    font-size: 0.82rem;
}

/* Einstellungen */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.settings-card {
    padding: clamp(1.1rem, 2.2vw, 1.45rem);
}

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

.card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.card-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.extension-tags {
    display: flex;
    min-height: 46px;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.45rem;
}

.extension-tag {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.38rem 0.35rem 0.62rem;
    color: #24547f;
    border: 1px solid #c7dcf3;
    border-radius: 999px;
    background: #eef6ff;
    font-size: 0.8rem;
    font-weight: 750;
}

.extension-remove {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    padding: 0;
    color: #547493;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    font-size: 1rem;
    line-height: 1;
}

.extension-remove:hover {
    color: #fff;
    background: var(--red);
}

.extension-add-row {
    display: flex;
    align-items: flex-end;
    gap: 0.65rem;
}

.security-note {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    padding: 0.72rem 0.8rem;
    color: #356047;
    border-radius: 9px;
    background: var(--green-soft);
    font-size: 0.8rem;
}

.security-note svg {
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 1.1rem;
    margin-top: 0.05rem;
}

.status-list {
    display: grid;
    margin: 0;
}

.server-card .status-list {
    margin-top: 1.1rem;
    padding-top: 0.3rem;
    border-top: 1px solid var(--line);
}

.status-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #edf0f4;
}

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

.status-list dt {
    color: var(--muted);
    font-size: 0.86rem;
}

.status-list dd {
    margin: 0;
    font-weight: 750;
}

/* Dialoge */
.dialog {
    width: min(calc(100% - 2rem), 500px);
    max-height: calc(100vh - 2rem);
    margin: auto;
    padding: 1.3rem;
    overflow: auto;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.dialog::backdrop {
    background: rgba(12, 27, 44, 0.55);
    backdrop-filter: blur(3px);
}

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

.dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dialog-heading h2 {
    margin: 0;
    overflow-wrap: anywhere;
}

.dialog-close {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    color: var(--muted);
    font-size: 1.6rem;
    font-weight: 300;
    line-height: 1;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.dialog-description {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.zip-note {
    margin: 0;
    padding: 0.75rem 0.8rem;
    color: var(--muted-strong);
    border-radius: 9px;
    background: var(--surface-soft);
    font-size: 0.82rem;
}

.protection-dialog {
    width: min(calc(100% - 2rem), 620px);
}

.protection-options {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.protection-options legend {
    margin-bottom: 0.55rem;
    color: var(--muted-strong);
    font-size: 0.86rem;
    font-weight: 760;
}

.protection-option,
.check-option {
    display: flex;
    align-items: flex-start;
    gap: 0.72rem;
    padding: 0.75rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    background: var(--surface-soft);
}

.protection-option:hover,
.check-option:hover {
    border-color: #a9bfd8;
    background: var(--surface-blue);
}

.protection-option:has(input:checked),
.check-option:has(input:checked) {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(36, 116, 229, 0.1);
    background: var(--surface-blue);
}

.protection-option input,
.check-option input {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0.12rem 0 0;
    padding: 0;
    accent-color: var(--blue);
}

.protection-option > span,
.check-option > span {
    display: grid;
    min-width: 0;
    gap: 0.12rem;
}

.protection-option strong,
.check-option strong {
    color: var(--text);
    font-size: 0.88rem;
}

.protection-option small,
.check-option small {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.batch-rename-dialog {
    width: min(calc(100% - 2rem), 620px);
}

.batch-rename-preview {
    display: grid;
    max-height: 250px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.batch-rename-preview-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0.52rem 0.7rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.82rem;
}

.batch-rename-preview-row:last-child {
    border-bottom: 0;
}

.batch-rename-preview-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-rename-preview-name:last-child {
    color: var(--blue-dark);
    font-weight: 750;
}

.batch-rename-preview-arrow {
    color: var(--muted);
    text-align: center;
}

.batch-rename-preview-more,
.batch-rename-preview-empty {
    padding: 0.65rem 0.75rem;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}

.item-dialog-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
}

.item-dialog-title > span {
    flex: 0 0 auto;
}

.item-dialog-title > div {
    min-width: 0;
}

.action-list {
    display: grid;
    gap: 0.35rem;
}

.action-button {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    color: var(--muted-strong);
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    background: transparent;
    text-align: left;
    font-weight: 680;
}

.action-button:hover {
    color: var(--text);
    background: var(--surface-soft);
}

.action-button.danger {
    color: var(--red);
}

.action-button.danger:hover {
    background: var(--red-soft);
}

.confirm-dialog {
    text-align: center;
}

.confirm-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    margin: 0 auto 0.9rem;
    color: var(--red);
    border-radius: 16px;
    background: var(--red-soft);
    font-size: 1.4rem;
    font-weight: 850;
}

.confirm-dialog p {
    color: var(--muted);
}

.confirm-dialog .dialog-actions {
    justify-content: center;
}

.upload-dialog {
    width: min(calc(100% - 2rem), 620px);
}

.link-upload-dialog {
    width: min(calc(100% - 2rem), 620px);
}

.upload-queue {
    display: grid;
    gap: 0.65rem;
    max-height: 52vh;
    overflow: auto;
}

.upload-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.upload-row-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--blue-dark);
    border-radius: 9px;
    background: var(--surface-blue);
    font-size: 0.62rem;
    font-weight: 850;
    text-transform: uppercase;
}

.upload-row-main {
    min-width: 0;
}

.upload-row-name {
    overflow: hidden;
    font-size: 0.87rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-row-status {
    margin-top: 0.14rem;
    color: var(--muted);
    font-size: 0.74rem;
}

.upload-row-status.success {
    color: var(--green);
}

.upload-row-status.error {
    color: var(--red);
}

.upload-row progress {
    width: 100%;
    height: 5px;
    margin-top: 0.4rem;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: #dce5ef;
}

.upload-row progress::-webkit-progress-bar {
    border-radius: 999px;
    background: #dce5ef;
}

.upload-row progress::-webkit-progress-value {
    border-radius: 999px;
    background: var(--blue);
}

.upload-row progress::-moz-progress-bar {
    border-radius: 999px;
    background: var(--blue);
}

.upload-status-icon {
    color: var(--muted);
    font-weight: 800;
}

.upload-status-icon.success {
    color: var(--green);
}

.upload-status-icon.error {
    color: var(--red);
}

/* Meldungen */
.toast-region {
    position: fixed;
    z-index: 100;
    right: 1rem;
    bottom: 1rem;
    display: grid;
    width: min(calc(100% - 2rem), 390px);
    gap: 0.65rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.8rem 0.9rem;
    color: #fff;
    border-radius: 11px;
    background: var(--navy);
    box-shadow: 0 14px 38px rgba(12, 27, 44, 0.22);
    pointer-events: auto;
    animation: toast-in 180ms ease-out;
    font-size: 0.87rem;
    font-weight: 650;
}

.toast.error {
    background: #9f2832;
}

.clipboard-helper {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.toast.success {
    background: #176c43;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
    .selection-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .selection-actions {
        justify-content: flex-start;
    }

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

    .trash-row {
        grid-template-columns: minmax(190px, 1fr) minmax(140px, 0.7fr) auto;
    }

    .trash-time {
        display: none;
    }
}

@media (max-width: 820px) {
    :root {
        --topbar-height: 62px;
    }

    .app-page {
        overflow: auto;
    }

    .topbar {
        padding: 0 0.8rem;
    }

    .mobile-menu-button {
        display: inline-grid;
    }

    .topbar-account #topbar-username,
    .topbar-account > span:last-child {
        display: none;
    }

    .sidebar {
        width: min(86vw, 310px);
        transform: translateX(-105%);
        box-shadow: 12px 0 34px rgba(12, 27, 44, 0.12);
        transition: transform 180ms ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .workspace {
        height: auto;
        min-height: 100vh;
        margin-left: 0;
        overflow: visible;
    }

    .view-panel {
        padding: 1.15rem 0.9rem 2rem;
    }

    .view-heading,
    .files-heading {
        align-items: flex-start;
    }

    .file-list-header {
        grid-template-columns: 34px minmax(0, 1fr) 44px;
        padding: 0 0.75rem;
    }

    .file-list-header > :nth-child(3),
    .file-list-header > :nth-child(4) {
        display: none;
    }

    .file-row {
        grid-template-columns: 34px minmax(0, 1fr) 44px;
        min-height: 70px;
        padding: 0.65rem 0.75rem;
    }

    .file-row .file-meta {
        display: none;
    }

    .file-name-button {
        min-height: 48px;
    }

    .trash-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.5rem;
        padding: 0.9rem;
    }

    .trash-path {
        padding-left: 3.15rem;
    }

    .trash-actions {
        padding-left: 3.15rem;
    }
}

@media (max-width: 560px) {
    .topbar-brand > span:last-child {
        font-size: 0.94rem;
    }

    .account-avatar {
        width: 32px;
        height: 32px;
    }

    .view-heading,
    .files-heading {
        flex-direction: column;
    }

    .files-heading {
        gap: 0.8rem;
    }

    .toolbar {
        width: 100%;
    }

    .toolbar .button {
        flex: 1 1 50%;
        padding-right: 0.6rem;
        padding-left: 0.6rem;
    }

    .toolbar .link-upload-button {
        flex-basis: 100%;
    }

    .breadcrumb-button {
        max-width: 190px;
        font-size: 1.35rem;
    }

    .dropzone {
        justify-content: flex-start;
    }

    .selection-bar,
    .selection-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .selection-bar {
        padding: 0.8rem;
    }

    .selection-summary {
        justify-content: space-between;
    }

    .selection-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 0.5rem;
    }

    .selection-actions .button {
        width: 100%;
    }

    .selection-actions #create-zip-button {
        grid-column: 1 / -1;
    }

    .extension-add-row {
        align-items: stretch;
        flex-direction: column;
    }

    .dialog {
        width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
        padding: 1rem;
        border-radius: 16px;
    }

    .dialog-actions {
        flex-direction: column-reverse;
    }

    .dialog-actions .button {
        width: 100%;
    }

    .confirm-dialog .dialog-actions {
        flex-direction: column-reverse;
    }

    .upload-row {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        padding: 0.62rem;
    }

    .upload-row-icon {
        width: 34px;
        height: 34px;
    }

    .toast-region {
        right: 0.5rem;
        bottom: 0.5rem;
        width: calc(100% - 1rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ordnerfreigaben */
.shares-overview-card {
    overflow: hidden;
}

.share-overview-header,
.share-overview-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 130px 145px 175px 46px;
    align-items: center;
    gap: 0.8rem;
}

.share-overview-header {
    min-height: 43px;
    padding: 0 1rem;
    color: #7b899b;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    font-size: 0.75rem;
    font-weight: 780;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.share-overview-row {
    min-height: 76px;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #edf0f4;
    transition: background-color 120ms ease;
}

.share-overview-row:last-child {
    border-bottom: 0;
}

.share-overview-row:hover {
    background: #f9fbfd;
}

.share-overview-row.is-unavailable {
    background: #fffdfa;
}

.share-overview-folder {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
}

.share-overview-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    color: #a66305;
    border-radius: 9px;
    background: #fff4dc;
}

.share-overview-icon svg {
    width: 22px;
    height: 22px;
}

.is-unavailable .share-overview-icon {
    color: #8d795b;
    background: #f4efe7;
}

.share-overview-folder-details {
    display: grid;
    min-width: 0;
    gap: 0.08rem;
}

.share-overview-name {
    max-width: 100%;
    justify-self: start;
    padding: 0;
    overflow: hidden;
    color: var(--text);
    border: 0;
    cursor: pointer;
    background: transparent;
    font-weight: 740;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-overview-name:hover:not(:disabled) {
    color: var(--blue-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.share-overview-name:disabled {
    cursor: default;
    opacity: 0.68;
}

.share-overview-path,
.share-overview-updated {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-overview-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.share-overview-link-badge,
.share-overview-status {
    display: inline-flex;
    width: fit-content;
    min-height: 26px;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.share-overview-link-badge.is-view {
    color: var(--blue-dark);
    background: var(--surface-blue);
}

.share-overview-link-badge.is-team {
    color: var(--green);
    background: var(--green-soft);
}

.share-overview-status {
    color: var(--green);
    background: var(--green-soft);
}

.share-overview-status.is-unavailable {
    color: var(--amber);
    background: var(--amber-soft);
}

.share-overview-more {
    justify-self: end;
}

.share-mode-badge {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
    padding: 0.35rem 0.7rem;
    color: #dce9f8;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    font-weight: 760;
}

.share-mode-badge.is-team {
    color: #e8fff2;
    border-color: rgba(118, 224, 165, 0.28);
    background: rgba(34, 139, 86, 0.2);
}

.share-mode-badge svg {
    width: 1rem;
    height: 1rem;
}

.share-tree-section {
    margin-top: 0;
}

.share-access-note {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-top: 0.8rem;
    padding: 0.75rem;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    font-size: 0.78rem;
    line-height: 1.45;
}

.share-access-note svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    margin-top: 0.1rem;
    color: var(--green);
}

.file-list-header.share-readonly-row,
.file-row.share-readonly-row {
    grid-template-columns: minmax(240px, 1fr) 105px 175px 46px;
}

.share-dialog {
    width: min(calc(100% - 2rem), 720px);
}

.share-dialog-content {
    display: grid;
    gap: 0.85rem;
}

.share-loading {
    min-height: 180px;
}

.share-security-note {
    margin: 0;
    padding: 0.72rem 0.8rem;
    color: #356047;
    border-radius: 9px;
    background: var(--green-soft);
    font-size: 0.82rem;
}

.share-unavailable-note {
    margin: 0;
    padding: 0.72rem 0.8rem;
    color: #76551b;
    border: 1px solid #f0dca5;
    border-radius: 9px;
    background: var(--amber-soft);
    font-size: 0.82rem;
}

.share-empty-state {
    display: grid;
    justify-items: start;
    gap: 0.55rem;
    padding: 1.15rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.share-empty-state p {
    margin: 0 0 0.35rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.share-link-card {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 12px;
    background: var(--surface);
}

.share-link-card.is-team {
    border-left-color: var(--green);
}

.share-link-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.share-link-heading h3 {
    margin: 0;
    font-size: 1rem;
}

.share-link-badge {
    padding: 0.2rem 0.55rem;
    color: var(--blue-dark);
    border-radius: 999px;
    background: var(--surface-blue);
    font-size: 0.72rem;
    font-weight: 800;
}

.is-team .share-link-badge {
    color: var(--green);
    background: var(--green-soft);
}

.share-link-card > p {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.share-link-row {
    display: flex;
    gap: 0.55rem;
}

.share-link-row input {
    min-width: 0;
    color: var(--muted-strong);
    background: var(--surface-soft);
    font-size: 0.82rem;
}

.share-renew-button {
    justify-self: start;
    padding: 0.2rem 0;
    color: var(--blue-dark);
    border: 0;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 750;
}

.share-renew-button:hover {
    border-bottom-color: currentColor;
}

.share-stop-button {
    justify-self: start;
    margin-top: 0.2rem;
}

.share-error-card {
    text-align: left;
}

@media (max-width: 1100px) {
    .share-overview-header,
    .share-overview-row {
        grid-template-columns: minmax(220px, 1fr) 120px 135px 46px;
    }

    .share-overview-header > :nth-child(4),
    .share-overview-row > :nth-child(4) {
        display: none;
    }
}

@media (max-width: 820px) {
    .share-overview-header,
    .share-overview-row {
        grid-template-columns: minmax(0, 1fr) 125px 44px;
    }

    .share-overview-header > :nth-child(2),
    .share-overview-header > :nth-child(4),
    .share-overview-row > :nth-child(2),
    .share-overview-row > :nth-child(4) {
        display: none;
    }

    .file-list-header.share-readonly-row,
    .file-row.share-readonly-row {
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    .file-list-header.share-readonly-row > :nth-child(2),
    .file-list-header.share-readonly-row > :nth-child(3) {
        display: none;
    }
}

@media (max-width: 560px) {
    .share-mode-badge {
        padding-right: 0.55rem;
        padding-left: 0.55rem;
        font-size: 0.75rem;
    }

    .share-link-row {
        align-items: stretch;
        flex-direction: column;
    }

    .share-link-row .button {
        width: 100%;
    }

    .selection-actions #share-create-zip {
        grid-column: 1 / -1;
    }
}
