/* Design wie WePreview: Variablen in :root (dunkel ist Standard), hell unter html[data-theme="light"]. */

@font-face { font-family: "Inter Tight"; src: url("fonts/InterTight-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter Tight"; src: url("fonts/InterTight-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #0e0f11;
  --bg-2: #131417;
  --surface: rgba(255,255,255,.035);
  --surface-hi: rgba(255,255,255,.06);
  --line: rgba(255,255,255,.08);
  --line-hi: rgba(255,255,255,.16);
  --text: #eceae4;
  --text-2: #b4b3ae;
  --muted: #85868b;
  --accent: #ff8a3d;
  --accent-soft: rgba(255,138,61,.14);
  --ok: #7ed49a;
  --warn: #ff7a6b;
  --del: #6aa9ff;
  --radius: 14px;
  --radius-sm: 10px;
  --gutter: clamp(16px, 4vw, 48px);
  --topbar: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f4f3f0;
  --bg-2: #ebe9e4;
  --surface: rgba(24,26,32,.04);
  --surface-hi: rgba(24,26,32,.07);
  --line: rgba(24,26,32,.11);
  --line-hi: rgba(24,26,32,.2);
  --text: #1b1c20;
  --text-2: #46474d;
  --muted: #6f7077;
  --accent: #f07425;
  --accent-soft: rgba(240,116,37,.13);
  --ok: #26995a;
  --warn: #d9463b;
  --del: #2f7de0;
  --shadow: 0 18px 50px rgba(24,26,32,.16);
  color-scheme: light;
}
@media (max-width: 720px) { :root { --topbar: 60px; } }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; transition: background-color .4s var(--ease), color .4s var(--ease); }
html.theme-fade body, html.theme-fade body * { transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease) !important; }
html.no-trans *, html.no-trans *::before, html.no-trans *::after { transition: none !important; animation-play-state: paused; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 650; }
h2 { font-size: 1.25rem; font-weight: 620; }
h3 { font-size: 1.02rem; font-weight: 600; }
p { margin: 0 0 1em; }
.mono, .num { font-family: var(--mono); font-feature-settings: "zero" 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; flex: none; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 34px; height: 34px; stroke-width: 1.6; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 99px;
  font: 500 .9rem/1 var(--font); color: var(--text); background: var(--surface-hi); border: 1px solid var(--line); cursor: pointer;
  transition: transform .15s var(--ease), border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease); white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--line-hi); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.btn.sm { min-height: 36px; padding: 0 13px; font-size: .85rem; }
