/* Comb: Dateien. Nutzt die Farben und Schrift aus avolie.css. */
/* Gestaltung: alles Veränderliche steht hier als Variable. Ein eigenes Design (Farben, Tempo, Umblättern) überschreibt nur diese Werte,
   zum Beispiel pro Firma über :root oder [data-design="..."]. Bewegung lässt sich mit data-motion="none" am <html> ganz abschalten. */
:root {
  --bk-paper: #fbf8ef; --bk-paper-dark: #1b232c;
  --bk-cover-a: #1d2a37; --bk-cover-b: #0d1319; --bk-foil: #d1a85c; --bk-cover-dots: rgba(209, 168, 92, .14);
  --bk-perspective: 2600px; --bk-turn: 900ms; --bk-open: 950ms; --bk-ease: cubic-bezier(.45, .05, .2, 1); --bk-tilt: 1;
  --bk-tab-0: #d1a85c; --bk-tab-1: #e0c07e; --bk-tab-2: #c49a47; --bk-tab-3: #e8d29c; --bk-tab-ink: #1a1405;
  --bk-over-bg: radial-gradient(120% 90% at 50% 0%, #2a3944 0%, #141c24 58%, #0a0f14 100%); --bk-over-ink: #f4efe3; --bk-over-line: rgba(255, 255, 255, .22); --bk-over-in: .3s;
  --fx-hex-video: #7a4fb5; --fx-hex-audio: #b5527a;
  --fx-hex-pdf: #c0392b; --fx-hex-img: #2e8b57; --fx-hex-sheet: #3f7d3a; --fx-hex-doc: #3b6fb0; --fx-hex-zip: #8a6d2b;
  --fx-lift: -2px; --fx-card-ease: .15s;
}
html[data-motion="none"] { --bk-over-in: 0s; --bk-turn: 0ms; --bk-open: 0ms; --bk-tilt: 0; --fx-lift: 0px; --fx-card-ease: 0s; }
.fx { position: relative; display: grid; gap: 16px; outline: none; }
.fx-ic { width: 20px; height: 20px; flex: none; }
.fx-ic--sm { width: 16px; height: 16px; }
.fx-grow { flex: 1; }
.fx-small { font-size: .88rem; }
.fx-pad { padding: 24px 0; }

/* Kopfzeile */
.fx-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.fx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.fx-crumb { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; color: var(--slate); background: none; border: 0; padding: 6px 10px; border-radius: 10px; cursor: pointer; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-crumb:hover { color: var(--ink); background: var(--brass-soft); }
.fx-crumb.is-last { color: var(--ink); cursor: default; }
.fx-crumb.is-drop { background: var(--brass-soft); outline: 2px dashed var(--brass); }
.fx-sep { color: var(--slate); opacity: .6; }
.fx-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fx-tool { display: inline-flex; align-items: center; gap: 8px; }
.fx-searchwrap { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--slate); }
.fx-searchwrap:focus-within { border-color: var(--brass); }
.fx-search { border: 0; background: none; outline: none; padding: 9px 0; width: 11rem; font: inherit; font-size: .95rem; color: var(--ink); min-width: 0; }
.fx-views { display: inline-flex; padding: 3px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); }
.fx-views button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .85rem; font-weight: 700; padding: 6px 12px; border: 0; border-radius: 999px; background: none; color: var(--slate); cursor: pointer; }
.fx-views button:hover { color: var(--ink); }
.fx-views button[aria-pressed="true"] { background: var(--ink); color: var(--chalk); }
.fx-views .fx-ic { width: 16px; height: 16px; }
.fx-iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1.5px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer; padding: 0; }
.fx-iconbtn:hover { border-color: var(--brass); }
.fx-trashbtn[aria-pressed="true"] { background: var(--ink); color: var(--chalk); }
@media (max-width: 720px) { .fx-views span, .fx-tool span { display: none; } .fx-search { width: 7rem; } }

/* Fläche und Detailleiste */
.fx-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 62.01em) { .fx-main.has-panel { grid-template-columns: minmax(0, 1fr) 19.5rem; } .fx-main.has-panel > .fx-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; } }
.fx-stage { min-height: 280px; min-width: 0; }
.fx-sec { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--slate); margin: 18px 0 10px; }
.fx-empty { display: grid; justify-items: center; gap: 10px; padding: 56px 16px; text-align: center; border: 1.5px dashed var(--line); border-radius: var(--radius); }

/* Sechseck-Symbole */
.fx-hex { position: relative; display: inline-grid; place-items: center; width: 44px; height: 48px; flex: none; color: var(--ink); background: var(--brass-soft); clip-path: var(--ic-clip, polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%)); }
.fx-hex .fx-ic { width: 20px; height: 20px; }
.fx-hex__ext { font-size: .68rem; font-weight: 800; letter-spacing: .02em; }
.fx-hex--pdf { background: color-mix(in srgb, var(--fx-hex-pdf) 22%, var(--paper)); }
.fx-hex--img { background: color-mix(in srgb, var(--fx-hex-img) 22%, var(--paper)); }
.fx-hex--sheet { background: color-mix(in srgb, var(--fx-hex-sheet) 20%, var(--paper)); }
.fx-hex--doc { background: color-mix(in srgb, var(--fx-hex-doc) 22%, var(--paper)); }
.fx-hex--video { background: color-mix(in srgb, var(--fx-hex-video) 24%, var(--paper)); }
.fx-hex--audio { background: color-mix(in srgb, var(--fx-hex-audio) 24%, var(--paper)); }
.fx-hex--zip { background: color-mix(in srgb, var(--fx-hex-zip) 26%, var(--paper)); }

