/* File details share one download surface across every source and CMS entry. */
body.rd-page { background: var(--rd-canvas,light-dark(#f3f8f5,#1e2823)); color:light-dark(#18352b,#dbeae5); }
.rd-page main {padding:0;min-height:56vh}
.rd-wrap {width:min(1180px,calc(100% - 2 * var(--site-gutter,24px)));margin:clamp(24px,3.5vw,48px) auto clamp(48px,6vw,88px)}
.rd-wrap .rd-crumb {display:flex;align-items:center;gap:12px;height:auto;margin:0 0 20px;font-size:15px;line-height:1.5;color:light-dark(#405f52,#bfcec8)}
.rd-crumb a {display:inline;color:inherit;font:inherit}
.rd-crumb a:hover,.rd-secondary a:hover {color:light-dark(#164e39,#cee9df);text-decoration:underline;text-underline-offset:4px}
.rd-crumb > span {color:light-dark(#83988d,#889790)}
.rd-primary {min-width:0;max-width:860px;container:resource-panel / inline-size}
.rd-primary .rd-sheet {
  --sheet-inset:clamp(20px,4.7cqi,40px);
  position:relative;isolation:isolate;overflow:hidden;display:grid;
  border:1px solid light-dark(#d3ded8,#3c4b43);border-radius:20px;
  background:light-dark(#fdfefc,#202923);box-shadow:0 6px 22px -16px #294b3f53;
}
.rd-sheet .rd-filehead {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:20px;min-width:0;padding:var(--sheet-inset);background:transparent;border:0}
.rd-filehead h1 {margin:0;font-size:clamp(28px,5.35cqi,46px);line-height:1.17;letter-spacing:-.035em;color:light-dark(#243c32,#e1eae4);overflow-wrap:anywhere;text-wrap:balance}
.rd-sheet .rd-filehead p {margin:12px 0 0;color:light-dark(#51645a,#bfcec5);font-size:clamp(15px,2.1cqi,17px);line-height:1.65}
.rd-sheet .rd-filehead .rd-spec {font-size:15px;font-weight:600}
.rd-sheet > .rd-spec {margin:0;padding:0 var(--sheet-inset) var(--sheet-inset)}
.rd-file-logo {width:clamp(48px,9cqi,72px);height:auto;aspect-ratio:1;object-fit:contain;border-radius:15px}
.rd-file-emblem {
  --emblem-size:clamp(48px,8cqi,66px);
  display:grid;place-items:center;position:relative;isolation:isolate;
  width:var(--emblem-size);height:var(--emblem-size);margin:8px 5px 8px 0;
}
.rd-file-emblem::before,.rd-file-emblem::after,.rd-file-emblem > b {
  content:"";position:absolute;inset:4% 8%;border-radius:21%;
}
.rd-file-emblem::before {transform:translate(-9%,-2%) rotate(-16deg);background:light-dark(#a9cdba,#466555);border:1px solid light-dark(#89b39f,#688c7b)}
.rd-file-emblem::after {transform:translate(-2%,-1%) rotate(-6deg);background:light-dark(#c7e4d2,#2d4938);border:1px solid light-dark(#a3cdb5,#476b57)}
.rd-file-emblem > b {z-index:1;display:grid;place-items:center;transform:rotate(7deg);background:linear-gradient(140deg,light-dark(#f1f8f2,#1d2722),light-dark(#d1e6d8,#2b4132) 58%,light-dark(#b6d4c2,#3c5647));box-shadow:inset 0 1px 0 #ffffff66,0 9px 15px -10px #123b2b87;color:light-dark(#42634e,#bdcdc3)}
.rd-file-emblem .ic {width:46%;height:46%;stroke-width:1.5}
.rd-download-panel {
  min-width:0;border-top:1px solid light-dark(#dbe5de,#35463b);
  padding:clamp(18px,3cqi,24px) var(--sheet-inset) clamp(22px,3.8cqi,32px);
  background:light-dark(#f0f5f1,#1c2721);
}
.rd-sheet .rd-download-panel h2 {
  display:flex;align-items:center;gap:9px;margin:0 0 13px;color:light-dark(#354a40,#d0e2d8);
  font-size:16px;font-weight:650;letter-spacing:0;line-height:1.4;
}
.rd-download-panel h2::before {content:"";width:23px;height:23px;flex:none;background:url("/assets/download-relief.webp") center / contain no-repeat}
.rd-downloads {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));align-items:start;gap:12px;min-width:0}
.rd-download {display:grid;align-content:start;gap:6px;max-width:100%;min-width:0}
.rd-downloads .rd-download .rd-action {
  display:inline-flex;justify-self:start;align-items:center;justify-content:center;gap:9px;
  width:fit-content;max-width:100%;box-sizing:border-box;padding:10px 20px;min-height:48px;
  background:light-dark(#b9dfc9,#325441);border:1px solid light-dark(#95c3a7,#547c64);border-radius:14px;color:light-dark(#243e30,#d6e3dc);
  font-size:17px;font-weight:675;line-height:1.25;text-decoration:none;
  box-shadow:0 3px 7px #14352612;
}
.rd-action .rd-dl-label {min-width:0;overflow-wrap:anywhere}
.rd-action > .ic:first-child {height:21px;width:21px;flex:none;stroke-width:1.9}
.rd-action > .ic:last-child {display:none}
.rd-action:focus-visible,.rd-wrap summary:focus-visible,.rd-relation:focus-visible {outline:3px solid light-dark(#43775b,#b0c9bc);outline-offset:4px}
.rd-download[data-provider="quark"] {
  --drive-ink:light-dark(#20378e,#e1e9ff); --drive-edge:light-dark(#b4c4f3,#4c6097);
  --drive-top:light-dark(#f4f7ff,#232c45); --drive-base:light-dark(#dce5ff,#293a63);
  --drive-accent:light-dark(#485fdb,#95aaff);
}
.rd-download[data-provider="uc"] {
  --drive-ink:light-dark(#84380b,#ffe6cd); --drive-edge:light-dark(#edc5a4,#875d44);
  --drive-top:light-dark(#fff7ed,#362b26); --drive-base:light-dark(#ffe4ca,#4e3426);
  --drive-accent:light-dark(#be560c,#ffa764);
}
.rd-downloads .rd-download[data-provider] .rd-action {
  width:100%;min-height:72px;padding:13px 16px;display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;gap:12px;
  text-align:start;align-items:center;justify-items:start;background:var(--drive-top);
  border:1px solid color-mix(in srgb,var(--drive-edge) 73%,var(--drive-top));border-radius:13px;color:var(--drive-ink);
  box-shadow:0 1px 2px #142d4908;
}
.rd-provider-logo {
  width:40px;height:40px;object-fit:contain;
  border-radius:50%;filter:drop-shadow(0 2px 3px #142d491a);
}
.rd-download[data-provider] .rd-dl-label {font-size:18px;font-weight:660;line-height:1.3}
.rd-download[data-provider] .rd-action > .ic:last-child {
  display:block;justify-self:end;width:16px;height:16px;color:var(--drive-ink);
}
.rd-downloads .rd-download[data-provider] .rd-action:focus-visible {
  outline:3px solid var(--drive-accent);outline-offset:3px;
}
.rd-notes summary {cursor:pointer;width:fit-content;max-width:100%}
.rd-code {font-size:15px;color:light-dark(#345745,#c6d6ce);line-height:1.6}
.rd-code code {user-select:all;overflow-wrap:anywhere}
.rd-rel-block {padding:clamp(24px,3vw,38px) 2px 0}
.rd-wrap .rd-rel-block h2 {margin:0 0 4px;font-size:15px;font-weight:550;line-height:1.5;color:light-dark(#546d60,#b4c0ba)}
.rd-wrap .rd-relation {font-size:clamp(18px,1.5vw,21px);font-weight:640;line-height:1.45;display:flex;gap:12px;align-items:center;padding:13px 0;border-bottom:1px solid light-dark(#d3dfd6,#323e35);color:light-dark(#294b3b,#ceded7)}
.rd-rel-icon {display:flex;flex:none;color:light-dark(#527760,#adbfb4)}
.rd-relation > span:nth-child(2) {flex:1;min-width:0;overflow-wrap:anywhere}
.rd-relation > .ic {width:15px;height:15px;color:light-dark(#668674,#a0b0a7)}
.rd-secondary {display:flex;flex-wrap:wrap;gap:8px 19px;margin:18px 2px 0;align-items:baseline;color:light-dark(#426553,#bcccc4);font-size:15px}
.rd-secondary > span {color:light-dark(#657e6e,#a5b2ac)}
.rd-notes {border-bottom:1px solid light-dark(#d3dfd6,#323e35);padding:15px 2px}
.rd-notes summary {color:light-dark(#345745,#c6d6ce);font-size:16px}
.rd-notes .md-reading {min-width:0;min-height:0;padding:9px 0 0;overflow-wrap:anywhere}
.rd-notes .md-reading img {max-width:100%;height:auto}
.rd-rail {display:none;min-width:0}
.rd-rail:has(> :not([hidden])) {display:block}
body[data-page] .rd-rail .mb-wrap {width:100%;margin:0;padding:0}
.rd-rail > .ad {flex-wrap:wrap;gap:10px;padding:12px}
.rd-rail > .ad img {max-width:36%}
@media (min-width:861px) {
  .rd-layout:has(.rd-rail > :not([hidden])) {display:grid;grid-template-columns:minmax(0,1fr) clamp(220px,21vw,280px);align-items:start;gap:clamp(24px,3vw,45px)}
}
@media (max-width:860px) { .rd-rail:has(> :not([hidden])) {margin-top:26px} }
@media (max-width:600px) {
  .rd-wrap {margin-block:21px 40px}
  .rd-wrap .rd-crumb {margin-bottom:14px}
  .rd-sheet .rd-filehead {grid-template-columns:minmax(0,1fr)}
  .rd-filehead:has(.rd-file-logo) {grid-template-columns:minmax(0,1fr) auto;gap:11px;align-items:start}
  .rd-file-logo {width:48px;border-radius:11px}
  .rd-filehead:has(.rd-file-logo) h1 {font-size:clamp(26px,7.8vw,34px)}
  .rd-file-emblem {display:none}
  .rd-downloads .rd-download .rd-action {min-height:46px;gap:8px;padding:10px 17px}
  .rd-downloads .rd-download[data-provider] .rd-action {min-height:60px;padding:11px 15px;gap:11px}
  .rd-provider-logo {width:35px;height:35px}
  .rd-download[data-provider] .rd-dl-label {font-size:16px}
  .rd-sheet .rd-filehead p {margin-top:10px}
}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  .rd-action,.rd-action > .ic,.rd-file-emblem > b {transition:transform .2s ease,background-color .2s ease,box-shadow .2s ease}
  .rd-downloads .rd-download .rd-action:hover {transform:translateY(-2px)}
  .rd-action:hover > .ic:last-child {transform:translate(2px,-2px)}
  .rd-downloads .rd-download .rd-action:active {transform:translateY(0)}
  .rd-sheet:has(.rd-action:hover) .rd-file-emblem > b,.rd-file-emblem:hover > b {transform:translate(1px,-3px) rotate(3deg)}
  .rd-relation:hover > span:nth-child(2) {text-decoration:underline;text-underline-offset:4px}
}
@media (hover:hover) and (pointer:fine) {
  .rd-downloads .rd-download[data-provider] .rd-action:hover {
    border-color:var(--drive-accent);
    background:linear-gradient(135deg,var(--drive-top),var(--drive-base) 55%,color-mix(in srgb,var(--drive-base) 83%,var(--drive-accent)));
    box-shadow:0 5px 17px color-mix(in srgb,var(--drive-accent) 23%,transparent);
  }
}

.rd-wrap .rd-relation {display:grid;grid-template-columns:clamp(76px,10vw,112px) minmax(0,1fr) auto;gap:14px;margin-top:9px;
  padding:10px;border:1px solid light-dark(#d3dfd6,#323e35);border-radius:14px;background:light-dark(#fffefa,#1b2520);text-decoration:none}
.rd-rel-thumb {aspect-ratio:1.55;display:grid;place-items:center;overflow:hidden;border-radius:8px;background:light-dark(#e5efe8,#26302b);color:light-dark(#466a56,#b8c9c0)}
.rd-rel-thumb img {width:100%;height:100%;object-fit:cover}
.rd-rel-copy strong,.rd-rel-copy small {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.rd-rel-copy small {margin-top:4px;font-size:15px;line-height:1.5;font-weight:400;color:light-dark(#53695c,#b6c1bc)}
.rd-wrap .rd-relation:hover > .rd-rel-copy {text-decoration:none}
.rd-wrap .rd-relation:hover strong {color:light-dark(#275d43,#c3ddd1)}
@media(max-width:480px){.rd-wrap .rd-relation {grid-template-columns:76px minmax(0,1fr);gap:10px}.rd-wrap .rd-relation>.ic {display:none}}
