/* LeBruuhbliothek – Old-Apple-Style (iTunes 9/10, iBooks-Holzregal, Aqua-Knöpfe) */

:root {
  --font: "Lucida Grande", "Lucida Sans Unicode", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ink: #1d1d1d;
  --muted: #6b6f75;
  --line: #a9a9a9;
  --metal-top: #ececec;
  --metal-mid: #d4d4d4;
  --metal-bot: #b9b9b9;
  --metal-edge: #6f6f6f;
  --source: #dde4ec;
  --source-line: #a8b3bf;
  --source-head: #6d7986;
  --sel-top: #69a3e6;
  --sel-bot: #2c67c2;
  --zebra: #edf3fe;
  --lcd-top: #f7f8ef;
  --lcd-bot: #dfe3cd;
  --lcd-edge: #7e826f;
  --wood-a: #8b5a30;
  --wood-b: #7a4c26;
  --wood-c: #9b6738;
  --aqua-edge: #3a69a6;
  --danger: #c0281e;
  --tb-h: 66px;
  --mini-h: 0px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 13px/1.4 var(--font); color: var(--ink); background: #f3f3f3;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: #1d58b8; }
svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- Knöpfe */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; min-height: 26px;
  border: 1px solid #8b8b8b; border-radius: 13px; text-decoration: none; color: #111; white-space: nowrap;
  background: linear-gradient(#fff 0%, #f1f1f1 48%, #dcdcdc 52%, #eaeaea 100%);
  box-shadow: 0 1px 1px rgba(0,0,0,.18), inset 0 1px 0 #fff; text-shadow: 0 1px 0 #fff;
}
.btn:hover { border-color: #6d6d6d; }
.btn:active { background: linear-gradient(#cfcfcf, #e6e6e6); box-shadow: inset 0 1px 3px rgba(0,0,0,.3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 15px; height: 15px; }
/* Aqua-Blau */
.btn.primary {
  color: #08254d; border-color: var(--aqua-edge); text-shadow: 0 1px 0 rgba(255,255,255,.6);
  background: linear-gradient(#d5e9ff 0%, #9cc8f6 48%, #69a7ee 52%, #a8d4fb 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.8);
}
.btn.primary:active { background: linear-gradient(#5d97dc, #8fc0f2); }
.btn.danger { color: var(--danger); }
.btn.danger-solid {
  color: #fff; border-color: #84130d; text-shadow: 0 -1px 0 rgba(0,0,0,.35);
  background: linear-gradient(#f39a92 0%, #e0493d 48%, #c9271b 52%, #e45a4c 100%);
}
.btn.big { padding: 7px 20px; min-height: 32px; border-radius: 16px; font-size: 14px; }
.btn.sm { padding: 2px 10px; min-height: 22px; font-size: 12px; }

/* runde Metallknöpfe wie bei iTunes */
.round {
  display: grid; place-items: center; border-radius: 50%; border: 1px solid #5f5f5f; color: #2b2b2b;
  background: radial-gradient(circle at 50% 30%, #fff 0%, #ececec 40%, #bdbdbd 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.8), inset 0 1px 1px #fff, 0 1px 3px rgba(0,0,0,.25);
}
.round:active { background: radial-gradient(circle at 50% 70%, #f5f5f5, #a9a9a9); }
.round.sm { width: 30px; height: 30px; }
.round.sm svg { width: 13px; height: 13px; }
.round.lg { width: 42px; height: 42px; }
.round.lg svg { width: 19px; height: 19px; }
.round:disabled { opacity: .55; cursor: default; }

/* ---------------------------------------------------------------- Werkzeugleiste */
.toolbar {
  position: fixed; inset: 0 0 auto 0; height: var(--tb-h); z-index: 30;
  display: grid; grid-template-columns: auto minmax(260px, 560px) 1fr; align-items: center; gap: 22px;
  padding: 0 16px; justify-content: space-between;
  background: linear-gradient(var(--metal-top), var(--metal-mid) 60%, var(--metal-bot));
  border-bottom: 1px solid var(--metal-edge); box-shadow: inset 0 1px 0 #fafafa;
}
.toolbar > .search { justify-self: end; }
.tb-menu { display: none; }
.transport { display: flex; align-items: center; gap: 8px; }

.lcd {
  height: 50px; border-radius: 6px; border: 1px solid var(--lcd-edge); overflow: hidden; justify-self: center; width: 100%;
  background: linear-gradient(var(--lcd-top), var(--lcd-bot));
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.7);
}
.lcd-empty { height: 100%; display: grid; place-items: center; }
.lcd-logo { font-size: 15px; letter-spacing: .5px; color: #4a4d40; text-shadow: 0 1px 0 #fff; }
.lcd-logo::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px;
  background: url("/img/favicon-32.png") center / contain no-repeat; }
.lcd-body { display: flex; height: 100%; }
.lcd-cover { height: 100%; aspect-ratio: 1; object-fit: cover; border-right: 1px solid var(--lcd-edge); cursor: pointer; background: #c9ccb9; }
.lcd-text { flex: 1; min-width: 0; padding: 3px 10px 0; text-align: center; cursor: default; }
.lcd-title, .lcd-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 0 rgba(255,255,255,.8); }
.lcd-title { font-weight: bold; font-size: 12px; color: #262820; }
.lcd-sub { font-size: 11px; color: #555848; }
.lcd-scrub { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #4e5143; font-variant-numeric: tabular-nums; }
.lcd-scrub input { flex: 1; }

/* Schieberegler */
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; height: 14px; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; border: 1px solid #6c705e;
  background: linear-gradient(90deg, #5a5e4c var(--p, 0%), #f3f4ea var(--p, 0%)); }
input[type=range]::-moz-range-track { height: 5px; border-radius: 3px; border: 1px solid #6c705e; background: #f3f4ea; }
input[type=range]::-moz-range-progress { height: 5px; border-radius: 3px; background: #5a5e4c; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 9px; height: 9px; margin-top: -3px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, #8a8d7c); border: 1px solid #44473a; }
input[type=range]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 1px solid #44473a; }

.search { display: flex; align-items: center; gap: 4px; width: min(240px, 100%); height: 24px; padding: 0 9px;
  border-radius: 12px; border: 1px solid #838383; background: #fff; box-shadow: inset 0 1px 2px rgba(0,0,0,.3), 0 1px 0 rgba(255,255,255,.6); }
.search svg { width: 13px; height: 13px; color: #777; }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; background: transparent; font-size: 12px; }

/* ---------------------------------------------------------------- Rahmen */
.shell { position: fixed; inset: var(--tb-h) 0 var(--mini-h) 0; display: grid; grid-template-columns: 196px 1fr; }
.sidebar {
  background: var(--source); border-right: 1px solid var(--source-line); overflow-y: auto; padding: 8px 0 60px;
  display: flex; flex-direction: column; position: relative; z-index: 20;
}
.sb-head { padding: 12px 12px 3px; font-size: 11px; font-weight: bold; text-transform: uppercase; color: var(--source-head);
  text-shadow: 0 1px 0 rgba(255,255,255,.7); letter-spacing: .3px; }
.sidebar a { display: flex; align-items: center; gap: 7px; padding: 4px 12px 4px 20px; color: #1c1c1c; text-decoration: none;
  border-top: 1px solid transparent; border-bottom: 1px solid transparent; }
.sidebar a svg { width: 16px; height: 16px; color: #5a6e86; }
.sidebar a:hover { background: rgba(255,255,255,.35); }
.sidebar a.active { color: #fff; font-weight: bold; text-shadow: 0 -1px 0 rgba(0,0,0,.3);
  background: linear-gradient(var(--sel-top), var(--sel-bot)); border-color: #3f74c4 #3f74c4 #2155a8; }
.sidebar a.active svg { color: #fff; }
.sidebar a.parent { cursor: pointer; }
.tri { margin-left: auto; width: 0; height: 0; border-style: solid; border-width: 4px 0 4px 6px; border-color: transparent transparent transparent #6d7986;
  transition: transform .15s; }
.sidebar a.parent[aria-expanded="true"] .tri { transform: rotate(90deg); }
.sidebar a.parent.active-child { font-weight: bold; }
.subnav a { padding-left: 44px; }
.count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 9px; background: #8f9caf; color: #fff;
  font-size: 11px; font-weight: bold; text-align: center; text-shadow: none; }
.count:empty { display: none; }
.sidebar a.active .count { background: #fff; color: var(--sel-bot); }
.sb-foot { margin-top: auto; position: sticky; bottom: -60px; padding: 10px 8px 0; }
.sb-user { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 8px; border: 1px solid var(--source-line);
  border-radius: 5px; background: linear-gradient(#f4f6f8, #d3dae2); color: #222; text-align: left; }
.sb-user span:not(.caret) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popup { position: absolute; bottom: 44px; left: 8px; right: 8px; background: rgba(255,255,255,.97); border: 1px solid #999;
  border-radius: 5px; box-shadow: 0 6px 18px rgba(0,0,0,.3); padding: 4px 0; z-index: 50; }
.popup button { display: block; width: 100%; padding: 4px 14px; border: 0; background: none; text-align: left; }
.popup button:hover { background: linear-gradient(var(--sel-top), var(--sel-bot)); color: #fff; }
.scrim { display: none; }

.content { overflow-y: auto; position: relative; -webkit-overflow-scrolling: touch; }

/* ---------------------------------------------------------------- Holzregal (iBooks) */
.content.wood {
  background-color: var(--wood-a);
  background-image:
    repeating-linear-gradient(92deg, rgba(255,255,255,.035) 0 2px, transparent 2px 7px, rgba(0,0,0,.04) 7px 9px, transparent 9px 16px),
    linear-gradient(90deg, var(--wood-b), var(--wood-c) 30%, var(--wood-a) 55%, var(--wood-c) 80%, var(--wood-b));
}
.section-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 7px 16px; min-height: 38px;
  background: linear-gradient(#f6f6f6, #d9d9d9); border-bottom: 1px solid #8e8e8e; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.section-bar h1 { margin: 0; font-size: 14px; text-shadow: 0 1px 0 #fff; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-bar select { font-size: 12px; }
.seg { display: inline-flex; border: 1px solid #8b8b8b; border-radius: 5px; overflow: hidden; box-shadow: 0 1px 1px rgba(0,0,0,.15); }
.seg button { border: 0; border-left: 1px solid #9a9a9a; padding: 2px 10px; font-size: 12px;
  background: linear-gradient(#fff, #e9e9e9 50%, #dadada 51%, #ececec); text-shadow: 0 1px 0 #fff; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: linear-gradient(#7e8a97, #9aa6b3); color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,.4);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35); }

.shelf-title { margin: 20px 22px 0; color: #f8e7cf; font-size: 15px; text-shadow: 0 -1px 0 rgba(0,0,0,.6); font-weight: bold; }
.shelf-title small { font-weight: normal; opacity: .8; margin-left: 8px; font-size: 12px; }
.shelf { position: relative; display: flex; align-items: flex-end; gap: var(--gap, 28px); padding: 22px 24px 0; min-height: 200px; }
.shelf::after { /* das Brett */
  content: ""; position: absolute; left: 0; right: 0; bottom: -17px; height: 20px; z-index: 0;
  background: linear-gradient(#c88f58 0%, #a4683a 18%, #8a542b 60%, #5d3518 100%);
  box-shadow: 0 9px 14px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,230,200,.5);
}
.shelf + .shelf, .shelf-title + .shelf { margin-top: 0; }
.shelf { margin-bottom: 38px; }
.shelf-empty { color: #f3dfc4; text-shadow: 0 -1px 0 rgba(0,0,0,.6); padding: 30px 26px 50px; font-size: 14px; }

.tile { position: relative; z-index: 1; width: var(--w, 130px); flex: none; cursor: pointer; text-decoration: none; color: inherit;
  -webkit-tap-highlight-color: transparent; }
.cover { position: relative; display: block; width: 100%; box-shadow: 2px 3px 6px rgba(0,0,0,.55); background: #ddd;
  transition: transform .15s; overflow: hidden; }
.tile:hover .cover { transform: translateY(-3px); }
.cover.square { aspect-ratio: 1; }
.cover.portrait { aspect-ratio: 2 / 3; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Glanzkante links wie ein Buchrücken */
.cover.portrait::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 9px;
  background: linear-gradient(90deg, rgba(0,0,0,.25), rgba(255,255,255,.25) 40%, transparent); }
.cover.square::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.28), transparent 45%); }
/* Platzhalter-Cover (Leder-Look) */
.fallback { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 12px;
  text-align: center; color: #fbf3e2; text-shadow: 0 1px 1px rgba(0,0,0,.6); background: var(--fb, #5a3a6e);
  background-image: radial-gradient(circle at 30% 20%, rgba(255,255,255,.22), transparent 60%),
    repeating-linear-gradient(45deg, rgba(0,0,0,.04) 0 2px, transparent 2px 4px);
  box-shadow: inset 0 0 0 4px rgba(0,0,0,.15), inset 0 0 0 5px rgba(255,236,200,.35); }
.fallback b { font-family: Georgia, "Times New Roman", serif; font-size: calc(var(--w, 130px) * .11); line-height: 1.2;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.fallback span { font-size: calc(var(--w, 130px) * .08); opacity: .85; }
.badge { position: absolute; right: 4px; bottom: 4px; z-index: 2; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(20,20,20,.65); color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.badge svg { width: 12px; height: 12px; }
.badge.done { background: linear-gradient(#7bc95d, #3f9a2a); }
.tile .prog { position: absolute; left: 0; right: 0; bottom: -9px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.4); overflow: hidden; z-index: 2; }
.tile .prog i { display: block; height: 100%; background: linear-gradient(#a8d4fb, #4b8fe0); }
.tile-cap { display: none; }

/* Listenansicht (iTunes-Tabelle) */
.table { width: 100%; border-collapse: collapse; background: #fff; font-size: 12px; }
.table th { position: sticky; top: 38px; text-align: left; font-weight: normal; padding: 3px 8px; border-right: 1px solid #c4c4c4;
  border-bottom: 1px solid #9c9c9c; background: linear-gradient(#fafafa, #dedede); color: #333; z-index: 2; white-space: nowrap; }
.table td { padding: 4px 8px; border-right: 1px solid #e6eaf0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.table tbody tr:nth-child(even) td { background: var(--zebra); }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: #dbe6f7; }
.table tbody tr.sel td { background: linear-gradient(var(--sel-top), var(--sel-bot)) !important; color: #fff; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; color: #555; }
.table tr.sel td.num { color: #fff; }

/* ---------------------------------------------------------------- Detailseite */
.content.paper { background: #f0f0f0 repeating-linear-gradient(#f6f6f6 0 2px, #ececec 2px 4px); }
.detail { display: grid; grid-template-columns: 260px 1fr; gap: 30px; padding: 26px 30px 40px; max-width: 1100px; }
.detail .art { --w: 260px; }
.detail .art .cover { -webkit-box-reflect: below 2px linear-gradient(transparent 70%, rgba(255,255,255,.28)); box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.detail .art .tile:hover .cover, .detail .art .cover { transform: none; }
.detail h1 { margin: 0 0 2px; font-size: 22px; line-height: 1.2; text-shadow: 0 1px 0 #fff; }
.detail .by { font-size: 15px; color: #444; margin-bottom: 10px; }
.detail .by a { color: #1d58b8; text-decoration: none; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.desc { white-space: pre-line; max-width: 70ch; color: #333; margin: 0 0 18px; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.more { border: 0; background: none; color: #1d58b8; padding: 0; margin: -12px 0 18px; }
.progress-line { display: flex; align-items: center; gap: 10px; color: #555; font-size: 12px; margin-bottom: 10px; }
.bar { flex: 0 1 220px; height: 8px; border-radius: 4px; border: 1px solid #8a8a8a; background: linear-gradient(#ddd, #f6f6f6); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(#a8d4fb, #4b8fe0 60%, #3d7fd2); }
.panel { border: 1px solid #9c9c9c; border-radius: 4px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.panel .table th { top: 0; }
.chapters td.dl { width: 34px; text-align: center; padding: 0; }
.chapters td.dl a { display: inline-grid; place-items: center; width: 24px; height: 20px; color: inherit; opacity: .55; }
.chapters td.dl a:hover { opacity: 1; }
.chapters td.dl svg { width: 14px; height: 14px; }
.chapters .now td:first-child::before { content: "▶"; font-size: 9px; margin-right: 5px; color: #3a75d1; }
.chapters tr.sel.now td:first-child::before { color: #fff; }
.classic-tag { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 10px; padding: 1px 9px; border-radius: 9px; font-size: 11px;
  color: #6b4a1f; background: linear-gradient(#fbf1dc, #ecd9b4); border: 1px solid #c9a86e; text-shadow: 0 1px 0 #fff; }
.formats { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-tools { margin-top: 26px; padding-top: 12px; border-top: 1px solid #c8c8c8; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- Formular-Seiten (Hochladen, Nutzer) */
.page { padding: 24px 30px 50px; max-width: 900px; }
.page h1 { font-size: 20px; margin: 0 0 4px; text-shadow: 0 1px 0 #fff; }
.lead { color: #555; margin: 0 0 18px; max-width: 70ch; }
.box { background: #fff; border: 1px solid #a5a5a5; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.15); margin-bottom: 20px; overflow: hidden; }
.box-h { padding: 6px 12px; background: linear-gradient(#f8f8f8, #dcdcdc); border-bottom: 1px solid #a5a5a5; font-weight: bold; text-shadow: 0 1px 0 #fff;
  display: flex; align-items: center; gap: 8px; }
.box-b { padding: 14px; display: grid; gap: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 3px; font-size: 12px; color: #333; }
.field input, .field select, .field textarea, .app-dialog input, .app-dialog select, .app-dialog textarea {
  padding: 4px 7px; border: 1px solid #8f8f8f; border-radius: 3px; background: #fff; font-size: 13px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.2); }
.field input:focus, .field textarea:focus, .app-dialog input:focus { outline: none; border-color: #5b8fd6; box-shadow: 0 0 0 3px rgba(94,150,230,.55); }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
.hint code { background: #eef; padding: 0 4px; border-radius: 3px; }
.drop { border: 2px dashed #9fb3cc; border-radius: 8px; padding: 18px; text-align: center; color: #48607d; background: #f5f9ff; cursor: pointer; }
.drop.over { background: #e1edfd; border-color: #4b8fe0; }
.uplist { display: grid; gap: 4px; font-size: 12px; }
.uplist .u { display: grid; grid-template-columns: 1fr 140px 60px; gap: 8px; align-items: center; }
.uplist .u span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uplist .u.err { color: var(--danger); }
.uplist .u .bar { flex: none; }

.user-list { display: grid; }
.user-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 12px; border-top: 1px solid #e3e3e3; align-items: center; }
.user-row:nth-child(even) { background: var(--zebra); }
.user-row:first-child { border-top: 0; }
.ur-meta { color: var(--muted); font-size: 12px; }
.ur-actions { grid-row: 1 / 3; grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tag { display: inline-block; font-size: 10px; font-weight: bold; padding: 0 6px; border-radius: 8px; margin-left: 6px; vertical-align: 1px;
  background: #8f9caf; color: #fff; }
.tag.ok { background: #5aa83e; }

/* Autorenliste */
.authors { columns: 3 220px; column-gap: 0; background: #fff; }
.authors a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 16px; color: #111; text-decoration: none; break-inside: avoid; border-bottom: 1px solid #eef1f5; }
.authors a:hover { background: #dbe6f7; }
.authors a span { color: var(--muted); font-size: 12px; }
.letter { padding: 2px 16px; background: linear-gradient(#e9edf2, #d3d9e0); font-weight: bold; color: #4d5967; font-size: 11px; break-inside: avoid; border-bottom: 1px solid #b8c1cc; }

/* ---------------------------------------------------------------- Dialoge (Mac-OS-X-"Sheet") */
.app-dialog { border: 1px solid #777; border-radius: 0 0 8px 8px; padding: 0; width: min(440px, calc(100vw - 32px));
  box-shadow: 0 14px 40px rgba(0,0,0,.5); background: #ececec repeating-linear-gradient(#f2f2f2 0 2px, #e9e9e9 2px 4px); }
.app-dialog::backdrop { background: rgba(0,0,0,.25); }
.app-dialog .dh { padding: 5px; text-align: center; background: linear-gradient(#e8e8e8, #bfbfbf); border-bottom: 1px solid #8a8a8a; text-shadow: 0 1px 0 #fff; font-size: 13px; }
.app-dialog .db { padding: 16px 18px 6px; display: grid; gap: 10px; }
.app-dialog .db p { margin: 0; }
.app-dialog .df { padding: 10px 18px 16px; display: flex; justify-content: flex-end; gap: 8px; }
.dlg-field { display: grid; gap: 3px; font-size: 12px; }
.cred-msg { width: 100%; font: 12px/1.4 Menlo, Monaco, monospace; padding: 8px; border: 1px solid #999; border-radius: 3px; resize: vertical; }
.choice-list { display: grid; gap: 0; border: 1px solid #a5a5a5; border-radius: 5px; overflow: hidden; background: #fff; max-height: 50vh; overflow-y: auto; }
.choice-list button { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; border: 0; border-top: 1px solid #e4e4e4; background: #fff; text-align: left; }
.choice-list button:first-child { border-top: 0; }
.choice-list button:nth-child(even) { background: var(--zebra); }
.choice-list button.on, .choice-list button:hover { background: linear-gradient(var(--sel-top), var(--sel-bot)); color: #fff; }
.choice-list button small { opacity: .7; font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: calc(var(--mini-h) + 24px); transform: translateX(-50%); z-index: 100;
  background: rgba(30,30,30,.86); color: #fff; padding: 8px 18px; border-radius: 18px; box-shadow: 0 4px 14px rgba(0,0,0,.35); max-width: calc(100vw - 32px); }

/* ---------------------------------------------------------------- Mini-Player (nur Handy) */
.miniplayer { display: none; }

/* ---------------------------------------------------------------- Jetzt läuft (iPod/iOS-6) */
.nowplaying { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr auto; color: #fff;
  background: #000; animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.np-bar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  background: linear-gradient(rgba(120,120,120,.9), rgba(40,40,40,.95) 50%, rgba(10,10,10,.95) 51%, rgba(30,30,30,.95)); border-bottom: 1px solid #000; }
.np-head { text-align: center; line-height: 1.25; text-shadow: 0 -1px 0 #000; min-width: 0; }
.np-head span, .np-head b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-head span { font-size: 12px; color: #c9c9c9; }
.np-head b { font-size: 14px; }
.glass-btn { width: 40px; height: 32px; display: grid; place-items: center; border-radius: 5px; color: #fff; border: 1px solid #111;
  background: linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.08) 50%, rgba(0,0,0,.2) 51%, rgba(255,255,255,.08)); }
.np-art { position: relative; display: grid; place-items: center; overflow: hidden; padding: 16px; min-height: 0; }
.np-art img, .np-fallback { max-width: min(100%, 520px); max-height: 100%; aspect-ratio: 1; object-fit: contain;
  -webkit-box-reflect: below 0 linear-gradient(transparent 75%, rgba(255,255,255,.25)); }
.np-fallback { position: relative; width: min(80vw, 420px); }
.np-controls { padding: 12px 18px max(18px, env(safe-area-inset-bottom)); display: grid; gap: 10px; justify-items: center;
  background: linear-gradient(rgba(70,70,70,.95), rgba(20,20,20,.98) 40%, #000); border-top: 1px solid #555; }
.np-chapter { font-size: 13px; color: #ddd; text-align: center; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-scrub { display: flex; align-items: center; gap: 10px; width: min(100%, 620px); font-size: 11px; color: #bbb; font-variant-numeric: tabular-nums; }
.np-scrub input { flex: 1; }
.np-scrub input::-webkit-slider-runnable-track { border-color: #000; background: linear-gradient(90deg, #4b8fe0 var(--p, 0%), #444 var(--p, 0%)); }
.np-scrub input::-moz-range-track { border-color: #000; background: #444; }
.np-scrub input::-moz-range-progress { background: #4b8fe0; }
.np-left { font-size: 11px; color: #999; margin-top: -6px; }
.np-buttons { display: flex; align-items: center; gap: 18px; }
.np-btn { position: relative; border: 0; background: none; color: #fff; padding: 6px; display: grid; place-items: center; filter: drop-shadow(0 -1px 0 #000); }
.np-btn svg { width: 26px; height: 26px; }
.np-btn.big svg { width: 44px; height: 44px; }
.np-btn small { position: absolute; bottom: -6px; left: 0; right: 0; font-size: 9px; color: #aaa; }
.np-btn:active { color: #9cc8f6; }
.np-extra { display: flex; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 14px; color: #fff; border: 1px solid #000; font-size: 12px;
  background: linear-gradient(#5c5c5c, #2c2c2c 50%, #1a1a1a 51%, #333); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.pill svg { width: 13px; height: 13px; }
.pill.on { background: linear-gradient(#7fb2ee, #3a77d1 50%, #2b64bd 51%, #4f8be0); }

/* ---------------------------------------------------------------- E-Book-Leser */
.reader { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: auto 1fr auto; background: var(--page-bg, #fbf8f1); }
.reader.sepia { --page-bg: #f4ecd8; }
.reader.night { --page-bg: #1c1c1c; }
.r-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: max(6px, env(safe-area-inset-top)) 10px 6px;
  background: linear-gradient(#f2f2f2, #cfcfcf); border-bottom: 1px solid #7a7a7a; }
.reader.night .r-bar { background: linear-gradient(#4a4a4a, #262626); border-color: #000; color: #eee; }
.r-title { text-align: center; font-size: 13px; text-shadow: 0 1px 0 rgba(255,255,255,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader.night .r-title { text-shadow: none; }
.r-tools { display: flex; gap: 6px; }
/* iOS-6-Zurück-Knopf mit Pfeilspitze */
.back-btn { position: relative; height: 28px; padding: 0 10px 0 14px; margin-left: 8px; border: 1px solid #7d7d7d; border-left: 0; border-radius: 0 5px 5px 0;
  background: linear-gradient(#fdfdfd, #e3e3e3 50%, #d3d3d3 51%, #e6e6e6); font-size: 12px; font-weight: bold; text-shadow: 0 1px 0 #fff; color: #333; }
.back-btn::before { content: ""; position: absolute; left: -10px; top: 3px; width: 20px; height: 20px; transform: rotate(45deg) skew(8deg, 8deg);
  border: 1px solid #7d7d7d; border-top: 0; border-right: 0; border-radius: 0 0 0 4px; background: linear-gradient(-45deg, #e6e6e6, #d3d3d3 49%, #e3e3e3 50%, #fdfdfd); z-index: -1; }
.back-btn { isolation: isolate; z-index: 0; }
.r-stage { position: relative; min-height: 0; }
#rView { position: absolute; inset: 14px 54px 6px; }
.r-nav { position: absolute; top: 0; bottom: 0; width: 50px; border: 0; background: none; color: #999; display: grid; place-items: center; z-index: 2; }
.r-nav:hover { color: #555; background: rgba(0,0,0,.03); }
.r-nav.prev { left: 0; } .r-nav.next { right: 0; }
.r-nav svg { width: 30px; height: 30px; }
.r-foot { display: flex; justify-content: center; gap: 12px; padding: 4px 10px max(8px, env(safe-area-inset-bottom)); font-size: 11px; color: #8a8a8a; }
.r-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #888; font-size: 14px; }
.r-pop { position: absolute; top: 46px; right: 10px; z-index: 5; width: min(320px, calc(100vw - 20px)); max-height: 70vh; overflow-y: auto;
  background: #fff; border: 1px solid #888; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.35); color: #111; }
.r-pop .box-b { gap: 10px; }
.toc a { display: block; padding: 6px 14px; color: #111; text-decoration: none; border-top: 1px solid #eee; }
.toc a.sub { padding-left: 30px; font-size: 12px; }
.toc a:hover { background: linear-gradient(var(--sel-top), var(--sel-bot)); color: #fff; }
.themes { display: flex; gap: 8px; }
.themes button { flex: 1; height: 36px; border-radius: 6px; border: 1px solid #888; }
.themes button.on { box-shadow: 0 0 0 3px #4b8fe0; }
.sizes { display: flex; align-items: center; gap: 10px; justify-content: center; }
.sizes span { min-width: 48px; text-align: center; color: #555; }

/* ---------------------------------------------------------------- Anmeldung */
body.login-page { overflow: auto; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: #e4e4e4 repeating-linear-gradient(#ececec 0 2px, #e0e0e0 2px 4px); }
.window { width: min(400px, 100%); background: #ececec; border: 1px solid #8a8a8a; border-radius: 6px 6px 4px 4px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35); overflow: hidden; }
.titlebar { position: relative; height: 22px; text-align: center; font-size: 13px; line-height: 22px; text-shadow: 0 1px 0 #fff;
  background: linear-gradient(#ececec, #c8c8c8); border-bottom: 1px solid #8f8f8f; }
.lights { position: absolute; left: 8px; top: 4px; display: flex; gap: 7px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.35); }
.lights i:nth-child(1) { background: radial-gradient(circle at 50% 30%, #ffb4a8, #e0443a 60%); }
.lights i:nth-child(2) { background: radial-gradient(circle at 50% 30%, #ffe6a0, #e6a823 60%); }
.lights i:nth-child(3) { background: radial-gradient(circle at 50% 30%, #c9f2a8, #4eb22e 60%); }
.window-body { padding: 26px 34px 26px; display: grid; gap: 14px; justify-items: center; }
.window-body img { width: 112px; height: 112px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.window-body h1 { margin: 0; font-size: 18px; text-shadow: 0 1px 0 #fff; }
.window-body form { width: 100%; display: grid; gap: 10px; }
.window-body .btn { justify-self: end; }
.error { width: 100%; padding: 7px 10px; border-radius: 4px; background: #fde9e7; border: 1px solid #e0928a; color: #8d1b12; font-size: 12px; }

/* ---------------------------------------------------------------- Handy & Tablet */
@media (max-width: 860px) {
  :root { --tb-h: 48px; }
  body.has-player { --mini-h: 62px; }
  .toolbar { grid-template-columns: auto 1fr; gap: 10px; padding: 0 10px; padding-top: env(safe-area-inset-top); height: calc(var(--tb-h) + env(safe-area-inset-top)); }
  .shell { top: calc(var(--tb-h) + env(safe-area-inset-top)); bottom: calc(var(--mini-h) + env(safe-area-inset-bottom)); grid-template-columns: 1fr; }
  .tb-menu { display: grid; place-items: center; width: 36px; height: 30px; border: 1px solid #7b7b7b; border-radius: 5px;
    background: linear-gradient(#fdfdfd, #e3e3e3 50%, #d3d3d3 51%, #e6e6e6); color: #444; }
  .transport, .lcd { display: none; }
  .toolbar > .search { width: 100%; justify-self: stretch; height: 28px; }
  .search input { font-size: 16px; }  /* kein Zoom auf iOS */
  .sidebar { position: fixed; top: calc(var(--tb-h) + env(safe-area-inset-top)); bottom: 0; left: 0; width: 250px; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: 4px 0 18px rgba(0,0,0,.3); padding-bottom: 20px; }
  .sidebar.open { transform: none; }
  .sidebar a { padding: 9px 14px 9px 22px; font-size: 15px; }
  .subnav a { padding-left: 48px; }
  .sb-foot { position: static; padding-bottom: env(safe-area-inset-bottom); }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 19; }
  .scrim.hidden { display: none; }

  .miniplayer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--mini-h) + env(safe-area-inset-bottom));
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px;
    background: linear-gradient(var(--metal-top), var(--metal-mid) 60%, var(--metal-bot)); border-top: 1px solid var(--metal-edge); cursor: pointer; }
  .miniplayer.hidden { display: none; }
  .miniplayer img { width: 44px; height: 44px; object-fit: cover; border: 1px solid #888; background: #ccc; }
  .mini-text { flex: 1; min-width: 0; display: grid; text-shadow: 0 1px 0 #fff; }
  .mini-text b, .mini-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mini-text span { font-size: 12px; color: #555; }
  .miniplayer .round { width: 38px; height: 38px; }
  .mini-bar { position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: rgba(0,0,0,.15); }
  .mini-bar i { display: block; height: 100%; background: #4b8fe0; width: 0; }

  .shelf { padding: 16px 14px 0; min-height: 150px; }
  .shelf-title { margin: 16px 14px 0; }
  .detail { grid-template-columns: 1fr; padding: 18px 16px 30px; gap: 18px; }
  .detail .art { --w: min(240px, 62vw); justify-self: center; margin-bottom: 30px; }
  .detail h1 { font-size: 19px; }
  .page { padding: 18px 16px 40px; }
  .row2 { grid-template-columns: 1fr; }
  .uplist .u { grid-template-columns: 1fr 80px 46px; }
  .table .hide-sm { display: none; }
  .table td { max-width: 52vw; }
  #rView { inset: 10px 14px 4px; }
  .r-nav { width: 26%; color: transparent; }
  .r-nav:hover { background: none; color: transparent; }
  .section-bar { padding: 6px 12px; flex-wrap: wrap; }
  .user-row { grid-template-columns: 1fr; }
  .ur-actions { grid-row: auto; grid-column: 1; justify-content: flex-start; }
}
