/* folienhof.de Dateisystem – Design
   Hell, ruhig, am Logo orientiert: Schwarz und Signalrot, Schrift Barlow (lokal eingebunden). */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-ext-400-normal.woff2") format("woff2"); 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: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-ext-600-normal.woff2") format("woff2"); 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; }

:root {
  --ink: #15171a;
  --ink-2: #3a3f46;
  --muted: #6a717b;
  --line: #e4e7ec;
  --line-2: #d3d7de;
  --bg: #f4f5f7;
  --card: #ffffff;
  --red: #e3000f;
  --red-dark: #b6000c;
  --red-tint: #fdeced;
  --ok: #16794c;
  --ok-tint: #e6f5ee;
  --warn: #9a5b00;
  --warn-tint: #fff3dc;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 24, 31, .05), 0 6px 20px rgba(20, 24, 31, .06);
  --shadow-lg: 0 10px 40px rgba(20, 24, 31, .18);
  --side: 248px;
  --tab: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 .75em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 6px; }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------ Buttons & Felder */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; background: transparent; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: var(--card); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-quiet { color: var(--ink-2); }
.btn-quiet:hover { background: rgba(20, 24, 31, .06); }
.btn-danger { background: var(--card); border-color: #f1b8bc; color: var(--red-dark); }
.btn-danger:hover { background: var(--red-tint); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--ink-2); }
.field small { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
input[type=text], input[type=password], input[type=search], input[type=date], input[type=email], textarea, select {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; font-size: 16px; /* 16px verhindert Zoom auf iOS */
}
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: var(--red); }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--red); flex: none; }
.check b { font-weight: 500; display: block; }
.check small { color: var(--muted); display: block; font-size: 13px; }
.form-error { background: var(--red-tint); color: var(--red-dark); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 0 0 14px; }
.notice { background: var(--warn-tint); color: var(--warn); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
.notice.ok { background: var(--ok-tint); color: var(--ok); }
.notice a { font-weight: 600; }

/* ------------------------------------------------------------ Anmeldung (die einzige auffällige Stelle: die Dachlinie) */
.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  position: relative; overflow: hidden; background: #fff;
}
.auth-roof { position: absolute; inset: 0 0 auto 0; width: 100%; height: 46vh; max-height: 420px; pointer-events: none; -webkit-mask-image: linear-gradient(#000 55%, transparent 98%); mask-image: linear-gradient(#000 55%, transparent 98%); }
.auth-roof path { fill: none; stroke-width: 7; stroke-linejoin: miter; vector-effect: non-scaling-stroke; }
.auth-roof .r-black { stroke: var(--ink); }
.auth-roof .r-red { stroke: var(--red); }
.auth-card { position: relative; width: 100%; max-width: 380px; margin-top: 14vh; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px 24px; box-shadow: var(--shadow-lg); }
.auth-card img { height: 56px; width: auto; margin: 0 auto 18px; }
.auth-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 20px; font-size: 15px; }

/* ------------------------------------------------------------ Grundgerüst */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; }
.side {
  width: var(--side); flex: none; background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; height: 100dvh;
}
.side .brand { display: flex; align-items: flex-end; gap: 8px; padding: 4px 8px 18px; }
.ver { font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1; padding-bottom: 6px; white-space: nowrap; letter-spacing: .02em; }
.side .brand img { height: 48px; width: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 13px; color: var(--muted); padding: 16px 12px 6px; font-weight: 500; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none;
  color: var(--ink-2); font-weight: 500; position: relative;
}
.nav a:hover { background: var(--bg); }
.nav a[aria-current="page"] { background: var(--red-tint); color: var(--red-dark); font-weight: 600; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 15px; flex: none; }
.side-foot .who { min-width: 0; flex: 1; line-height: 1.25; }
.side-foot .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who span { font-size: 13px; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.view { padding: 28px 32px 48px; max-width: 1080px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.tabbar { display: none; }

/* Mobil: Tab-Leiste unten, Kopfzeile oben */
@media (max-width: 820px) {
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line); padding: calc(8px + var(--safe-t)) 14px 8px;
  }
  .topbar img { height: 38px; width: auto; }
  .topbar > a { display: flex; align-items: flex-end; gap: 8px; text-decoration: none; }
  .view { padding: 16px 14px calc(var(--tab) + var(--safe-b) + 90px); }
  h1 { font-size: 22px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff;
    border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: var(--tab); text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 500;
  }
  .tabbar a[aria-current="page"] { color: var(--red); font-weight: 600; }
}

