/* Online-Speicher – Grundschrift 18 px, Trefferflächen >= 44 px, Kontrast >= WCAG AA, Dark Mode, reduzierte Bewegung. */
:root {
  color-scheme: light dark;
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eceef2; --text: #16181d; --muted: #566070;
  --border: #c9cdd6; --border-input: #6b7280; --accent: #1a57c7; --accent-hover: #1447a3; --accent-text: #fff;
  --accent-soft: #e3ecfc; --danger: #b3261e; --danger-soft: #fce8e6; --success: #1b6e37; --success-soft: #e2f4e8;
  --focus: #0b5fff; --shadow: 0 1px 2px rgb(0 0 0 / 8%), 0 4px 14px rgb(0 0 0 / 6%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --touch: 2.75rem; --radius: 12px; --radius-sm: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114; --surface: #1a1d22; --surface-2: #262a31; --text: #f1f3f6; --muted: #b0b7c3;
    --border: #3d434d; --border-input: #7a828f; --accent: #7db0ff; --accent-hover: #a3c6ff; --accent-text: #0a1c3a;
    --accent-soft: #1b2b49; --danger: #ff8f86; --danger-soft: #3a1a18; --success: #6fd593; --success-soft: #14301f;
    --focus: #8ab8ff; --shadow: none;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1.125rem/1.5 var(--font); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1 { font-size: 1.875rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .75rem; }
h3 { font-size: 1.25rem; margin: 1.25rem 0 .5rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.sr-file:focus-visible + * , label:has(+ .sr-file:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 50; }
.muted { color: var(--muted); }
.wrap { overflow-wrap: anywhere; }
.plain { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: .5rem 1rem; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); text-decoration: none; min-height: var(--touch); }
.searchbar { display: flex; gap: .5rem; flex: 1 1 14rem; max-width: 28rem; }
.searchbar input { flex: 1; min-width: 0; }
.mainnav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-left: auto; }
.mainnav a { display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 .75rem; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; }
.mainnav a:hover { background: var(--surface-2); }
.mainnav form { margin: 0; }

