/* SaintCity Sync – Weboberfläche. Dunkles Design als Standard, helles über [data-theme=light]. */
:root {
  --bg: #0b0d12; --bg-elev: #0f1219; --surface: #141821; --surface-2: #1a1f2b; --surface-3: #232a39;
  --border: #252b3a; --border-2: #323b4f;
  --text: #e8eaf0; --text-2: #b7bdcb; --muted: #8b94a9;
  --accent: #7c6cff; --accent-strong: #6a59f6; --accent-text: #a99fff; --accent-soft: rgba(124, 108, 255, .15); --accent-ring: rgba(124, 108, 255, .4);
  --on-accent: #fff;
  --danger: #f2566d; --danger-soft: rgba(242, 86, 109, .14);
  --success: #34c47f; --success-soft: rgba(52, 196, 127, .14);
  --warning: #f0a63a; --warning-soft: rgba(240, 166, 58, .15);
  --shadow: 0 16px 40px rgba(0, 0, 0, .45); --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --r: 12px; --r-sm: 8px; --r-lg: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --side: 252px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f9; --bg-elev: #fff; --surface: #fff; --surface-2: #f2f3f8; --surface-3: #e7e9f1;
  --border: #e1e4ec; --border-2: #cfd4e0;
  --text: #161922; --text-2: #3c4252; --muted: #5f6779;
  --accent: #6a59f6; --accent-strong: #5a48ea; --accent-text: #4f3de0; --accent-soft: rgba(106, 89, 246, .1); --accent-ring: rgba(106, 89, 246, .3);
  --danger: #d4304e; --danger-soft: rgba(212, 48, 78, .1);
  --success: #128a55; --success-soft: rgba(18, 138, 85, .1);
  --warning: #a8670a; --warning-soft: rgba(192, 122, 12, .12);
  --shadow: 0 16px 40px rgba(20, 24, 40, .14); --shadow-sm: 0 1px 2px rgba(20, 24, 40, .06);
  color-scheme: light;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-ring); }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.block { display: block; }