/* ------------------------------------------------------------ Dateibrowser */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; font-size: 15px; min-width: 0; flex: 1 1 280px; }
.crumbs a { text-decoration: none; padding: 4px 6px; border-radius: 6px; color: var(--ink-2); font-weight: 500; }
.crumbs a:hover { background: rgba(20, 24, 31, .06); }
.crumbs a:last-child:not(:only-child), .crumbs .cur { color: var(--ink); font-weight: 600; }
.crumb-sep { color: var(--line-2); }
.search { position: relative; flex: 0 1 260px; min-width: 160px; }
.search input { padding-left: 38px; min-height: 40px; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; width: 18px; height: 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); position: relative; }
.row:last-child { border-bottom: 0; }
.row-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; padding: 10px 6px 10px 16px; min-height: 60px; text-decoration: none; cursor: pointer; background: none; border: 0; text-align: left; }
.row:hover { background: #fafbfc; }
.row-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: block; font-size: 13px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--muted); font-size: 14px; white-space: nowrap; text-align: right; }
.row-meta.w1 { min-width: 76px; }
.row-meta.w2 { min-width: 132px; }
.row-act { margin-right: 8px; }
.row .tag { margin-left: 6px; }
@media (max-width: 820px) {
  .row-meta.w2 { display: none; }
  .row-main { padding-left: 12px; }
  .row-act { margin-right: 4px; }
}
.list-head { display: flex; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); font-weight: 500; gap: 14px; }
.list-head span:first-child { flex: 1; padding-left: 50px; }
@media (max-width: 820px) { .list-head { display: none; } }