/* Karten */
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 12px; }
.fx-card { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); cursor: pointer; transition: border-color var(--fx-card-ease), transform var(--fx-card-ease), box-shadow var(--fx-card-ease); outline: none; min-width: 0; }
.fx-card:hover { border-color: var(--brass); transform: translateY(var(--fx-lift)); box-shadow: 0 10px 26px rgba(23, 32, 43, .08); }
.fx-card:focus-visible, .fx-row:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.fx-card.is-sel, .fx-row.is-sel { border-color: var(--brass); background: var(--brass-soft); }
.fx-card.is-drop, .fx-row.is-drop { border-color: var(--brass); background: var(--brass-soft); outline: 2px dashed var(--brass); }
.fx-card__t { display: grid; gap: 2px; min-width: 0; }
.fx-card__t strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-card__t span { color: var(--slate); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Liste */
.fx-list { container-type: inline-size; display: grid; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--paper); }
.fx-row { display: grid; grid-template-columns: minmax(0, 1fr) 6rem 6rem 7rem 8rem; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; outline: none; }
.fx-row:last-child { border-bottom: 0; }
.fx-row:hover { background: color-mix(in srgb, var(--brass-soft) 50%, transparent); }
.fx-row--head { cursor: default; background: var(--chalk); font-size: .82rem; font-weight: 700; color: var(--slate); text-transform: uppercase; letter-spacing: .03em; padding-block: 8px; }
.fx-row--head:hover { background: var(--chalk); }
.fx-th { font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.fx-th.is-on { color: var(--ink); }
.fx-row__name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fx-row__name .fx-hex { width: 34px; height: 38px; }
.fx-row__name .fx-hex__ext { font-size: .58rem; }
.fx-row__name > div { min-width: 0; display: grid; }
.fx-row__name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-row__path { color: var(--slate); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-row__c { color: var(--slate); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) { .fx-row { grid-template-columns: minmax(0, 1fr) 5rem; } .fx-row > :nth-child(2), .fx-row > :nth-child(4), .fx-row > :nth-child(5) { display: none; } }

/* Detailleiste */
.fx-panel { display: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 18px; gap: 14px; align-content: start; box-shadow: 0 14px 36px rgba(23, 32, 43, .08); }
.fx-panel.is-open { display: grid; }
@media (max-width: 62em) { .fx-panel.is-open { position: fixed; inset: auto 0 0 0; z-index: 70; max-height: 72vh; overflow: auto; border-radius: 18px 18px 0 0; } }
.fx-panel__head { display: flex; align-items: center; gap: 12px; }
.fx-panel__head h2 { flex: 1; font-size: 1.1rem; line-height: 1.2; overflow-wrap: anywhere; }
.fx-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; margin: 0; }
.fx-meta dt { color: var(--slate); }
.fx-meta dd { margin: 0; overflow-wrap: anywhere; }
.fx-acts { display: grid; gap: 6px; }
.fx-act { display: flex; align-items: center; gap: 10px; font: inherit; font-weight: 700; text-align: left; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--chalk); color: var(--ink); cursor: pointer; }
.fx-act:hover { border-color: var(--brass); }
.fx-act.is-danger { color: var(--danger); }
.fx-preview__img { display: block; max-width: 100%; max-height: 220px; border-radius: 10px; margin-bottom: 8px; }
.fx-hist { display: grid; gap: 8px; max-height: 16rem; overflow: auto; }
.fx-hist__i { display: grid; gap: 1px; font-size: .9rem; padding-left: 12px; border-left: 2px solid var(--brass); }
.fx-hist__i .muted { font-size: .8rem; }