.wrap { overflow-wrap: anywhere; }
.noscript { padding: 24px; text-align: center; }
.boot { min-height: 100vh; display: grid; place-items: center; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg-elev); border-right: 1px solid var(--border); padding: 16px 12px 12px; overflow-y: auto; z-index: 40; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px; color: var(--text); font-weight: 700; font-size: 15.5px; }
.brand:hover, .top-brand:hover, .me:hover, .nav-link:hover, .quick-card:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.sidebar .side-close { display: none; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 18px 10px 6px; }
.nav-section:first-child { padding-top: 4px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-foot { display: flex; align-items: center; gap: 2px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px 8px; border-radius: var(--r-sm); color: var(--text); }
.me:hover { background: var(--surface-2); }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.me-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { font-size: 12px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; flex: none; }
.avatar.lg { width: 60px; height: 60px; font-size: 24px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.top-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.top-brand img { border-radius: 6px; }
.top-spacer { flex: 1; }
.view { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 32px 72px; outline: none; }
.backdrop { display: none; }
@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); visibility: hidden; }
  .nav-open .sidebar { transform: none; visibility: visible; }
  .sidebar .side-close { display: inline-grid; }
  .backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(5, 7, 12, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .nav-open .backdrop { opacity: 1; pointer-events: auto; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; height: 56px; padding: 0 10px; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
  .view { padding: 20px 16px 64px; }
}

/* ---------- Seitenkopf, Karten, Werkzeugleisten ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { font-size: 24px; letter-spacing: -.01em; }
.page-head p { margin-top: 4px; color: var(--muted); max-width: 680px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.card.pad { padding: 20px; }
.card + .card, .card + .notice, .notice + .card, .notice + .notice { margin-top: 16px; }
.card-title { font-size: 16px; margin-bottom: 4px; }
.card-sub { color: var(--muted); margin-bottom: 16px; }
.card.pad > .card-title + .form { margin-top: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 28px 0 12px; }
.section-title { font-size: 15px; margin: 28px 0 12px; }
.section-head .section-title { margin: 0; }
.search { position: relative; flex: 0 1 320px; min-width: 200px; }
.search > .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 34px; }
.toolbar .search { flex: 1 1 280px; max-width: 420px; }

/* ---------- Buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-weight: 550; font-size: 14px; line-height: 1; cursor: pointer; white-space: nowrap; user-select: none; text-decoration: none; transition: background .15s, border-color .15s, color .15s, filter .15s; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent-strong); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent); }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn.danger-ghost { background: transparent; color: var(--danger); }
.btn.danger-ghost:hover:not(:disabled) { background: var(--danger-soft); border-color: transparent; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn.sm .ico { width: 16px; height: 16px; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 38px; padding: 0; }
.btn.sm.icon-only { width: 32px; }
.btn.busy > * { visibility: hidden; }
.btn.busy { color: transparent; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: transparent; animation: spin .7s linear infinite; }
.btn.primary.busy::after, .btn.danger.busy::after { border-color: rgba(255, 255, 255, .85); border-top-color: transparent; }
.btn.flash-ok { border-color: var(--success); }
.btn.flash-err { border-color: var(--danger); }
.btn.preset.on { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .ico { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .btn.collapse { width: 38px; padding: 0; }
  .btn.collapse .lbl { display: none; }
}

/* ---------- Formulare ---------- */
.input { width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--bg); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--muted); opacity: .85; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input[readonly] { background: var(--surface-2); }
.input:disabled { opacity: .6; }
.input.sm { height: 32px; font-size: 13px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b94a9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
select.input.sm { padding-right: 30px; min-width: 132px; width: auto; }
.select-auto { width: auto; min-width: 170px; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-weight: 550; font-size: 13px; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.form-error { padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger); font-weight: 500; overflow-wrap: anywhere; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; align-items: start; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pw-field { position: relative; }
.pw-field .input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 3px; top: 3px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
.unit-input { display: flex; align-items: center; gap: 8px; }
.unit-input .input { max-width: 180px; }
.preset-row { display: flex; gap: 6px; flex-wrap: wrap; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 500; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-2); flex: none; transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--accent-strong); border-color: transparent; }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Badges & Hinweise ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge .ico { width: 12px; height: 12px; }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--accent-soft); color: var(--text); }
.notice > .ico { color: var(--accent-text); margin-top: 1px; }
.notice p { color: var(--text-2); margin-top: 2px; }
.notice.warn { background: var(--warning-soft); }
.notice.warn > .ico { color: var(--warning); }
.notice.danger { background: var(--danger-soft); margin-bottom: 16px; }
.notice.danger > .ico { color: var(--danger); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; container-type: inline-size; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .actions { text-align: right; white-space: nowrap; width: 1%; }
.tbl time { white-space: nowrap; }
.tbl tr.dim td > * { opacity: .6; }
.tbl tr.dim td.actions > * { opacity: 1; }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; align-items: center; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 4px; color: var(--muted); font-size: 12.5px; }
.pcell { min-width: 0; }
.pname { font-weight: 550; overflow-wrap: anywhere; }
.pdir { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { width: 30px; height: 30px; font-size: 12px; }
.line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sub { font-size: 12px; color: var(--muted); }
.detail { font-family: var(--mono); font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
/* Ab schmaler Tabellenbreite: Zeilen als Karten (Container-Query, unabhängig von der Sidebar) */
@container (max-width: 860px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: right; min-height: 30px; }
  .tbl td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12.5px; font-weight: 550; text-align: left; }
  .tbl td.primary { justify-content: flex-start; text-align: left; padding-bottom: 6px; }
  .tbl td.primary::before, .tbl td.actions::before { content: none; }
  .tbl td.actions { width: 100%; justify-content: flex-end; padding-top: 8px; }
  .tbl tbody tr:hover td { background: none; }
  .tbl .num { text-align: right; }
  .tbl td .line { justify-content: flex-end; }
  .tbl td.primary .line { justify-content: flex-start; }
}