.btn.icon-only { padding: 0; width: 40px; }
.btn.sm.icon-only { width: 36px; }
.btn-primary { background: var(--accent); color: #1a0e05; font-weight: 600; border-color: transparent; }
.btn-primary:hover { background: #ff9b57; box-shadow: 0 6px 24px rgba(255,138,61,.3); border-color: transparent; }
.btn-danger { color: var(--warn); }
.btn-danger.solid { background: var(--warn); color: #1a0505; border-color: transparent; font-weight: 600; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-hi); }
.linkbtn { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }

/* ---------------------------------------------------------------- Formulare */
label.field { display: block; margin: 0 0 14px; }
label.field > span { display: block; font-size: .85rem; color: var(--text-2); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 13px; font: 400 .95rem var(--font); color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder { color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-error { color: var(--warn); font-size: .9rem; min-height: 1.2em; margin: 4px 0 10px; }
.form-ok { color: var(--ok); }
.pw-rules { list-style: none; padding: 0; margin: -6px 0 14px; font-size: .82rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.pw-rules li::before { content: "○ "; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { content: "● "; }

/* 6 Felder für Codes: kein maxlength="1", sonst schneiden Tastaturen und Passwort-Manager ab */
.code-input { display: flex; gap: 8px; justify-content: center; margin: 6px 0 16px; }
.code-input input { width: 46px; height: 56px; text-align: center; font: 500 1.4rem var(--mono); padding: 0; border-radius: var(--radius-sm); }
.code-input input:nth-child(3) { margin-right: 10px; }

/* Schalter */
.switch { position: relative; width: 44px; height: 26px; flex: none; appearance: none; -webkit-appearance: none; background: var(--surface-hi); border: 1px solid var(--line);
  border-radius: 99px; cursor: pointer; transition: background .25s var(--ease); margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); transition: transform .3s var(--ease), background .25s; }
.switch:checked { background: var(--accent); border-color: transparent; }
.switch:checked::after { transform: translateX(18px); background: #1a0e05; }
.switch:disabled { opacity: .4; cursor: not-allowed; }

/* Segment-Knöpfe */
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; color: var(--text-2); font: 500 .85rem var(--font); min-height: 32px; padding: 0 12px; border-radius: 99px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: background .2s var(--ease), color .2s var(--ease); }
.segmented button[aria-pressed="true"] { background: var(--surface-hi); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------------------------------------------------------------- Karten */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card + .card { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font: 500 .72rem var(--font); padding: 2px 8px; border-radius: 99px; background: var(--surface-hi); color: var(--text-2); border: 1px solid var(--line); }
.badge.ok { color: var(--ok); }
.badge.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.badge.blue { color: var(--del); }
.badge.warn { color: var(--warn); }

/* ---------------------------------------------------------------- Seiten ohne Leiste (Login, Freigabe) */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px var(--gutter); position: relative; }
.auth-page .corner { position: absolute; top: 16px; right: var(--gutter); }
.auth-box { width: min(420px, 100%); }
.auth-box .brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.15rem; margin-bottom: 22px; }
.auth-box .card { padding: 28px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.full { width: 100%; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #ffb36b); display: grid; place-items: center; color: #1a0e05; }
.logo .icon { width: 18px; height: 18px; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font: 500 .95rem var(--mono); background: var(--bg-2); border-radius: var(--radius-sm); padding: 14px 18px; margin: 10px 0 14px; }
.qr { background: #fff; padding: 8px; border-radius: var(--radius-sm); width: 220px; margin: 8px 0 14px; }
.qr svg { width: 100%; height: auto; display: block; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; margin: 10px auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Obere Leiste */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar); display: flex; align-items: center; gap: 14px; padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); font-size: 1.05rem; }
.topbar .brand:hover { text-decoration: none; }
.topbar .search { flex: 1; max-width: 520px; margin: 0 auto; position: relative; }
.topbar .search input { padding-left: 40px; border-radius: 99px; background: var(--surface); min-height: 40px; }
.topbar .search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar .actions { display: flex; align-items: center; gap: 10px; }
.avatar-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent); font: 650 .95rem var(--font); cursor: pointer; padding: 0; }
.avatar-btn svg.ring { position: absolute; inset: -3px; width: 46px; height: 46px; transform: rotate(-90deg); pointer-events: none; }
.avatar-btn svg.ring circle { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 60;
  transform-origin: top right; animation: pop .18s var(--ease); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; border: 0; background: none; color: var(--text); font: 500 .9rem var(--font); cursor: pointer; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--surface-hi); text-decoration: none; }
.menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu .head { padding: 8px 12px 10px; font-size: .85rem; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
@media (max-width: 720px) {
  .topbar { gap: 8px; }
  .topbar .brand span { display: none; }
  .topbar .btn.upload-btn span { display: none; }
  .topbar .btn.upload-btn { padding: 0; width: 40px; }
}

/* ---------------------------------------------------------------- Hell/Dunkel-Schalter: ein kleiner Himmel */
.day-night { position: relative; width: 64px; height: 34px; border-radius: 99px; border: 0; padding: 0; cursor: pointer; flex: none; overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.08); background: #1b1a4a; -webkit-tap-highlight-color: transparent; }
.dn-sky, .dn-night, .dn-day { position: absolute; inset: 0; border-radius: inherit; }
.dn-night { background: linear-gradient(135deg, #1b1a4a, #3b2a7a 55%, #6a3fa0); }
.dn-day { background: linear-gradient(180deg, #7cc8f0, #b8e3f7); opacity: 0; transition: opacity .5s var(--ease); }
.dn-stars i { position: absolute; width: 2px; height: 2px; background: #fff; border-radius: 50%; animation: twinkle 2.6s ease-in-out infinite; transition: transform .5s var(--ease), opacity .5s var(--ease); }
.dn-stars i:nth-child(1) { left: 36px; top: 7px; animation-delay: 0s; }
.dn-stars i:nth-child(2) { left: 46px; top: 15px; width: 1px; height: 1px; animation-delay: .37s; }
.dn-stars i:nth-child(3) { left: 54px; top: 8px; animation-delay: .74s; }
.dn-stars i:nth-child(4) { left: 41px; top: 24px; width: 1px; height: 1px; animation-delay: 1.11s; }
.dn-stars i:nth-child(5) { left: 52px; top: 24px; animation-delay: 1.48s; }
.dn-stars i:nth-child(6) { left: 31px; top: 17px; width: 1px; height: 1px; animation-delay: 1.85s; }
.dn-stars i:nth-child(7) { left: 58px; top: 16px; width: 1px; height: 1px; animation-delay: 2.22s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.dn-clouds { position: absolute; left: 0; bottom: 0; width: 64px; height: 34px; transform: translateY(16px); opacity: 0; transition: transform .55s var(--ease), opacity .5s var(--ease); fill: #fff; }
.dn-knob { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 99px; background: #d9d9e3;
  box-shadow: inset -3px -2px 4px rgba(0,0,0,.18), 0 2px 5px rgba(0,0,0,.35);
  transition: transform .55s cubic-bezier(.5,1.45,.4,1), width .2s var(--ease), background .5s var(--ease), box-shadow .5s var(--ease); }
.dn-knob i { position: absolute; border-radius: 50%; background: #b5b5c4; box-shadow: inset 1px 1px 1px rgba(0,0,0,.18); transition: opacity .3s var(--ease); }
.dn-knob i:nth-child(1) { width: 7px; height: 7px; left: 6px; top: 6px; }
.dn-knob i:nth-child(2) { width: 4px; height: 4px; left: 15px; top: 14px; }
.dn-knob i:nth-child(3) { width: 5px; height: 5px; left: 7px; top: 16px; }
.day-night:active .dn-knob { width: 30px; }
.day-night[aria-checked="true"] .dn-day { opacity: 1; }
.day-night[aria-checked="true"] .dn-stars i { transform: translateY(-12px); opacity: 0; animation: none; }
.day-night[aria-checked="true"] .dn-clouds { transform: translateY(0); opacity: 1; }
.day-night[aria-checked="true"] .dn-knob { transform: translateX(30px) rotate(180deg); background: radial-gradient(circle at 35% 35%, #fff7b0, #ffd23f 55%, #f5a623);
  box-shadow: 0 0 12px 2px rgba(255,210,63,.65), 0 2px 5px rgba(0,0,0,.2); }
.day-night[aria-checked="true"]:active .dn-knob { transform: translateX(26px) rotate(180deg); }
.day-night[aria-checked="true"] .dn-knob i { opacity: 0; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
@media (prefers-reduced-motion: reduce) { .dn-knob, .dn-day, .dn-clouds, .dn-stars i { transition: none; animation: none; } }

/* ---------------------------------------------------------------- Layout der Oberfläche */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - var(--topbar)); }
.sidebar { border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow: auto; display: flex; flex-direction: column; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--surface-hi); color: var(--text); }
.nav a.drop-target { box-shadow: inset 0 0 0 2px var(--accent); }
.nav .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 16px 12px 6px; }
.usage { margin-top: auto; padding: 14px 12px 4px; font-size: .82rem; color: var(--muted); }
.bar { height: 7px; border-radius: 99px; background: var(--surface-hi); overflow: hidden; display: flex; margin: 8px 0 6px; }
.bar span { height: 100%; transition: width .6s var(--ease); }
.bar .photos { background: var(--accent); } .bar .videos { background: #c56cf0; } .bar .documents { background: var(--del); }
.bar .versions { background: var(--muted); } .bar .trash { background: var(--warn); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.main { padding: 22px var(--gutter) 120px; min-width: 0; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; top: var(--topbar); left: 0; bottom: 0; width: 260px; background: var(--bg); transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: var(--shadow); height: auto; }
  body.nav-open .sidebar { transform: none; }
}
@media (min-width: 901px) { .nav-toggle { display: none !important; } }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; min-height: 40px; }
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 1.15rem; font-weight: 620; flex: 1; min-width: 0; }
.crumbs a, .crumbs span { color: var(--text-2); padding: 3px 7px; border-radius: 8px; }
.crumbs a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.crumbs a.drop-target { box-shadow: inset 0 0 0 2px var(--accent); }
.crumbs .sep { color: var(--muted); padding: 0; }
.crumbs > :last-child { color: var(--text); }

/* Raster */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: default; user-select: none;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.tile:hover { border-color: var(--line-hi); }
.tile .thumb { aspect-ratio: 1; display: grid; place-items: center; background: var(--bg-2); color: var(--muted); overflow: hidden; position: relative; }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .thumb .mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 100%; height: 100%; }
.tile .thumb .mosaic img { width: 100%; height: 100%; object-fit: cover; }
.tile .meta { padding: 9px 12px 11px; }
.tile .name { font-weight: 500; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { font-size: .76rem; color: var(--muted); font-family: var(--mono); }
.tile.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tile.drop-target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); transform: scale(1.02); }
.tile .sel { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.8); background: rgba(0,0,0,.25);
  opacity: 0; transition: opacity .15s; display: grid; place-items: center; z-index: 2; cursor: pointer; }
.tile:hover .sel, .tile.selected .sel, .selecting .tile .sel { opacity: 1; }
.tile.selected .sel { background: var(--accent); border-color: var(--accent); color: #1a0e05; }
.tile .flags { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; z-index: 2; }
.tile .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; pointer-events: none; }
.tile .play .icon { width: 38px; height: 38px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.tile.folder .thumb { color: var(--accent); }
.tile.folder.shared .thumb { color: var(--del); }

/* Liste */
.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
.list th { text-align: left; font: 500 .78rem var(--font); color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; white-space: nowrap; }
.list th[aria-sort] { color: var(--text); }
.list td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td.name { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }
.list td.name .row { gap: 10px; }
.list td .mini { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: var(--bg-2); display: grid; place-items: center; flex: none; color: var(--muted); }
.list tr { transition: background .15s; user-select: none; }
.list tbody tr:hover { background: var(--surface); }
.list tr.selected { background: var(--accent-soft) !important; }
.list tr.drop-target td { box-shadow: inset 0 0 0 9999px var(--accent-soft); }
.list .num { color: var(--text-2); font-size: .82rem; }

/* Zeitleiste */
.timeline h3 { margin: 26px 0 10px; font-size: .95rem; color: var(--text-2); position: sticky; top: var(--topbar); background: var(--bg); padding: 8px 0; z-index: 5; }
.timeline .photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; }
.timeline .photos .ph { aspect-ratio: 1; background: var(--bg-2); border-radius: 6px; overflow: hidden; position: relative; cursor: pointer; }
.timeline .photos img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.timeline .photos .ph:hover img { transform: scale(1.04); }

.empty { text-align: center; color: var(--muted); padding: 70px 20px; }
.empty .icon { width: 46px; height: 46px; stroke-width: 1.4; margin-bottom: 10px; color: var(--text-2); }
.dropzone { position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, var(--bg) 70%, transparent); display: grid; place-items: center; pointer-events: none;
  border: 3px dashed var(--accent); border-radius: 18px; margin: 10px; opacity: 0; transition: opacity .2s; }
body.dragging-files .dropzone { opacity: 1; }
.dropzone div { font-size: 1.2rem; font-weight: 600; }

/* Auswahlleiste */
.selbar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(140%); z-index: 70; display: flex; gap: 8px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line-hi); border-radius: 99px; padding: 7px 8px 7px 18px; box-shadow: var(--shadow); transition: transform .3s var(--ease); max-width: calc(100vw - 24px); overflow-x: auto; }
.selbar.show { transform: translateX(-50%); }
.selbar .count { font-weight: 600; margin-right: 6px; white-space: nowrap; }

/* Upload-Leiste unten */
.uploads { position: fixed; right: 20px; bottom: 20px; width: min(380px, calc(100vw - 40px)); z-index: 75; background: var(--bg-2); border: 1px solid var(--line-hi); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.uploads header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-weight: 600; font-size: .9rem; }
.uploads .items { max-height: 240px; overflow: auto; border-top: 1px solid var(--line); }
.uploads .item { padding: 9px 14px; font-size: .83rem; border-bottom: 1px solid var(--line); }
.uploads .item .row { justify-content: space-between; }
.uploads .item .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uploads .item.err .st { color: var(--warn); }
.uploads .item.done .st { color: var(--ok); }
.progress { height: 4px; background: var(--surface-hi); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s var(--ease); }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; background: var(--text); color: var(--bg); padding: 10px 10px 10px 18px; border-radius: 99px; box-shadow: var(--shadow);
  font-weight: 500; font-size: .9rem; animation: toast-in .3s var(--ease); max-width: calc(100vw - 32px); }
.toast.err { background: var(--warn); color: #1a0505; }
.toast button { background: transparent; border: 1px solid color-mix(in srgb, var(--bg) 35%, transparent); color: inherit; font: 600 .85rem var(--font); padding: 6px 12px; border-radius: 99px; cursor: pointer; }
.toast.plain { padding-right: 18px; }
.toast.out { animation: toast-out .25s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }
body.has-selbar .toasts { bottom: 86px; }

/* Dialoge */
dialog { border: 1px solid var(--line-hi); border-radius: var(--radius); background: var(--bg-2); color: var(--text); padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(5,6,8,.6); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .2s var(--ease); }
dialog .dlg-body { padding: 24px; }
dialog .dlg-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 22px; flex-wrap: wrap; }
dialog.wide { width: min(720px, calc(100vw - 32px)); }
.folder-pick { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 6px 0 4px; }
.folder-pick button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; color: var(--text); padding: 8px 12px; font: 500 .9rem var(--font); cursor: pointer; text-align: left; }
.folder-pick button:hover { background: var(--surface-hi); }
.folder-pick button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.vlist { list-style: none; padding: 0; margin: 0; }
.vlist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.vlist li:last-child { border-bottom: 0; }
.vlist .grow { flex: 1; min-width: 160px; }

/* Großansicht */
.viewer { position: fixed; inset: 0; z-index: 90; background: rgba(6,7,9,.96); display: grid; grid-template-rows: auto 1fr; color: #eceae4; }
.viewer header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.viewer header .title { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer .btn { color: #eceae4; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); }
.viewer .stage { position: relative; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; }
.viewer .stage img, .viewer .stage video { max-width: 100%; max-height: calc(100vh - 70px); object-fit: contain; }
.viewer .stage .doc { text-align: center; }
.viewer .nav-prev, .viewer .nav-next { position: absolute; top: 50%; transform: translateY(-50%); }
.viewer .nav-prev { left: 14px; } .viewer .nav-next { right: 14px; }
.viewer .info { position: absolute; right: 16px; bottom: 16px; background: rgba(20,21,24,.9); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); padding: 14px 18px; font-size: .85rem; min-width: 220px; }
.viewer .info dt { color: #85868b; font-size: .75rem; } .viewer .info dd { margin: 0 0 8px; font-family: var(--mono); }

/* Einstellungen */
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 32px; max-width: 1080px; margin: 0 auto; padding: 26px var(--gutter) 120px; }
.settings nav { position: sticky; top: calc(var(--topbar) + 20px); align-self: start; }
.settings nav a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; }
.settings nav a:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.settings section { scroll-margin-top: calc(var(--topbar) + 20px); margin-bottom: 34px; }
.settings section > h2 { margin-bottom: 14px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .txt { flex: 1; min-width: 0; }
.setting .txt b { font-weight: 600; display: block; }
.setting .txt small { color: var(--muted); }
.people td { white-space: normal; }
@media (max-width: 820px) {
  .settings { grid-template-columns: 1fr; gap: 10px; }
  .settings nav { position: sticky; top: var(--topbar); z-index: 10; background: var(--bg); display: flex; overflow-x: auto; gap: 4px; padding: 8px 0; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); }
  .settings nav a { white-space: nowrap; }
  .setting { flex-wrap: wrap; }
}

/* Freigabe-Seite */
.share-head { display: flex; align-items: center; gap: 14px; padding: 18px var(--gutter); border-bottom: 1px solid var(--line); }
.share-head .grow { flex: 1; }
.share-main { padding: 22px var(--gutter) 80px; max-width: 1280px; margin: 0 auto; }
.share-single { display: grid; place-items: center; padding: 20px; }
.share-single img, .share-single video { max-width: 100%; max-height: 72vh; border-radius: var(--radius); }

kbd { font: 500 .78rem var(--mono); background: var(--surface-hi); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
.hotkey-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hotkey-row input { width: 160px; text-align: center; font-family: var(--mono); }
.warn-text { color: var(--warn); font-size: .82rem; }
.avatar-wrap { position: relative; }
.setting select { width: auto; min-width: 150px; flex: none; }
#invite-form input { flex: 1; min-width: 200px; width: auto; }
#invite-form select { width: auto; }
#s3-form .field { flex: 1; min-width: 200px; }
@media (max-width: 900px) { .sidebar { box-shadow: none; } body.nav-open .sidebar { box-shadow: var(--shadow); } }