/* Dialoge */
.fx-back { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(10, 15, 20, .5); }
.fx-dlg { width: min(100%, 28rem); max-height: calc(100vh - 32px); display: grid; grid-template-rows: auto 1fr auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.fx-dlg--wide { width: min(100%, 40rem); }
.fx-dlg__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.fx-dlg__head h2 { font-size: 1.2rem; overflow-wrap: anywhere; }
.fx-dlg__body { padding: 18px 20px; overflow: auto; display: grid; gap: 12px; align-content: start; }
.fx-dlg__foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.fx-tree { display: grid; gap: 2px; max-height: 50vh; overflow: auto; }
.fx-tree__row { display: flex; align-items: center; gap: 8px; font: inherit; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; }
.fx-tree__row:hover:not(:disabled) { background: var(--brass-soft); }
.fx-tree__row[aria-selected="true"] { background: var(--brass-soft); font-weight: 700; outline: 1.5px solid var(--brass); }
.fx-tree__row:disabled { opacity: .4; cursor: not-allowed; }
.fx-tree__pad { display: inline-block; }
.fx-lvl0 { width: 0; } .fx-lvl1 { width: 0; } .fx-lvl2 { width: 16px; } .fx-lvl3 { width: 32px; } .fx-lvl4 { width: 48px; } .fx-lvl5 { width: 64px; } .fx-lvl6 { width: 80px; } .fx-lvl7 { width: 96px; } .fx-lvl8 { width: 112px; }

/* Rechte */
.fx-acc { display: grid; gap: 14px; }
.fx-acc__group h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); margin-bottom: 8px; }
.fx-acc__row { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--chalk); margin-bottom: 8px; }
.fx-acc__top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; }
.fx-acc__top strong { overflow-wrap: anywhere; }
.fx-acc__flags { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.fx-check { display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; cursor: pointer; }
.fx-check input { width: auto; }

/* Uploads und Ablegen */
.fx-up { position: fixed; right: 16px; bottom: 16px; z-index: 80; width: min(22rem, calc(100vw - 32px)); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px rgba(23, 32, 43, .2); overflow: hidden; }
.fx-up__head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.fx-up__list { display: grid; max-height: 16rem; overflow: auto; }
.fx-up__i { display: grid; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.fx-up__i:last-child { border-bottom: 0; }
.fx-up__n { font-size: .9rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-bar { display: block; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.fx-bar__f { display: block; height: 100%; width: var(--p, 0%); background: var(--brass); transition: width .2s; }
.fx-up__i.is-failed .fx-bar__f { background: var(--danger); }
.fx-up__i.is-done .fx-bar__f { background: var(--ok); }
.fx-drop { position: absolute; inset: -6px; z-index: 60; display: grid; place-items: center; text-align: center; border: 2.5px dashed var(--brass); border-radius: var(--radius); background: color-mix(in srgb, var(--paper) 86%, var(--brass-soft)); font-weight: 700; }
.fx-drop[hidden] { display: none; }
.fx-drop > div { display: grid; justify-items: center; gap: 8px; }
.fx-drop .fx-ic { width: 34px; height: 34px; color: var(--brass); }

/* ---------------------------------------------------------------- Das Buch */
.bk-stage { position: relative; perspective: var(--bk-perspective); padding: 18px 46px 34px 12px; }
.bk { --ry: 0deg; --rx: 0deg; --stack: calc(4px + var(--depth, 0) * 3px); position: relative; width: min(100%, 1060px); height: clamp(460px, 66vh, 640px); margin-inline: auto; transform-style: preserve-3d;
  transform: translateX(-25%) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform var(--bk-turn) var(--bk-ease); }
.bk.is-open { transform: translateX(0) rotateX(var(--rx)) rotateY(var(--ry)); }
.bk-block { position: absolute; top: 8px; right: -12px; bottom: -14px; left: -12px; transition: left var(--bk-turn) var(--bk-ease); border-radius: 8px 12px 12px 8px; background: linear-gradient(135deg, var(--bk-cover-a), var(--bk-cover-b)); transform: translateZ(-10px); box-shadow: 0 40px 60px -20px rgba(0, 0, 0, .45); }
.bk-page { position: absolute; top: 0; bottom: 0; width: 50%; background: var(--bk-paper); color: var(--ink); backface-visibility: hidden; }
.bk:not(.is-open) .bk-block { left: 50%; }
.bk-left { left: 0; border-radius: 6px 0 0 6px; box-shadow: inset -26px 0 30px -26px rgba(23, 32, 43, .28); }
.bk-right { right: 0; border-radius: 0 6px 6px 0; box-shadow: inset 26px 0 30px -26px rgba(23, 32, 43, .28); }
.bk-left::before, .bk-right::before { content: ""; position: absolute; top: 3px; bottom: 3px; width: var(--stack); background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--line) 80%, var(--ink)) 0 1px, var(--bk-paper) 1px 3px); }
.bk-left::before { right: 100%; border-radius: 3px 0 0 3px; }
.bk-right::before { left: 100%; width: 6px; border-radius: 0 3px 3px 0; }
.bk:not(.is-open) .bk-left { visibility: hidden; }
.bk.is-open.is-opened .bk-cover { visibility: hidden; }
.bk-page__in { height: 100%; overflow: auto; padding: clamp(22px, 3.4vw, 44px) clamp(22px, 3.6vw, 48px); display: grid; align-content: start; gap: 12px; scrollbar-width: thin; }
.bk-kicker { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); }
.bk-title { font-size: clamp(1.4rem, 1rem + 1.3vw, 2.1rem); line-height: 1.08; letter-spacing: -.02em; overflow-wrap: break-word; hyphens: auto; }
.bk-meta { color: var(--slate); font-size: .92rem; margin-top: -4px; }
.bk-toc { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.bk-chap { display: flex; align-items: center; gap: 10px; width: 100%; font: inherit; text-align: left; padding: 10px 8px; border: 0; border-radius: 10px; background: none; color: var(--ink); cursor: pointer; outline: none; }
.bk-chap:focus-visible { outline: 2px solid var(--brass); }
.bk-chap:hover { background: var(--brass-soft); }
.bk-chap.is-sel { background: var(--brass-soft); }
.bk-chap.is-drop { background: var(--brass-soft); outline: 2px dashed var(--brass); }
.bk-chap__n { font-weight: 800; color: var(--brass); font-variant-numeric: tabular-nums; }
.bk-chap__t { font-weight: 700; overflow-wrap: anywhere; }
.bk-chap__l { flex: 1; min-width: 12px; border-bottom: 2px dotted var(--line); transform: translateY(-4px); }
.bk-chap__c { color: var(--slate); font-variant-numeric: tabular-nums; }
.bk-empty { color: var(--slate); }
.bk-link { justify-self: start; font: inherit; font-weight: 700; color: var(--brass); background: none; border: 0; padding: 6px 0; cursor: pointer; }
.bk-link:hover { color: var(--ink); }
.bk-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bk-file { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; cursor: pointer; outline: none; border: 1.5px solid transparent; }
.bk-file:hover { background: color-mix(in srgb, var(--brass-soft) 60%, transparent); }
.bk-file:focus-visible { outline: 2px solid var(--brass); }
.bk-file.is-sel { background: var(--brass-soft); border-color: var(--brass); }
.bk-file .fx-hex { width: 34px; height: 38px; }
.bk-file .fx-hex__ext { font-size: .58rem; }
.bk-file__t { display: grid; min-width: 0; flex: 1; }
.bk-file__t strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-file__t span { color: var(--slate); font-size: .84rem; }
.bk-folio { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: .8rem; color: var(--slate); letter-spacing: .1em; }

/* Umschlag */
.bk-cover { position: absolute; top: -3px; bottom: -3px; right: -4px; width: calc(50% + 4px); padding: 0; border: 0; background: none; cursor: pointer; transform-origin: left center; transform-style: preserve-3d; transform: translateZ(3px) rotateY(0deg); transition: transform var(--bk-open) var(--bk-ease); color: var(--bk-foil); font: inherit; }
.bk.is-open .bk-cover { transform: translateZ(3px) rotateY(-180deg); cursor: default; }
.bk-cover::before { content: ""; position: absolute; inset: 0; border-radius: 4px 12px 12px 4px; backface-visibility: hidden; background: radial-gradient(circle at 1px 1px, var(--bk-cover-dots) 1px, transparent 0) 0 0 / 16px 16px, linear-gradient(135deg, var(--bk-cover-a), var(--bk-cover-b)); box-shadow: inset 10px 0 18px rgba(0, 0, 0, .45), inset 0 0 0 1.5px rgba(209, 168, 92, .35); }
.bk-cover::after { content: ""; position: absolute; inset: 3px 4px 3px 0; border-radius: 6px 0 0 6px; backface-visibility: hidden; transform: rotateY(180deg); background: var(--bk-paper); box-shadow: inset -26px 0 30px -26px rgba(23, 32, 43, .28); }
.bk-cover > * { position: absolute; left: 0; right: 0; text-align: center; backface-visibility: hidden; transform: translateZ(1px); }
.bk-cover__hex { top: 20%; margin-inline: auto; width: 92px; height: 100px; display: grid; place-items: center; background: rgba(209, 168, 92, .16); clip-path: var(--ic-clip, polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%)); }
.bk-cover__hex .fx-ic { width: 38px; height: 38px; }
.bk-cover__t { top: 50%; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 700; letter-spacing: .02em; text-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.bk-cover__s { bottom: 14%; font-size: .88rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.bk:not(.is-open) .bk-cover:hover { transform: translateZ(3px) rotateY(-9deg); }
.bk:not(.is-open) .bk-cover:focus-visible { outline: 3px solid var(--brass); outline-offset: 4px; }

/* Lesezeichen */
.bk-ribbon { position: absolute; top: -6px; left: calc(50% - 10px); width: 20px; height: 74px; border: 0; padding: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--bk-foil) 78%, #000), var(--bk-foil)); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); transform: translateZ(4px); cursor: pointer; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .3)); transition: height .2s; }
.bk-ribbon:hover { height: 86px; }
.bk:not(.is-open) .bk-ribbon { display: none; }

/* Umblättern */
.bk-sheet { position: absolute; top: 0; bottom: 0; right: 0; width: 50%; transform-origin: left center; transform-style: preserve-3d; transform: translateZ(2px) rotateY(0deg); transition: transform var(--bk-turn) var(--bk-ease); pointer-events: none; }
.bk-sheet--back { transform: translateZ(2px) rotateY(-180deg); }
.bk-sheet.is-turning { transform: translateZ(2px) rotateY(-180deg); }
.bk-sheet--back.is-turning { transform: translateZ(2px) rotateY(0deg); }
.bk-sheet__f, .bk-sheet__b { width: 100%; backface-visibility: hidden; }
.bk-sheet__f { left: 0; border-radius: 0 6px 6px 0; box-shadow: inset 26px 0 30px -26px rgba(23, 32, 43, .28); }
.bk-sheet__b { left: 0; transform: rotateY(180deg); border-radius: 6px 0 0 6px; box-shadow: inset -26px 0 30px -26px rgba(23, 32, 43, .28); }
.bk-sheet::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .35), transparent 70%); opacity: 0; pointer-events: none; }
.bk-sheet.is-turning::after { animation: bk-shade var(--bk-turn) ease-in-out; }
@keyframes bk-shade { 0%, 100% { opacity: 0; } 45% { opacity: .55; } }