/* ---------- Zustände ---------- */
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 56px 20px; text-align: center; color: var(--muted); }
.state-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 4px; }
.state-icon .ico { width: 26px; height: 26px; }
.state.error .state-icon { background: var(--danger-soft); color: var(--danger); }
.state-title { font-size: 16px; font-weight: 650; color: var(--text); }
.state-text { max-width: 440px; }
.state .btn { margin-top: 8px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Dateiliste ---------- */
.files-bar { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.crumbs { display: flex; align-items: center; gap: 2px; flex: 1 1 320px; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: thin; padding: 2px 0; transition: opacity .15s; }
.crumbs.dim { opacity: .5; }
.crumb { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; color: var(--text-2); font-weight: 500; }
.crumb .ico { width: 16px; height: 16px; }
a.crumb:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.crumb.current { color: var(--text); font-weight: 650; }
.crumb-sep { display: inline-flex; color: var(--muted); }
.crumb-sep .ico { width: 14px; height: 14px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.on .dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.live.off .dot { background: var(--warning); }
.flist { position: relative; overflow: hidden; }
.frow { display: grid; grid-template-columns: minmax(0, 1fr) 100px 150px 130px 80px; align-items: center; gap: 12px; padding: 0 12px 0 16px; min-height: 54px; border-bottom: 1px solid var(--border); }
.fbody .frow:last-child { border-bottom: 0; }
.fbody .frow:hover { background: var(--surface-2); }
.fhead { min-height: 42px; }
.fhead .fcell { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sort { display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.sort:hover, .sort.on { color: var(--text); }
.fcell { min-width: 0; }
.c-size, .c-mtime, .c-by { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-size { text-align: right; font-variant-numeric: tabular-nums; }
.fhead .c-size { display: flex; justify-content: flex-end; }
.c-act { display: flex; justify-content: flex-end; gap: 2px; }
.fname { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); }
a.fname:hover { text-decoration: none; }
a.fname:hover .fname-main { color: var(--accent-text); }
.ficon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); }
.ficon.dir { background: var(--accent-soft); color: var(--accent-text); }
.ficon.code { background: rgba(88, 166, 255, .13); color: #58a6ff; }
.ficon.doc { background: rgba(76, 195, 217, .13); color: #3fb6cc; }
.ficon.img { background: var(--success-soft); color: var(--success); }
.ficon.arc { background: var(--warning-soft); color: var(--warning); }
.ficon.media { background: rgba(227, 111, 208, .13); color: #d65fc4; }
.fname-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.fname-main { font-weight: 550; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.fname-main:hover { color: var(--accent-text); text-decoration: none; }
.fsub, .fmeta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.fsub:hover { color: var(--accent-text); }
.fmeta { display: none; }
.frow.up .fname-main { color: var(--text-2); }
.fmore { display: flex; justify-content: center; padding: 12px; }
.fsummary { margin-top: 10px; padding: 0 4px; font-size: 12.5px; color: var(--muted); }
.dropzone { position: absolute; inset: 0; z-index: 5; display: none; place-items: center; border: 2px dashed var(--accent); border-radius: var(--r); background: var(--surface); background: color-mix(in srgb, var(--surface) 90%, transparent); pointer-events: none; }
.flist.dragging { min-height: 240px; }
.flist.dragging .dropzone { display: grid; }
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 650; font-size: 15px; }
.dropzone-inner .ico { width: 34px; height: 34px; }
.dz-sub { font-weight: 400; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .frow { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 0 6px 0 12px; min-height: 60px; }
  .c-size, .c-mtime, .c-by, .fhead { display: none; }
  .fmeta { display: block; }
  .ficon { width: 32px; height: 32px; }
  .fname { gap: 10px; }
  .search { flex: 1 1 100%; }
}

/* ---------- Uploads ---------- */
.uploads { position: fixed; right: 16px; bottom: 16px; z-index: 900; width: min(360px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.up-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--border); font-weight: 600; }
.up-head > .ico { color: var(--accent-text); }
.up-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-collapse .ico { transition: transform .15s; }
.uploads.collapsed .up-collapse .ico { transform: rotate(180deg); }
.uploads.collapsed .up-list { display: none; }
.uploads.collapsed .up-head { border-bottom: 0; }
.up-list { max-height: 280px; overflow-y: auto; padding: 6px 0; }
.up-item { padding: 7px 14px; }
.up-line { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.up-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.up-status { margin-top: 4px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.up-item.ok .up-status { color: var(--success); }
.up-item.err .up-status { color: var(--danger); }
.up-item.cancel, .up-item.ok progress { opacity: .65; }
progress { display: block; width: 100%; height: 4px; margin-top: 4px; border: 0; border-radius: 4px; overflow: hidden; background: var(--surface-3); appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 4px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
.up-item.ok progress::-webkit-progress-value { background: var(--success); }
.up-item.ok progress::-moz-progress-bar { background: var(--success); }
.up-item.err progress::-webkit-progress-value { background: var(--danger); }
.up-item.err progress::-moz-progress-bar { background: var(--danger); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px 10px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow); pointer-events: auto; opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }
.toast > .ico { margin-top: 5px; color: var(--accent-text); }
.toast.success > .ico { color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.error > .ico { color: var(--danger); }
.toast-msg { flex: 1; min-width: 0; padding-top: 4px; overflow-wrap: anywhere; }

/* ---------- Dialoge ---------- */
dialog.modal { width: min(480px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--border-2); border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow: auto; }
dialog.modal.wide { width: min(640px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(5, 7, 12, .62); }
dialog.modal[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.modal-box { display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 6px 20px; }
.modal-head h3 { font-size: 17px; }
.modal-body { display: flex; flex-direction: column; gap: 14px; padding: 8px 20px 4px; }
.modal-text { color: var(--text-2); overflow-wrap: anywhere; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 18px 20px 20px; }
.reject-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; overflow-wrap: anywhere; }
@media (max-width: 480px) { .modal-foot .btn { flex: 1 1 auto; } }

/* ---------- Anmeldung ---------- */
.auth { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 64px 16px 32px; background: radial-gradient(900px 520px at 50% -8%, var(--accent-soft), transparent 70%), var(--bg); }
.auth-top { position: absolute; top: 12px; right: 12px; }
.auth-main { width: 100%; max-width: 420px; }
.auth-card { padding: 32px 28px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; font-weight: 700; font-size: 16px; }
.auth-brand img { border-radius: 10px; }
.auth-title { font-size: 22px; margin-bottom: 6px; }
.auth-sub { color: var(--muted); margin-bottom: 22px; }
.auth-sub:empty { display: none; }
.auth-body .notice { margin-bottom: 4px; }
.auth-note { margin-top: 20px; text-align: center; font-size: 13px; color: var(--muted); }
@media (max-width: 480px) { .auth-card { padding: 24px 18px; } }

/* ---------- Übersicht, Konto, Download, Einstellungen ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.stats > .state, .span-all { grid-column: 1 / -1; }
.stat { display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.stat-top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 550; font-size: 13px; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.stats-foot { margin-top: 12px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.quick-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px; color: var(--text); transition: border-color .15s; }
.quick-card:hover { border-color: var(--accent); }
.quick-card strong { display: block; margin-bottom: 2px; }
.stats > .card, .quick > .card { margin-top: 0; }
@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 20px; }
}
.profile { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px; }
.profile-text { flex: 1 1 220px; min-width: 0; }
.profile-name { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.profile-role { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px; }
.hero-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.hero-icon .ico { width: 28px; height: 28px; }
.hero-text { flex: 1 1 200px; }
.hero-text h3 { font-size: 18px; margin-bottom: 2px; }
@media (max-width: 480px) { .hero .btn { width: 100%; } }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps p { margin-top: 2px; }
.step-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.set-section { padding: 20px; border-bottom: 1px solid var(--border); }
.set-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.set-head h3 { font-size: 15px; }
.set-desc { margin: 4px 0 12px; max-width: 760px; }
.set-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 20px; }
.set-foot .form-error { flex: 1 1 100%; }
.chip-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.chips-box { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--bg); cursor: text; transition: border-color .15s, box-shadow .15s; }
.chips-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 232px; overflow-y: auto; }
.chip { display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 3px 0 10px; border-radius: 999px; background: var(--surface-3); font-family: var(--mono); font-size: 12.5px; }
.chip-x { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.chip-x:hover { background: var(--danger-soft); color: var(--danger); }
.chip-x .ico { width: 12px; height: 12px; }
.chip-input { min-width: 0; width: 100%; padding: 4px 2px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13.5px; }
.chips-empty { font-size: 13px; color: var(--muted); }