.page { max-width: 44rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.page.wide { max-width: 80rem; }
.page.with-side { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.messages { grid-column: 1 / -1; }
.msg { margin: 0 0 .75rem; padding: .75rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.msg-success { background: var(--success-soft); border-color: var(--success); }
.msg-error { background: var(--danger-soft); border-color: var(--danger); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.card.narrow { max-width: 30rem; margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--touch); padding: 0 1rem; gap: .5rem;
  font: inherit; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-input);
  border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; transition: background-color .15s; }
.btn:hover { background: var(--border); color: var(--text); }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-quiet { background: transparent; border-color: transparent; }
.btn-block { width: 100%; }
.btn-small { font-size: 1rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

input[type=text], input[type=password], input[type=email], input[type=search], input[type=date], input[type=number], input:not([type]), select, textarea, input[inputmode] {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-input); border-radius: var(--radius-sm);
  min-height: var(--touch); padding: 0 .75rem; width: 100%; }
textarea { padding: .6rem .75rem; line-height: 1.4; resize: vertical; }
.searchbar input, .inline-form input { width: auto; }
input[type=checkbox] { width: 1.5rem; height: 1.5rem; accent-color: var(--accent); }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.hint { color: var(--muted); font-size: 1rem; margin: .25rem 0 0; }
.field-error { color: var(--danger); font-weight: 600; margin: .25rem 0 0; }
.row-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.copy { font-family: ui-monospace, monospace; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.25rem; }
.facts dt { font-weight: 600; } .facts dd { margin: 0; }
.qr { background: #fff; padding: .5rem; display: inline-block; border-radius: var(--radius-sm); } .qr svg { width: 12rem; height: 12rem; display: block; }
.secret { font-size: 1.125rem; overflow-wrap: anywhere; }
progress { display: block; width: 100%; max-width: 20rem; height: .75rem; accent-color: var(--accent); margin-top: .25rem; }
.badge { background: var(--danger-soft); color: var(--danger); padding: .1rem .5rem; border-radius: 999px; font-size: 1rem; }
.list-rows li { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding: .75rem 0; border-top: 1px solid var(--border); }
.list-rows form { margin: 0; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Dateiliste */
.side { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.side-title { font-size: 1.125rem; }
.side a { display: flex; align-items: center; gap: .5rem; min-height: var(--touch); padding: 0 .5rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.side a:hover { background: var(--surface-2); }
.side a[aria-current=page] { background: var(--accent-soft); font-weight: 700; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 1rem; border-left: 1px solid var(--border); margin-left: .75rem; }
.usage { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); font-size: 1rem; color: var(--muted); }
.mainpane { position: relative; min-width: 0; min-height: 60vh; }
.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; overflow-wrap: anywhere; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.ico { width: 1.75rem; height: 1.75rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.ico-folder { fill: var(--accent-soft); stroke: var(--accent); }
.listhead, .item { display: grid; grid-template-columns: var(--touch) minmax(0, 1fr) 7rem 9rem auto; align-items: center; gap: .5rem; }
.listhead { padding: .25rem .75rem; color: var(--muted); font-size: 1rem; font-weight: 600; }
.filelist { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.item { padding: .25rem .75rem; border-top: 1px solid var(--border); min-height: 3.5rem; }
.item:first-child { border-top: 0; }
.item:hover { background: var(--surface-2); }
.item.simple { grid-template-columns: minmax(0, 1fr) auto; }
.name { display: flex; align-items: center; gap: .75rem; min-height: var(--touch); color: var(--text); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.name:hover { color: var(--accent); }
.check { display: inline-flex; align-items: center; justify-content: center; width: var(--touch); height: var(--touch); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.empty { text-align: center; padding: 3rem 1rem; }
.dropveil { position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 18%, transparent); border: 3px dashed var(--accent);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; z-index: 10; pointer-events: none; }
.uploads { position: fixed; right: 1rem; bottom: 1rem; width: min(26rem, calc(100vw - 2rem)); max-height: 60vh; overflow: auto; background: var(--surface);
  border: 1px solid var(--border-input); border-radius: var(--radius); padding: 1rem; box-shadow: 0 8px 30px rgb(0 0 0 / 25%); z-index: 30; }
.uploads-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.uploads li { padding: .5rem 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.uploads li.err { color: var(--danger); font-weight: 600; }
.uploads progress { max-width: none; }

dialog { border: 1px solid var(--border-input); border-radius: var(--radius); background: var(--surface); color: var(--text); width: min(30rem, calc(100vw - 2rem)); padding: 1.25rem; }
dialog::backdrop { background: rgb(0 0 0 / 55%); }

.preview-box { text-align: center; overflow: auto; }
.pv-image, .pv-video { max-width: 100%; max-height: 75vh; }
.pv-audio { width: 100%; }
.pv-pdf { width: 100%; height: 75vh; border: 0; background: #fff; }
.pv-text { text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; font: 1rem/1.5 ui-monospace, monospace; margin: 0; }

/* Teilen, Anfragen, öffentliche Seiten */
.status { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: 1rem; font-weight: 600; margin-right: .35rem; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.status-on { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.status-off { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.status-info { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.name .status { margin-left: .25rem; font-weight: 600; }
.share-head { display: flex; flex-wrap: wrap; gap: .75rem 1rem; justify-content: space-between; align-items: flex-start; }
.share-head form { margin: 0; }
.linkbox { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.linkbox input { flex: 1 1 16rem; min-width: 0; }
.check-inline { display: flex; align-items: center; gap: .75rem; min-height: var(--touch); font-weight: 600; }
.field-check .hint { margin-left: 2.25rem; }
.btn-big { min-height: 3.5rem; padding: 0 1.5rem; font-size: 1.25rem; }
.public-top .brand { cursor: default; }
.facts-list { display: grid; gap: .35rem; margin-top: .75rem; color: var(--muted); }
.facts-list li::before { content: "•"; margin-right: .5rem; }
.dropbox { text-align: center; border: 3px dashed var(--border-input); border-radius: var(--radius); padding: 2rem 1rem; background: var(--surface-2); }
.dropbox p { margin: 0 0 1rem; }
#dropzone { position: relative; }
.uploads.inline { position: static; width: auto; max-height: none; box-shadow: none; }
.sub { border-top: 1px solid var(--border); padding: .5rem 0 .75rem; }
.sub:first-of-type { border-top: 0; }
.sub h3 { margin-top: .5rem; }
.quote { border-left: 4px solid var(--border-input); padding-left: .75rem; margin: .25rem 0 .75rem; }
.card textarea { width: 100%; }

@media (max-width: 52rem) {
  .page.with-side { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; order: 2; }
  .listhead { display: none; }
  .item { grid-template-columns: var(--touch) minmax(0, 1fr); row-gap: 0; }
  .item .col-size, .item .col-date { grid-column: 2; font-size: 1rem; display: inline; }
  .item .actions { grid-column: 2; justify-content: flex-start; padding-bottom: .5rem; }
  .item.simple { grid-template-columns: 1fr; }
  .topbar { position: static; }
  .facts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Welle 3: Hinweise, Protokolle */
.msg-warn { background: var(--accent-soft); border-color: var(--accent); }
.msg-stop { background: var(--danger-soft); border-color: var(--danger); }
.table-scroll { overflow-x: auto; }
.log-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.log-table th, .log-table td { text-align: left; padding: .6rem .75rem; border-top: 1px solid var(--border); vertical-align: top; }
.log-table thead th { border-top: 0; color: var(--muted); font-weight: 600; white-space: nowrap; }
.log-table td { min-width: 6rem; }
.pager { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: center; margin-top: 1rem; }
