/* dD Essentials 0.24.0 — Automatic Folder */
.ddf{--bg:#fff;--ink:#26312a;--muted:#526057;--line:#d8ded8;--cover:#e8ede6;--accent:#385a49;--on:#fff;color:var(--ink);font-family:system-ui,sans-serif;text-align:left;line-height:1.5}.ddf,.ddf *{box-sizing:border-box}.ddf[data-ddf-theme=dark]{--bg:#242a27;--ink:#f4f4ef;--muted:#c1ccc3;--line:#4b5750;--cover:#303d34;--accent:#bad5bd;--on:#17261c;background:var(--bg);padding:18px;border-radius:16px}.ddf[data-ddf-theme=inherit]{--bg:transparent;--ink:inherit;--muted:inherit;font-family:inherit}.ddf[data-ddf-type=serif] h2,.ddf[data-ddf-type=serif] h3{font-family:Georgia,serif;font-weight:400}.ddf[data-ddf-type=inherit] h2,.ddf[data-ddf-type=inherit] h3{font-family:inherit}.ddf h2{font-size:clamp(24px,3vw,34px);line-height:1.2;margin:0 0 10px}.ddf-intro,.ddf-count,.ddf-status,.ddf-meta{color:var(--muted);margin:0 0 16px}.ddf-intro:empty{display:none}.ddf-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:18px}.ddf-card{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--bg);display:flex;flex-direction:column;min-width:0;max-width:440px}.ddf-image{aspect-ratio:4/3;background:var(--cover);color:var(--muted);display:grid;place-items:center;overflow:hidden}.ddf-image img{width:100%;height:100%;object-fit:contain;min-height:0}.ddf-image span{display:grid;justify-items:center;gap:10px;font-size:12px;letter-spacing:2px}.ddf-image svg{width:42px;height:50px}.ddf[data-ddf-cover=portrait] .ddf-image{aspect-ratio:3/4}.ddf[data-ddf-cover=square] .ddf-image{aspect-ratio:1}.ddf[data-ddf-cover=wide] .ddf-image{aspect-ratio:16/9}.ddf[data-ddf-cover=none] .ddf-image{display:none}.ddf-body{padding:18px;flex:1;display:flex;flex-direction:column;min-width:0}.ddf-body h3{font-size:20px;margin:0 0 16px;line-height:1.3;overflow-wrap:anywhere}.ddf-meta{font-size:13px;margin:0 0 8px}.ddf-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:auto}.ddf-actions a{display:inline-flex;align-items:center;min-height:44px;border-radius:8px;border:1px solid var(--accent);padding:8px 14px;text-decoration:none;font-weight:600}.ddf-download{background:var(--accent);color:var(--on)!important}.ddf-preview{color:var(--accent)!important}.ddf-actions a:focus-visible{outline:3px solid currentColor;outline-offset:3px}.ddf-help{padding:16px;border:1px dashed var(--line);border-radius:10px;margin:12px 0;color:var(--muted);font-size:14px}.ddf-help p{margin:8px 0 0}@media(prefers-color-scheme:dark){.ddf[data-ddf-theme=auto]{--bg:#242a27;--ink:#f4f4ef;--muted:#c1ccc3;--line:#4b5750;--cover:#303d34;--accent:#bad5bd;--on:#17261c;background:var(--bg);padding:18px;border-radius:16px}}

/* Explicit theme colours override host heading defaults; inherit remains untouched. */
.ddf:not([data-ddf-theme=inherit]) .ddf-heading,.ddf:not([data-ddf-theme=inherit]) .ddf-body h3{color:var(--ink)!important}
.ddf .ddf-image{display:flex;align-items:center;justify-content:center;position:relative;max-height:240px;min-height:0}
.ddf .ddf-image img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain}
.ddf .ddf-image span{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.3}
.ddf[data-ddf-cover=portrait] .ddf-image{max-height:320px}.ddf[data-ddf-cover=none] .ddf-image{display:none}
.ddf .ddf-search{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;margin:0 0 16px}.ddf .ddf-search label{flex:1;min-width:min(100%,180px);color:var(--muted);font-size:14px}.ddf .ddf-search input{display:block;width:100%;min-height:44px;margin:5px 0 0;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);font:inherit}.ddf .ddf-search button{min-height:44px;background:var(--accent);color:var(--on);border:1px solid var(--accent);border-radius:8px;padding:8px 14px;font:inherit;cursor:pointer}.ddf .ddf-cover-status{display:none;color:var(--muted);font-size:13px;margin:12px 0 0}