/* Register am Rand */
.bk-tabs { position: absolute; z-index: 2; right: 6px; top: 64px; display: grid; gap: 6px; }
.bk-stage:has(.bk:not(.is-open)) .bk-tabs { display: none; }
.bk-tab { width: 34px; height: 104px; padding: 8px 0; border: 0; border-radius: 0 10px 10px 0; color: var(--bk-tab-ink); font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; display: grid; place-items: center; box-shadow: 2px 3px 6px rgba(0, 0, 0, .2); transition: transform .2s; }
.bk-tab span { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-tab--0 { background: var(--bk-tab-0); } .bk-tab--1 { background: var(--bk-tab-1); } .bk-tab--2 { background: var(--bk-tab-2); } .bk-tab--3 { background: var(--bk-tab-3); }
.bk-tab:hover { transform: translateX(4px); }
.bk-tab.is-on { transform: translateX(8px); outline: 2px solid var(--ink); outline-offset: -2px; }

/* Schmale Bildschirme: zwei Seiten untereinander, ohne Drehung */
.bk.is-compact { height: auto; transform: none; display: grid; gap: 14px; transition: none; }
.bk.is-compact .bk-block, .bk.is-compact .bk-cover, .bk.is-compact .bk-ribbon, .bk.is-compact .bk-sheet { display: none; }
.bk.is-compact .bk-page { position: relative; width: auto; border: 1px solid var(--line); border-radius: 14px; box-shadow: none; visibility: visible; }
.bk.is-compact .bk-page::before { display: none; }
.bk.is-compact .bk-page__in { padding: 20px; min-height: 8rem; }
.bk.is-compact .bk-folio { position: static; padding: 0 0 12px; }
.bk-stage:has(.bk.is-compact) { padding: 0; }
.bk-stage:has(.bk.is-compact) .bk-tabs { position: static; display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; }
.bk-stage:has(.bk.is-compact) .bk-tab { width: auto; height: auto; padding: 8px 14px; border-radius: 10px; flex: none; }
.bk-stage:has(.bk.is-compact) .bk-tab span { writing-mode: horizontal-tb; transform: none; max-height: none; }

@media (prefers-reduced-motion: reduce) {
  .bk, .bk-cover, .bk-sheet { transition: none; }
  .fx-card, .bk-tab { transition: none; }
  .fx-card:hover { transform: none; }
}

html[data-theme="dark"] { --bk-paper: var(--bk-paper-dark); }

/* ---------------------------------------------------------------- Buch über die ganze Seite */
html:has(.bk-over) { overflow: hidden; }
.bk-over { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto minmax(0, 1fr); color: var(--bk-over-ink); background: var(--bk-over-bg); outline: none; overscroll-behavior: contain; animation: bk-over-in var(--bk-over-in) ease; }
@keyframes bk-over-in { from { opacity: 0; } }
.bk-over__body { min-height: 0; overflow: hidden; display: grid; }
.bk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 12px clamp(14px, 3vw, 32px); border-bottom: 1px solid var(--bk-over-line); background: rgba(0, 0, 0, .18); }
.bk-bar__l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bk-bar__hex { width: 38px; height: 42px; flex: none; display: grid; place-items: center; background: rgba(209, 168, 92, .2); color: var(--bk-foil); clip-path: var(--ic-clip, polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%)); }
.bk-bar__crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; }
.bk-crumb { font: inherit; font-weight: 700; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: inherit; opacity: .72; cursor: pointer; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-crumb:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
.bk-crumb.is-last { opacity: 1; font-size: 1.15rem; cursor: default; }
.bk-crumb:first-child { font-size: 1.15rem; opacity: 1; letter-spacing: .01em; }
.bk-sep { opacity: .45; }
.bk-bar__r { display: flex; align-items: center; gap: 8px; flex: none; }
.bk-obtn, .bk-x { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 1px solid var(--bk-over-line); border-radius: 999px; background: rgba(255, 255, 255, .08); color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.bk-obtn:hover, .bk-x:hover { background: rgba(255, 255, 255, .18); }
.bk-obtn--main { background: var(--bk-foil); border-color: transparent; color: #1a1405; }
.bk-obtn--main:hover { background: color-mix(in srgb, var(--bk-foil) 82%, #fff); }
.bk-x { padding: 0 18px 0 12px; border-color: rgba(255, 255, 255, .4); }
.bk-bar button:focus-visible { outline: 2px solid var(--bk-foil); outline-offset: 2px; }

.bk-over .bk-stage { align-self: stretch; display: grid; align-items: center; padding: 14px 66px 22px 30px; min-height: 0; }
.bk-over .bk:not(.is-compact) { height: min(calc(100vh - 124px), 840px); height: min(calc(100dvh - 124px), 840px); width: min(100%, 1360px); }
.bk-over .bk-page__in { padding: clamp(26px, 3.6vw, 60px) clamp(24px, 4vw, 64px); }
.bk-over .bk-title { font-size: clamp(1.7rem, 1.1rem + 1.6vw, 2.7rem); }
.bk-over .bk-chap__t { font-size: 1.08rem; }
.bk-over .bk-file { padding: 10px; }
.bk-over .bk-file__t strong { font-size: 1.02rem; }
.bk-over .bk-tab { width: 38px; }

/* Einzelklick: Zeilen zeigen, dass sie anklickbar sind */
.bk-back { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; font-size: .92rem; padding: 6px 12px 6px 8px; margin: -4px 0 4px -8px; border: 1.5px solid var(--line); border-radius: 999px; background: none; color: var(--ink); cursor: pointer; max-width: 100%; }
.bk-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-back:hover { border-color: var(--brass); background: var(--brass-soft); }
.bk-chap__go, .bk-file__go { display: grid; place-items: center; color: var(--brass); opacity: .4; transition: opacity .15s, transform .15s; flex: none; }
.bk-chap:hover .bk-chap__go, .bk-chap:focus-visible .bk-chap__go, .bk-file:hover .bk-file__go, .bk-file:focus-visible .bk-file__go { opacity: 1; transform: translateX(3px); }
.bk-file { position: relative; }
.bk-file:hover, .bk-chap:hover { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brass) 55%, transparent); }
.bk-more { display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--slate); cursor: pointer; opacity: .55; }
.bk-more:hover, .bk-more:focus-visible { opacity: 1; background: color-mix(in srgb, var(--brass) 28%, transparent); color: var(--ink); }
.bk-hint { color: var(--slate); font-size: .86rem; margin-top: 2px; }

/* Rechte, Verlauf und Hochladen liegen über dem Buch */
.fx.is-book .fx-main.has-panel { grid-template-columns: none; }
.fx.is-book .fx-panel.is-open { position: fixed; z-index: 70; top: 84px; right: 16px; bottom: 16px; width: min(22rem, calc(100vw - 32px)); overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.fx.is-book .fx-drop { position: fixed; inset: 0; z-index: 75; border-radius: 0; }
@media (max-width: 62em) { .fx.is-book .fx-panel.is-open { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 72vh; border-radius: 18px 18px 0 0; } }

@media (max-width: 760px) {
  .bk-bar { padding: 10px 12px; }
  .bk-obtn span, .bk-x span { display: none; }
  .bk-obtn, .bk-x { padding: 0; width: 44px; justify-content: center; }
  .bk-crumb { max-width: 9rem; }
  .bk-over__body { overflow: auto; }
  .bk-over .bk-stage, .bk-over .bk-stage:has(.bk.is-compact) { padding: 12px; align-items: start; }
  .bk-over .bk-page { background: var(--bk-paper); }
}
html[data-motion="none"] .bk-over { animation: none; }

/* ================================================================ Stufe 2 */
.fx-top__l { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 18rem; }
.fx-body { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 18px; align-items: start; }
.fx-scrim { display: none; }
.fx-iconbtn--sm { width: 30px; height: 30px; }
.fx-iconbtn--sm.is-danger { color: var(--danger); }
.fx-crumb--more { padding-inline: 8px; }

/* Ordnerbaum */
.fx-side { position: sticky; top: 12px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 24px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.fx-side__head { padding: 12px 14px 6px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); }
.fx-tree2 { overflow: auto; padding: 4px 6px 8px; display: grid; gap: 1px; align-content: start; scrollbar-width: thin; }
.fx-trow { display: flex; align-items: center; border-radius: 8px; }
.fx-trow__pad { flex: none; }
.fx-trow__pad.fx-lvl0 { width: 0; } .fx-trow__pad.fx-lvl1 { width: 8px; } .fx-trow__pad.fx-lvl2 { width: 20px; } .fx-trow__pad.fx-lvl3 { width: 32px; } .fx-trow__pad.fx-lvl4 { width: 44px; }
.fx-trow__pad.fx-lvl5 { width: 56px; } .fx-trow__pad.fx-lvl6 { width: 68px; } .fx-trow__pad.fx-lvl7 { width: 80px; } .fx-trow__pad.fx-lvl8 { width: 92px; }
.fx-trow__tg { width: 22px; height: 28px; display: grid; place-items: center; flex: none; background: none; border: 0; color: var(--slate); cursor: pointer; padding: 0; }
.fx-trow__tg--off { cursor: default; }
.fx-trow__tg .fx-ic { transition: transform .15s; }
.fx-trow__tg.is-open .fx-ic { transform: rotate(90deg); }
.fx-trow__n { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font: inherit; font-size: .93rem; text-align: left; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; }
.fx-trow__n span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-trow__n:hover { background: var(--brass-soft); }
.fx-trow__n:focus-visible { outline: 2px solid var(--brass); outline-offset: -2px; }
.fx-trow.is-here .fx-trow__n, .fx-trashrow.is-here { background: var(--brass-soft); font-weight: 700; }
.fx-trow__n.is-drop { outline: 2px dashed var(--brass); background: var(--brass-soft); }
.fx-side__foot { padding: 8px 8px 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.fx-meter { display: grid; gap: 4px; padding: 0 6px; font-size: .85rem; }
.fx-meter__t { display: flex; justify-content: space-between; font-weight: 700; }
.fx-meter__b { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.fx-meter__f { display: block; height: 100%; width: var(--p, 0%); background: var(--brass); transition: width .3s; }
.fx-meter__f.is-warn { background: var(--warn, #d98a1a); }
.fx-meter__f.is-full { background: var(--danger); }
@media (min-width: 62.01em) { .fx.tree-off .fx-body { grid-template-columns: minmax(0, 1fr); } .fx.tree-off .fx-side { display: none; } }
@media (max-width: 62em) {
  .fx-body { grid-template-columns: minmax(0, 1fr); }
  .fx-side { position: fixed; z-index: 90; left: 0; top: 0; bottom: 0; width: min(20rem, 86vw); max-height: none; border-radius: 0 var(--radius) var(--radius) 0; transform: translateX(-104%); transition: transform .2s; }
  .fx.side-open .fx-side { transform: none; }
  .fx.side-open .fx-scrim { display: block; position: fixed; inset: 0; z-index: 85; background: rgba(10, 15, 20, .45); }
}
html[data-motion="none"] .fx-side, html[data-motion="none"] .fx-trow__tg .fx-ic { transition: none; }

/* Hinweise */
.fx-banner { display: grid; gap: 8px; }
.fx-banner:empty { display: none; }
.fx-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--chalk); font-size: .93rem; }
.fx-note > span { flex: 1 1 14rem; }
.fx-note--warn { border-color: var(--brass); background: var(--brass-soft); }
.fx-note--bad { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--paper)); }

/* Kopfzeile */
.fx-split { display: inline-flex; }
.fx-split[hidden] { display: none; }
.fx-split .fx-tool { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.fx-caret { border-top-left-radius: 0; border-bottom-left-radius: 0; padding-inline: 8px; margin-left: 1px; }
.fx-empty__a { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* Auswahl-Kreis */
.fx-card, .fx-tile { position: relative; }
.fx-chk { position: absolute; z-index: 2; top: 8px; left: 8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line); background: var(--paper); color: transparent; cursor: pointer; padding: 0; opacity: 0; transition: opacity .12s; }
.fx-card .fx-chk { top: -8px; left: -8px; }
.fx-tile .fx-chk { top: 14px; left: 14px; }
.fx-row__name .fx-chk { position: static; flex: none; }
.fx-card:hover .fx-chk, .fx-tile:hover .fx-chk, .fx-row:hover .fx-chk, .fx-stage.has-pick .fx-chk, .fx-chk:focus-visible { opacity: 1; }
.fx-chk[aria-pressed="true"] { opacity: 1; background: var(--brass); border-color: var(--brass); color: var(--paper); }
.fx-chk .fx-ic { width: 14px; height: 14px; }
@media (pointer: coarse) { .fx-chk { opacity: 1; } }
.fx-dragimg { position: fixed; top: -100px; left: -100px; padding: 6px 12px; background: var(--ink); color: var(--chalk); border-radius: 8px; font-weight: 700; }

/* Kacheln mit Vorschaubild */
.fx-grid--tiles { grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); }
.fx-tile { display: grid; align-content: start; gap: 8px; padding: 8px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); cursor: pointer; outline: none; min-width: 0; transition: border-color var(--fx-card-ease), transform var(--fx-card-ease), box-shadow var(--fx-card-ease); }
.fx-tile:hover { border-color: var(--brass); transform: translateY(var(--fx-lift)); box-shadow: 0 10px 26px rgba(23, 32, 43, .08); }
.fx-tile:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.fx-tile.is-sel { border-color: var(--brass); background: var(--brass-soft); }
.fx-tile__t { display: grid; gap: 2px; padding: 0 4px 4px; min-width: 0; }
.fx-tile__t strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-tile__t span { color: var(--slate); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-thumb { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--chalk); border-radius: 10px; }
.fx-thumb img { display: block; }
.fx-thumb--tile { aspect-ratio: 4 / 3; }
.fx-thumb--tile img { width: 100%; height: 100%; object-fit: cover; }
.fx-thumb--tile .fx-hex { width: 64px; height: 70px; }
.fx-thumb--tile .fx-hex__ext { font-size: .85rem; }
.fx-thumb.has-img img[src] { background: #fff; }
.fx-thumb.has-sprite { background: #0d1117; }
.fx-sprite { display: block; width: 100%; aspect-ratio: 16 / 9; background-repeat: no-repeat; background-size: calc(var(--n, 1) * 100%) 100%; background-position: calc(var(--i, 0) * 100% / max(1, var(--n, 1) - 1)) 50%; }
.fx-badge { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(12, 18, 24, .72); color: #fff; font-size: .72rem; font-weight: 700; pointer-events: none; }
.fx-badge--play { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border-radius: 50%; transition: opacity .15s; }
.fx-thumb.has-sprite:hover .fx-badge--play { opacity: 0; }
.fx-thumb--row { width: 38px; height: 38px; flex: none; border-radius: 8px; }
.fx-thumb--row img { width: 100%; height: 100%; object-fit: cover; }
.fx-thumb--row .fx-hex { width: 30px; height: 33px; }
.fx-thumb--row .fx-hex__ext { font-size: .55rem; }
.fx-thumb--row .fx-sprite { aspect-ratio: auto !important; height: 100%; }
.fx-thumb--row .fx-badge { display: none; }
.fx-thumb--panel { aspect-ratio: 4 / 3; width: 100%; }
.fx-thumb--panel img { width: 100%; height: 100%; object-fit: contain; }
.fx-thumb--panel .fx-hex { width: 64px; height: 70px; }
.fx-panel__pv { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; }
.fx-panel__pv:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.fx-hex--other { background: var(--brass-soft); }

/* Titelbild wählen, Versionen */
.fx-frames { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fx-frame { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: #0d1117; }
.fx-frame.is-on { border-color: var(--brass); }
.fx-frame:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.fx-ver { display: grid; gap: 6px; }
.fx-ver__i { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--chalk); }
.fx-ver__i.is-cur { border-color: var(--brass); }
.fx-ver__t { display: grid; gap: 1px; min-width: 0; font-size: .88rem; }
.fx-ver__t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.fx-ver__a { display: flex; gap: 4px; flex: none; }
.fx-newver { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; }

/* Menü (Rechtsklick, Hochladen, Pfad) */
.fx-menu { position: fixed; z-index: 120; min-width: 13rem; max-width: 20rem; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 18px 48px rgba(23, 32, 43, .25); display: grid; gap: 1px; }
.fx-menu__i { display: flex; align-items: center; gap: 10px; font: inherit; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; }
.fx-menu__i:hover:not(:disabled), .fx-menu__i:focus-visible { background: var(--brass-soft); outline: none; }
.fx-menu__i.is-danger { color: var(--danger); }
.fx-menu__i:disabled { opacity: .45; cursor: not-allowed; }
.fx-menu__sep { height: 1px; background: var(--line); margin: 4px 2px; }

/* Upload-Fenster */
.fx-up__head .fx-grow { flex: 1; }
.fx-up.is-collapsed .fx-up__list { display: none; }
.fx-up.is-collapsed .fx-up__head { border-bottom: 0; }
.fx-up__i { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 8px; }
.fx-up__n { order: 1; }
.fx-up__s { order: 2; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-up__i > .fx-iconbtn { order: 3; }
.fx-up__i > .fx-bar { order: 4; grid-column: 1 / -1; }
.fx-up__i.is-pending { grid-template-columns: minmax(0, 1fr) auto auto; padding: 4px 0; border: 0; }
.fx-up__i.is-pending .fx-up__n { font-weight: 600; }
.fx-up__pend { display: grid; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--brass-soft); }
.fx-up__i.is-retry .fx-bar__f { background: var(--warn, #d98a1a); }
.fx-up__i.is-cancelled { display: none; }
.fx-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: -4px; }
.fx-sub .fx-searchwrap { flex: 1 1 14rem; max-width: 26rem; }
.fx-sub .fx-search { width: 100%; }

/* Aktionsleiste bei Auswahl (ersetzt die Ansichtswahl, nichts verschiebt sich) */
.fx-selbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; padding: 3px 4px 3px 14px; border: 1.5px solid var(--brass); border-radius: 999px; background: var(--brass-soft); }
.fx-selbar[hidden] { display: none; }
.fx-selbar__n { font-weight: 700; font-size: .92rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 4px; }
.fx-selbar .fx-iconbtn { width: 34px; height: 34px; border-color: transparent; background: transparent; }
.fx-selbar .fx-iconbtn:hover { background: var(--paper); border-color: var(--line); }
.fx-selbar .fx-iconbtn.is-danger { color: var(--danger); }
.fx-infobtn[aria-pressed="true"] { background: var(--ink); color: var(--chalk); }
.fx-panel .fx-hint { font-size: .88rem; color: var(--slate); }
.fx-sub__r { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; }
@media (max-width: 62em) { .fx-selbar__n { max-width: 6.5em; } .fx-sub__r { flex: 1 1 100%; } .fx-selbar { flex-wrap: nowrap; width: 100%; } .fx-selbar .fx-iconbtn:last-child { margin-left: auto; } }

/* ---------- Öffentliche Freigabe-Seite ---------- */
.sh { display: grid; place-items: start center; padding: clamp(8px, 4vw, 48px) 0; }
.sh-card { width: min(100%, 40rem); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 36px); display: grid; gap: 12px; }
.sh-card h1 { font-size: clamp(1.4rem, 3.4vw, 2rem); line-height: 1.15; overflow-wrap: anywhere; margin: 0; }
.sh-card label { font-weight: 700; }
.sh-card input { font: inherit; padding: .75em .9em; border: 1.5px solid var(--line); border-radius: 10px; background: var(--chalk); color: var(--ink); }
.sh-card input:focus-visible { outline: 3px solid var(--brass-light); outline-offset: 1px; }
.sh-card--msg { text-align: center; justify-items: center; padding-block: 40px; }
.sh-ic { width: 1.35em; height: 1.35em; flex: none; }
.sh-err { color: var(--danger); font-weight: 700; margin: 0; }
.sh-sub { color: var(--slate); margin: 0; font-size: .95rem; }
.sh-hint { color: var(--slate); font-size: .88rem; margin: 6px 0 0; }
.sh-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .95rem; }
.sh-crumbs button { background: none; border: 0; padding: 4px 2px; font: inherit; font-weight: 700; color: var(--brass); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sh-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.sh-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--chalk); color: var(--ink); font: inherit; text-align: left; min-width: 0; }
button.sh-row { cursor: pointer; }
button.sh-row:hover { border-color: var(--brass); }
.sh-row__n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sh-row__s { color: var(--slate); font-size: .9rem; white-space: nowrap; }
.sh-dl { padding: .55em .9em; font-size: .95rem; }
@media (max-width: 34em) { .sh-dl span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .sh-row__s { display: none; } }

/* ---------- Stufe 3: Hilfe, Tags, Sperre, Kommentare, Teilen, Duplikate ---------- */
.fx-help { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-left: 4px; border-radius: 50%; border: 1.5px solid var(--line); color: var(--slate); font: 700 .8rem/1 var(--font); text-decoration: none; vertical-align: middle; background: var(--paper); flex: none; }
.fx-help:hover, .fx-help:focus-visible { border-color: var(--brass); color: var(--brass); }
.fx-help:focus-visible { outline: 3px solid var(--brass-light); outline-offset: 2px; }
.fx-top .fx-help { width: 2.2rem; height: 2.2rem; font-size: 1rem; margin-left: 0; }

.fx-tag { --tg: #7a8493; display: inline-flex; align-items: center; max-width: 100%; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; line-height: 1.6; background: color-mix(in srgb, var(--tg) 20%, var(--paper)); color: color-mix(in srgb, var(--tg) 62%, var(--ink)); border: 1px solid color-mix(in srgb, var(--tg) 40%, var(--paper)); }
.fx-tag__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-tag--red { --tg: #c0392b; } .fx-tag--orange { --tg: #d9731f; } .fx-tag--yellow { --tg: #c9a21b; } .fx-tag--green { --tg: #2f8f5b; }
.fx-tag--teal { --tg: #1f8a8a; } .fx-tag--blue { --tg: #2e6fb5; } .fx-tag--violet { --tg: #7a4cc2; } .fx-tag--pink { --tg: #c43d82; } .fx-tag--gray { --tg: #7a8493; }
.fx-tag--more { --tg: #7a8493; }
.fx-tags { display: flex; flex-wrap: nowrap; gap: 4px; min-width: 0; overflow: hidden; margin-top: 3px; }
.fx-tags--wrap { flex-wrap: wrap; overflow: visible; align-items: center; margin-top: 0; }
.fx-tile__t .fx-tags { margin-top: 4px; }
.fx-tagbtn.is-on { border-color: var(--brass); background: var(--brass-soft); }
.fx-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }

.fx-swatches { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.fx-swatch { width: 1.7rem; height: 1.7rem; border-radius: 50%; padding: 0; cursor: pointer; background: color-mix(in srgb, var(--tg) 70%, var(--paper)); border: 2px solid transparent; }
.fx-swatch.is-on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper) inset; }
.fx-swatch:focus-visible { outline: 3px solid var(--brass-light); outline-offset: 2px; }
.fx-tagpick { display: grid; gap: 4px; max-height: 14rem; overflow: auto; margin: 6px 0; }
.fx-tagrow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.fx-tagrow:hover { background: var(--brass-soft); }
.fx-tagrow__box { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border: 2px solid var(--line); border-radius: 6px; flex: none; }
.fx-tagrow__box.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.fx-tagrow__dash { width: .6rem; height: 2px; background: var(--paper); }
.fx-tagnew { display: flex; gap: 8px; } .fx-tagnew input { flex: 1; min-width: 0; }
.fx-tagman { display: grid; gap: 10px; }
.fx-tagman__r { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
@media (max-width: 40em) { .fx-tagman__r { grid-template-columns: 1fr; } }

.fx-lockbadge { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); z-index: 1; }
.fx-lockbadge.is-mine { background: var(--brass-soft); color: var(--brass); border-color: var(--brass); }
.fx-row .fx-lockbadge { position: static; display: inline-grid; width: 1.35rem; height: 1.35rem; margin-left: 6px; vertical-align: middle; }
.fx-lockbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.fx-lockbar.is-on { border-color: var(--danger); background: var(--danger-soft); }
.fx-lockbar > span { flex: 1 1 10rem; min-width: 0; }

.fx-xsec { display: grid; gap: 4px; }
.fx-xbox { display: grid; gap: 8px; }
.fx-links { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-link { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; max-width: 100%; }
.fx-link__k { color: var(--slate); font-weight: 700; } .fx-link__v { overflow-wrap: anywhere; }
.fx-link__x { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border: 0; border-radius: 50%; background: transparent; color: var(--slate); cursor: pointer; }
.fx-link__x:hover { background: var(--danger-soft); color: var(--danger); }
.fx-linkadd, .fx-commentadd { display: flex; gap: 8px; align-items: flex-start; }
.fx-linkadd input, .fx-commentadd textarea { flex: 1; min-width: 0; font: inherit; padding: .5em .7em; border: 1.5px solid var(--line); border-radius: 10px; background: var(--chalk); color: var(--ink); }
.fx-commentadd textarea { resize: vertical; min-height: 3.2em; }
.fx-comments { display: grid; gap: 8px; }
.fx-comment { padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--chalk); }
.fx-comment__h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .85rem; } .fx-comment__h .fx-link__x { margin-left: auto; }
.fx-comment__b { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fx-sharesum { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }

.fx-share { display: grid; gap: 10px; }
.fx-sharelink { display: grid; gap: 6px; padding: 12px; border: 2px solid var(--ok); border-radius: 12px; background: var(--ok-soft); }
.fx-sharelink__r { display: flex; gap: 8px; } .fx-sharelink__r input { flex: 1; min-width: 0; font: inherit; padding: .5em .7em; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.fx-sh-lim { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .fx-sh-lim input[type=number] { width: 6.5em; font: inherit; padding: .4em .6em; border: 1.5px solid var(--line); border-radius: 10px; background: var(--chalk); color: var(--ink); }
.fx-shares { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fx-shares__i { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; justify-items: start; }
.fx-shares__i.is-revoked, .fx-shares__i.is-expired, .fx-shares__i.is-used { opacity: .65; }
.fx-pill { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--line); color: var(--ink); } .fx-pill.is-active { background: var(--ok-soft); color: var(--ok); }

.fx-dups { display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.fx-dup { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.fx-dup__n { display: grid; min-width: 0; flex: 1 1 14rem; } .fx-dup__n strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-segs { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.fx-seg { border: 0; padding: .45em .8em; background: transparent; color: var(--ink); font: 700 .9rem/1.2 var(--font); cursor: pointer; }
.fx-seg.is-on { background: var(--ink); color: var(--paper); }
.fx-snip mark { background: var(--brass-light); color: #1a1405; border-radius: 3px; padding: 0 2px; }
.fx-steps { text-align: left; margin: 10px 0 0; padding-left: 1.3em; display: grid; gap: 4px; max-width: 34rem; color: var(--slate); }
.fx-steps .fx-help { margin: 0 4px 0 0; }

/* Liste: bei schmaler Fläche (z. B. mit offener Detailleiste) erst "Von" und "Art" ausblenden, der Name behält immer Platz */
@container (max-width: 700px) { .fx-row { grid-template-columns: minmax(0, 1fr) 5rem 6rem; } .fx-row > :nth-child(2), .fx-row > :nth-child(5) { display: none; } }
@container (max-width: 440px) { .fx-row { grid-template-columns: minmax(0, 1fr) 5rem; } .fx-row > :nth-child(4) { display: none; } }
@media (max-width: 40em) { .fx-selbar { flex-wrap: wrap; border-radius: 18px; padding: 6px 8px; } .fx-selbar__n { flex: 1 1 100%; max-width: none; } .fx-tools .fx-help { order: 9; } }
.fx-lockbar > span { font-size: .92rem; }
