.tm-dl-dialog {
    --dl-ink:#322a24; --dl-line:#e0d2c3; --dl-rust:#80513d; box-sizing:border-box;
    width:min(1100px,calc(100% - 36px)); height:calc(100vh - 36px); height:calc(100dvh - 36px);
    max-width:none; max-height:none; margin:auto; padding:0; overflow:hidden;
    border:1px solid var(--dl-line); border-radius:16px; background:#fffaf2; color:var(--dl-ink);
    box-shadow:0 18px 60px #241c1855;
}
.tm-dl-dialog::backdrop { background:#261f1bc2; }
html:has(.tm-dl-dialog[open]) { overflow:hidden; }
.tm-dl-dialog-panel { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr); }
.tm-dl-dialog-header {
    display:flex; justify-content:space-between; align-items:center; gap:10px;
    padding:8px 12px 8px 16px; border-bottom:1px solid var(--dl-line);
}
.tm-dl-dialog .tm-dl-dialog-title { margin:0; color:var(--dl-ink); font-weight:700 !important; line-height:1.25; overflow-wrap:anywhere; }
.tm-dl-dialog-actions { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.tm-dl-dialog-download { display:inline-flex; align-items:center; gap:4px; min-height:44px; white-space:nowrap; }
.tm-dl-dialog-actions form { margin:0; }
.tm-dl-dialog .tm-dl-dialog-close {
    display:grid; place-items:center; min-width:44px; min-height:44px; padding:0; border:1px solid var(--dl-line);
    border-radius:8px; background:#f1e7d8; color:var(--dl-ink) !important; font-size:25px; line-height:1; cursor:pointer;
}
.tm-dl-dialog .tm-dl-dialog-close:hover { background:#e8d9c4; }
.tm-dl-dialog-close:focus-visible { outline:2px solid var(--dl-rust); outline-offset:2px; }
.tm-dl-dialog-frame { display:block; width:100%; height:100%; min-height:0; border:0; background:#e7dfd3; }
.tm-dl-dialog .tm-dl-dialog-download { color:var(--dl-rust); text-decoration:underline; text-underline-offset:.22em; font-size:.88rem; font-weight:700; }
.tm-dl-dialog a:focus-visible { outline:2px solid var(--dl-rust); outline-offset:3px; }
.tm-dl-dialog:not([open]) { display:none; }
@media(max-width:575px) {
    .tm-dl-dialog { width:100%; height:100vh; height:100dvh; border:0; border-radius:0; }
    .tm-dl-dialog-header { padding:8px max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left)); }
    .tm-dl-dialog-actions { gap:8px; }
}