/* Build 013: cap height without shrinking the flex item's width. */
.ddf .ddf-card > .ddf-image{align-self:stretch;flex:0 0 auto;width:100%;max-width:none;min-width:0;max-height:240px;aspect-ratio:4/3;position:relative;display:flex;align-items:center;justify-content:center}
.ddf[data-ddf-cover=portrait] .ddf-card > .ddf-image{aspect-ratio:3/4;max-height:320px}
.ddf[data-ddf-cover=square] .ddf-card > .ddf-image{aspect-ratio:1}
.ddf[data-ddf-cover=wide] .ddf-card > .ddf-image{aspect-ratio:16/9}
.ddf[data-ddf-cover=original] .ddf-card > .ddf-image{aspect-ratio:var(--ddf-original-ratio,3/4);max-height:420px}
.ddf[data-ddf-cover=none] .ddf-card > .ddf-image{display:none}
.ddf .ddf-image .ddf-placeholder{width:100%;height:100%;gap:10px}
.ddf .ddf-title-cover{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:14px;overflow:hidden;--book:#405e50;--book-text:#fbf8ef;--book-line:#d6c6a0}
.ddf .ddf-palette-1{--book:#45596a}.ddf .ddf-palette-2{--book:#79674e}.ddf .ddf-palette-3{--book:#5a5369}.ddf .ddf-palette-4{--book:#604c49}
.ddf .ddf-book{width:auto;height:100%;max-width:96%;aspect-ratio:3/4;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(5px,1vw,12px);padding:12px;text-align:center;border:1px solid var(--book-line);outline:1px solid var(--book);outline-offset:3px;background:var(--book);color:var(--book-text);box-shadow:2px 4px 10px #0003;overflow:hidden}
.ddf .ddf-book span{display:block;position:static;line-height:1.2;color:var(--book-text);letter-spacing:0}
.ddf .ddf-book .ddf-book-title{font-family:Georgia,serif;font-size:clamp(12px,1.8vw,20px);overflow-wrap:anywhere;max-width:100%;max-height:4.8em;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}
.ddf .ddf-book .ddf-book-type,.ddf .ddf-book .ddf-book-label{font:600 9px/1.2 system-ui,sans-serif;letter-spacing:1px}
.ddf .ddf-book .ddf-book-rule{background:var(--book-line);height:1px;width:40%;flex:none}
.ddf .ddf-cover-status{display:block}

/* dD Document Preview 0.24.0 */
html body dialog.dd-document-preview{box-sizing:border-box;position:fixed;inset:0;margin:auto;padding:0;border:1px solid #cbd4cc;border-radius:14px;width:min(94vw,1100px);height:88vh;height:88dvh;max-width:96vw;max-height:96vh;max-height:96dvh;overflow:hidden;background:#f8f8f5;color:#26352c;font:15px/1.4 system-ui,sans-serif;box-shadow:0 18px 80px #0005;text-align:left;z-index:2147483647}
html body dialog.dd-document-preview:not([open]){display:none}html body dialog.dd-document-preview[open]{display:flex;flex-direction:column}html body dialog.dd-document-preview::backdrop{background:rgba(18,26,22,.68)}
html body dialog.dd-document-preview[data-size=standard]{width:min(92vw,760px);height:80vh;height:80dvh}html body dialog.dd-document-preview[data-size=full]{width:96vw;height:96vh;height:96dvh}
.dd-document-preview *{box-sizing:border-box}.dd-document-preview .dd-preview-header{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid #d5ddd6;flex:0 0 auto}
.dd-document-preview .dd-preview-title{flex:1;min-width:0;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin:0;font:600 18px/1.3 system-ui,sans-serif;color:#26352c!important}
.dd-document-preview .dd-preview-viewer{flex:1;min-height:0;min-width:0;background:#e3e7e2;display:flex}.dd-document-preview .dd-preview-frame{display:block;width:100%;height:100%;flex:1;min-width:0;min-height:0;border:0;background:#e3e7e2}
.dd-document-preview .dd-preview-footer{flex:0 0 auto;padding:10px 16px;border-top:1px solid #d5ddd6;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}.dd-document-preview .dd-preview-hint{margin:0;font:13px/1.4 system-ui,sans-serif;color:#526057!important}.dd-document-preview .dd-preview-actions{display:flex;flex-wrap:wrap;gap:8px}
.dd-document-preview .dd-preview-close,.dd-document-preview .dd-preview-open,.dd-document-preview .dd-preview-save{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 12px;border:1px solid #526e60;border-radius:8px;background:transparent;color:#385a49!important;text-decoration:none;font:600 14px/1.3 system-ui,sans-serif;cursor:pointer;white-space:normal}.dd-document-preview .dd-preview-save{background:#385a49;color:white!important}.dd-document-preview :is(button,a):focus-visible{outline:3px solid #385a49;outline-offset:2px}
@media(max-width:600px){html body dialog.dd-document-preview,html body dialog.dd-document-preview[data-size]{width:100vw;max-width:100vw;height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;border-radius:0}.dd-document-preview .dd-preview-header,.dd-document-preview .dd-preview-footer{padding:10px}.dd-document-preview .dd-preview-title{font-size:16px}}

/* dD Motion — 0.24.0. Never animate an attached native PDF viewer. */
.dd-document-preview .dd-preview-placeholder{display:flex;align-items:center;justify-content:center;flex:1;padding:24px;text-align:center;color:#526057;font:500 15px/1.4 system-ui,sans-serif;overflow-wrap:anywhere}
@keyframes dd-preview-in {from{opacity:0;transform:scale(var(--dd-preview-scale,.97))}to{opacity:1;transform:scale(1)}}
@keyframes dd-preview-out {from{opacity:var(--dd-exit-opacity,1);transform:var(--dd-exit-transform,scale(1))}to{opacity:0;transform:scale(var(--dd-preview-scale,.97))}}
@keyframes dd-backdrop-in {from{background-color:rgba(18,26,22,0)}to{background-color:rgba(18,26,22,.68)}}
@keyframes dd-backdrop-out {from{background-color:var(--dd-exit-backdrop,rgba(18,26,22,.68))}to{background-color:rgba(18,26,22,0)}}
html body dialog.dd-document-preview[data-motion=elegant]{--dd-preview-scale:.97}
html body dialog.dd-document-preview[data-motion=fade]{--dd-preview-scale:1}
html body dialog.dd-document-preview[open].dd-preview-opening:not([data-motion=instant]){animation:dd-preview-in 280ms cubic-bezier(.2,.75,.25,1) both}
html body dialog.dd-document-preview[open].dd-preview-opening:not([data-motion=instant])::backdrop{animation:dd-backdrop-in 280ms ease-out both}
html body dialog.dd-document-preview[open].dd-preview-closing:not([data-motion=instant]){animation:dd-preview-out 220ms cubic-bezier(.4,0,.6,1) both}
html body dialog.dd-document-preview[open].dd-preview-closing:not([data-motion=instant])::backdrop{animation:dd-backdrop-out 220ms ease-in both}
@media(max-width:600px){html body dialog.dd-document-preview[data-motion=elegant]{--dd-preview-scale:1}}
@media(prefers-reduced-motion:reduce){html body dialog.dd-document-preview[open],html body dialog.dd-document-preview[open]::backdrop{animation:none!important;transform:none!important;opacity:1!important}}

/* Build 024: cover link and optional document details. No animation changes. */
.ddf .ddf-cover-preview{position:absolute;inset:0;display:block;z-index:1;cursor:pointer;border-radius:inherit}.ddf .ddf-cover-preview:focus-visible{outline:3px solid var(--accent);outline-offset:-4px}.ddf .ddf-author,.ddf .ddf-description{color:var(--muted);font-size:14px;margin:0 0 12px;overflow-wrap:anywhere}.ddf .ddf-author{font-weight:600}

.ddf .ddf-edition{align-self:flex-start;margin:0 0 12px;padding:3px 8px;border:1px solid var(--line);border-radius:5px;color:var(--muted);font-size:12px;line-height:1.5}

/* Build 024: consistent padding across real and designed cover images. */
.ddf{--ddf-cover-padding:14px}
.ddf[data-ddf-padding=compact]{--ddf-cover-padding:6px}
.ddf[data-ddf-padding=none]{--ddf-cover-padding:0px}
.ddf .ddf-card > .ddf-image img{padding:var(--ddf-cover-padding);object-fit:contain;box-sizing:border-box}
.ddf .ddf-title-cover{padding:var(--ddf-cover-padding)}
.ddf[data-ddf-padding=none] .ddf-book{outline-offset:-2px}
.ddf[data-ddf-details=no-size] .ddf-size,.ddf[data-ddf-details=minimal] .ddf-meta,.ddf[data-ddf-details=minimal] .ddf-description,.ddf[data-ddf-details=minimal] .ddf-author,.ddf[data-ddf-author=hide] .ddf-author{display:none!important}
.ddf .ddf-search .ddf-format-label{flex:0 1 210px}
.ddf .ddf-search select{display:block;width:100%;min-height:44px;margin:5px 0 0;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);font:inherit}
@media(max-width:480px){.ddf .ddf-search .ddf-format-label{flex:1 1 100%}}

/* Build 024: optional compact library layouts, no new browser script. */
.ddf .ddf-category{font-size:13px;color:var(--muted);margin:0 0 8px;overflow-wrap:anywhere}
.ddf[data-ddf-layout=list] .ddf-grid{grid-template-columns:minmax(0,1fr);gap:10px}
.ddf[data-ddf-layout=list] .ddf-card{max-width:none;display:flex;flex-direction:row;align-items:stretch}
.ddf[data-ddf-layout=list] .ddf-card > .ddf-image{width:110px;min-width:110px;max-width:110px;height:140px;max-height:140px;aspect-ratio:auto;align-self:center}
.ddf[data-ddf-layout=list] .ddf-body{padding:12px 16px;justify-content:center}
.ddf[data-ddf-layout=list] .ddf-body h3{margin-bottom:8px;font-size:18px}
.ddf[data-ddf-layout=list] .ddf-title-cover{padding:8px}
.ddf[data-ddf-layout=list] .ddf-book{padding:5px;gap:4px;box-shadow:none}
.ddf[data-ddf-layout=list] .ddf-book .ddf-book-title{font-size:11px}
.ddf[data-ddf-layout=list] .ddf-book .ddf-book-label{display:none}
.ddf[data-ddf-layout=list][data-ddf-cover=none] .ddf-card > .ddf-image{display:none}
.ddf .ddf-table-scroll{max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:10px}
.ddf .ddf-table{width:100%;min-width:480px;border-collapse:collapse;border-spacing:0;color:inherit;font:inherit;background:var(--bg);margin:0}
.ddf .ddf-table caption{text-align:left;padding:10px 12px;font-weight:600;color:inherit}
.ddf .ddf-table th,.ddf .ddf-table td{padding:12px;text-align:left;vertical-align:top;border:0;border-top:1px solid var(--line);background:var(--bg);color:inherit}
.ddf .ddf-table th{font-size:13px;color:var(--muted);font-weight:600}
.ddf .ddf-table .ddf-card{display:table-row;border:0;border-radius:0;max-width:none;overflow:visible}
.ddf .ddf-table h3{font-size:17px;line-height:1.4;margin:0 0 5px;overflow-wrap:anywhere;color:inherit}
.ddf:not([data-ddf-theme=inherit]) .ddf-table h3{color:var(--ink)!important}
.ddf .ddf-table .ddf-meta{margin:0;min-width:64px}
.ddf .ddf-table .ddf-actions{margin:0;min-width:110px}
.ddf .ddf-table .ddf-description,.ddf .ddf-table .ddf-author{margin:5px 0}
.ddf .ddf-table-scroll:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* Native theme: inherit text/fonts; keep legible, neutral form/button colours. */
.ddf[data-ddf-theme=inherit]{--bg:transparent;--ink:currentColor;--muted:currentColor;--line:color-mix(in srgb,currentColor 25%,transparent);--cover:color-mix(in srgb,currentColor 7%,transparent);--accent:#385a49;--on:#fff;font-family:inherit}
.ddf[data-ddf-theme=inherit][data-ddf-type=inherit] .ddf-heading,.ddf[data-ddf-theme=inherit][data-ddf-type=inherit] h3{font-family:inherit}
.ddf[data-ddf-theme=inherit] .ddf-search input,.ddf[data-ddf-theme=inherit] .ddf-search select{background:Canvas;color:CanvasText}
.ddf[data-ddf-theme=inherit] .ddf-preview{color:inherit!important;border-color:currentColor}
@media(max-width:480px){.ddf[data-ddf-layout=list] .ddf-card > .ddf-image{width:78px;min-width:78px;max-width:78px;height:110px}.ddf[data-ddf-layout=list] .ddf-body{padding:10px}.ddf[data-ddf-layout=list] .ddf-actions a{padding:6px 10px}.ddf .ddf-table th,.ddf .ddf-table td{padding:8px}}

/* Build 024: compact, keyboard-friendly server-rendered pagination. */
.ddf .ddf-range{font-size:13px;color:var(--muted);margin:0 0 14px}
.ddf .ddf-pagination{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;align-items:center;margin:20px 0 4px}
.ddf .ddf-pagination a,.ddf .ddf-pagination .ddf-page-current,.ddf .ddf-pagination .ddf-page-disabled{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:7px 10px;border:1px solid var(--line);border-radius:7px;text-decoration:none;font-size:14px;color:inherit;box-sizing:border-box}
.ddf .ddf-pagination .ddf-page-current{background:var(--accent);color:var(--on);border-color:var(--accent);font-weight:600}
.ddf .ddf-pagination .ddf-page-disabled{opacity:.55}
.ddf .ddf-pagination a:focus-visible{outline:3px solid currentColor;outline-offset:2px}
.ddf .ddf-pagination .ddf-page-gap{padding:0 3px}

/* Build 024: explicit opt-in test report; no default visitor-facing output. */
.ddf .ddf-health{border:1px solid var(--line);border-radius:12px;padding:12px 16px;margin:16px 0;color:var(--ink);background:var(--bg);font-size:14px;overflow-wrap:anywhere}.ddf .ddf-health summary{font-weight:600;cursor:pointer;min-height:44px;display:list-item;padding:10px 0}.ddf .ddf-health p{margin:8px 0;color:var(--muted)}.ddf .ddf-health dl{margin:12px 0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:8px 12px}.ddf .ddf-health dt{font-weight:600}.ddf .ddf-health dd{margin:0}.ddf .ddf-health summary:focus-visible{outline:2px solid currentColor;outline-offset:3px}@media(max-width:480px){.ddf .ddf-health dl{grid-template-columns:1fr;gap:4px}.ddf .ddf-health dd{margin-bottom:8px}}