/* Dateityp-Marken: ein Quadrat mit der Endung */
.fi { position: relative; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .02em; flex: none; background: #eceef2; color: var(--ink-2); overflow: hidden; }
.fi-pdf { background: var(--red); color: #fff; }
.fi-img { background: #e4effb; color: #1a5aa6; }
.fi-doc { background: #e5ecfb; color: #2a4fb3; }
.fi-xls { background: var(--ok-tint); color: var(--ok); }
.fi-folder { background: var(--ink); color: #fff; }
.fi-folder.is-step { background: #e3e6ea; color: var(--ink-2); }
.fi img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fi svg { width: 20px; height: 20px; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eceef2; color: var(--ink-2); vertical-align: middle; white-space: nowrap; }
.tag-red { background: var(--red-tint); color: var(--red-dark); }
.tag-ok { background: var(--ok-tint); color: var(--ok); }
.tag-warn { background: var(--warn-tint); color: var(--warn); }
.tag .ico { width: 12px; height: 12px; stroke-width: 2.2; }

.empty { text-align: center; color: var(--muted); padding: 44px 20px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; font-weight: 600; }
.empty .btn { margin-top: 14px; }

.dropzone { position: fixed; inset: 0; z-index: 90; background: rgba(255, 255, 255, .88); display: none; place-items: center; text-align: center; border: 3px dashed var(--red); margin: 12px; border-radius: 20px; font-size: 20px; font-weight: 600; color: var(--red-dark); pointer-events: none; }
.dropzone.on { display: grid; }

/* Schwebende Neu-Schaltfläche (Handy) */
.fab { position: fixed; right: 16px; bottom: calc(var(--tab) + var(--safe-b) + 16px); z-index: 25; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--red); color: #fff; box-shadow: 0 8px 24px rgba(227, 0, 15, .35); display: none; place-items: center; }
.fab .ico { width: 26px; height: 26px; stroke-width: 2.2; }
@media (max-width: 820px) { .fab { display: grid; } .toolbar .btn-new { display: none; } }

/* ------------------------------------------------------------ Menüs, Dialoge, Hinweise */
.menu-backdrop { position: fixed; inset: 0; z-index: 70; }
.menu { position: fixed; z-index: 71; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; background: none; border-radius: 8px; text-align: left; font-weight: 500; }
.menu button:hover { background: var(--bg); }
.menu button.danger { color: var(--red-dark); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu .menu-title { padding: 8px 12px 6px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) {
  .menu-backdrop { background: rgba(10, 12, 16, .38); }
  .menu { left: 0 !important; right: 0; top: auto !important; bottom: 0; border-radius: 18px 18px 0 0; padding: 8px 10px calc(10px + var(--safe-b)); border: 0; }
  .menu button { min-height: 52px; font-size: 17px; }
}

dialog { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow-lg); color: var(--ink); background: #fff; overflow: hidden; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(10, 12, 16, .45); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; }
.dlg-body { padding: 8px 18px 6px; overflow: auto; flex: 1; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px calc(16px + var(--safe-b) * 0); border-top: 1px solid var(--line); margin-top: 10px; flex-wrap: wrap; }
dialog.wide { width: min(760px, calc(100vw - 24px)); }
@media (max-width: 820px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .dlg-foot { padding-bottom: calc(14px + var(--safe-b)); }
  .dlg-foot .btn { flex: 1; }
}

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab) + var(--safe-b) + 84px); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 460px); }
@media (min-width: 821px) { .toasts { bottom: 28px; } }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 15px; box-shadow: var(--shadow-lg); pointer-events: auto; animation: toast-in .18s ease-out; }
.toast.err { background: var(--red-dark); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Upload-Fortschritt */
.uploads { position: fixed; right: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); z-index: 80; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
@media (max-width: 820px) { .uploads { right: 8px; left: 8px; width: auto; bottom: calc(var(--tab) + var(--safe-b) + 8px); } }
.uploads-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.uploads-list { max-height: 220px; overflow: auto; }
.up { padding: 9px 14px; font-size: 14px; }
.up-top { display: flex; justify-content: space-between; gap: 10px; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-state { color: var(--muted); white-space: nowrap; }
.up-state.err { color: var(--red-dark); }
.bar { height: 5px; background: var(--line); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--red); width: 0; transition: width .15s linear; }

/* ------------------------------------------------------------ Verwaltung */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--red); font-weight: 600; }
.cap { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fff; }
.cap h3 { display: flex; align-items: center; gap: 8px; }
.cap p { font-size: 14px; color: var(--muted); margin: 3px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 14px; font-weight: 500; }
.chip button { border: 0; background: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); padding: 0; }
.chip button:hover { background: #e3e6ea; color: var(--ink); }
.chip .ico { width: 14px; height: 14px; }
.chip.missing { border-style: dashed; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.copybox { display: flex; gap: 8px; }
.copybox input { flex: 1; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.check-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.check-row:last-child { border-bottom: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.warn { background: #e5a000; } .dot.fail { background: var(--red); }
.steps { padding-left: 20px; margin: 8px 0 14px; } .steps li { margin-bottom: 6px; }
.log-row { display: grid; grid-template-columns: 150px 120px 130px 1fr; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.log-row:last-child { border-bottom: 0; }
@media (max-width: 820px) { .log-row { grid-template-columns: 1fr 1fr; } .log-row span:nth-child(4) { grid-column: 1 / -1; color: var(--muted); } }

/* ------------------------------------------------------------ Viewer (PDF, Bild, Video) */
.viewer { position: fixed; inset: 0; z-index: 100; background: #e9ebef; display: flex; flex-direction: column; }
.viewer-inline { position: fixed; }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 10px 8px; background: #fff; border-bottom: 1px solid var(--line); flex: none; }
.viewer-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-page { color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.viewer-stage { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; position: relative; overscroll-behavior: contain; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px; min-width: min-content; transform-origin: 0 0; }
.pdf-page { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); flex: none; position: relative; }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.viewer-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); pointer-events: none; }
.viewer-msg.err { color: var(--red-dark); pointer-events: auto; }
.viewer-img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.viewer-stage.center { display: flex; }
.viewer-media { max-width: 100%; max-height: 100%; margin: auto; }
.spin { width: 26px; height: 26px; border: 3px solid var(--line-2); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } .toast { animation: none; } * { scroll-behavior: auto !important; } }

/* ------------------------------------------------------------ Öffentliche Freigabeseite */
.share-page { background: var(--bg); }
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(12px + var(--safe-t)) 20px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.sp-logo { display: flex; align-items: flex-end; gap: 8px; text-decoration: none; }
.sp-logo img { height: 44px; width: auto; }
.sp-owner { color: var(--muted); font-size: 14px; text-align: right; }
.sp-main { max-width: 860px; margin: 0 auto; padding: 24px 16px 60px; }
.sp-narrow { max-width: 480px; }
.sp-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; }
.sp-card h1 { margin-bottom: 8px; }
.sp-center { text-align: center; }
.sp-bigicon { display: grid; place-items: center; margin-bottom: 14px; }
.sp-bigicon .fi { width: 72px; height: 72px; font-size: 18px; border-radius: 18px; }
.sp-filename { font-size: 20px; word-break: break-word; }
.sp-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.sp-list { padding: 0; overflow: hidden; }
.sp-list .crumbs, .sp-listhead { padding: 14px 18px 0; }
.sp-listhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sp-listhead h1 { font-size: 22px; margin: 0; }
.sp-list .row-main { color: inherit; }
.sp-list .row .btn { margin-right: 12px; }
.sp-viewer { background: #e9ebef; }
