/* <nestly-sources> — Downloaded From view */

nestly-sources {
  --nsrc-surface: #FFFEFC; --nsrc-sunk: #FBF6F0; --nsrc-border: rgba(70,45,25,.09);
  --nsrc-shadow: 0 1px 2px rgba(60,40,20,.05), 0 30px 70px -32px rgba(90,60,170,.36);
  --nsrc-c: #D0573F;
  display: block; min-height: 422px; container: nsrc / inline-size;
  color: var(--text, #221E1C); font-family: var(--font, -apple-system, BlinkMacSystemFont, sans-serif);
}
@media (prefers-color-scheme: dark) {
  nestly-sources { --nsrc-surface: #1F1A17; --nsrc-sunk: #191512; --nsrc-border: rgba(255,240,225,.08); --nsrc-shadow: 0 40px 80px -30px rgba(0,0,0,.7); }
}

.nsrc { border-radius: 20px; background: var(--nsrc-surface); border: 1px solid var(--nsrc-border); box-shadow: var(--nsrc-shadow); overflow: hidden; }

.nsrc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.nsrc-head b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.015em; }
.nsrc-head span { font-size: 12.5px; color: var(--text-3, #958B84); }
.nsrc-hint { padding: 5px 10px; border-radius: 999px; background: var(--nsrc-sunk); border: 1px solid var(--nsrc-border); white-space: nowrap; }

/* storage share */
.nsrc-bar { display: flex; gap: 3px; height: 8px; margin: 0 18px 14px; }
.nsrc-bar i { width: var(--w); border-radius: 99px; background: var(--c); opacity: .28; transition: opacity .3s var(--ease-out, ease-out), transform .35s var(--ease-out, ease-out); transform-origin: 50% 50%; }
.nsrc-bar i.on { opacity: 1; transform: scaleY(1.35); }

.nsrc-body { display: grid; grid-template-columns: minmax(0, 196px) minmax(0, 1fr); border-top: 1px solid var(--nsrc-border); }

/* sources */
.nsrc-list { display: flex; flex-direction: column; gap: 2px; padding: 10px; background: var(--nsrc-sunk); border-right: 1px solid var(--nsrc-border); }
.nsrc-src {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 9px; border: 0; border-radius: 11px; background: transparent;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  transition: background .25s var(--ease-out, ease-out), box-shadow .25s var(--ease-out, ease-out);
}
@media (hover: hover) { .nsrc-src:hover { background: color-mix(in srgb, var(--c) 7%, transparent); } }
.nsrc-src.on { background: var(--nsrc-surface); box-shadow: 0 0 0 1px var(--nsrc-border), 0 6px 16px -10px rgba(60,40,20,.35); }
.nsrc-src:focus-visible { outline: 2px solid var(--accent, #6F57E8); outline-offset: 1px; }
.nsrc-mono {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c);
  font-size: 12px; font-weight: 800; letter-spacing: -.02em;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent);
}
.nsrc-mono.sm { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
@media (prefers-color-scheme: dark) { .nsrc-mono { background: color-mix(in srgb, var(--c) 26%, transparent); color: color-mix(in srgb, var(--c) 55%, #fff); } }
.nsrc-meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.nsrc-meta b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nsrc-meta em { font-style: normal; font-size: 11.5px; color: var(--text-3, #958B84); white-space: nowrap; }

/* files */
.nsrc-files { padding: 14px 16px 16px; min-height: 300px; }
.nsrc-fhead { display: flex; align-items: center; gap: 9px; margin: 2px 2px 12px; }
.nsrc-fhead b { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.nsrc-n { margin-left: auto; font-size: 12px; color: var(--text-3, #958B84); }
.nsrc-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.nsrc-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--nsrc-sunk); border: 1px solid var(--nsrc-border);
}
.nsrc-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nsrc-tx b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nsrc-tx em { display: flex; align-items: center; gap: 6px; font-style: normal; font-size: 11.5px; color: var(--text-3, #958B84); white-space: nowrap; overflow: hidden; }
.nsrc-from { flex: none; }
.nsrc-tx code {
  flex: none; font: 600 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 0 6px; border-radius: 5px;
  color: color-mix(in srgb, var(--nsrc-c) 80%, var(--text, #221E1C)); background: color-mix(in srgb, var(--nsrc-c) 12%, transparent);
}
.nsrc-when { overflow: hidden; text-overflow: ellipsis; }
.nsrc-size { flex: none; font-size: 12.5px; font-weight: 600; color: var(--text-2, #645C56); font-variant-numeric: tabular-nums; }

.nsrc-more { margin: 12px 4px 0; font-size: 12px; color: var(--text-3, #958B84); }
.nsrc-more code { font: 600 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.nsrc-files.in .nsrc-more { animation: nsrcIn .45s var(--ease-out, ease-out) both; animation-delay: 230ms; }

/* file glyph: a page with a coloured label */
.nsrc-fi { position: relative; flex: none; width: 24px; height: 30px; border-radius: 4px; background: #fff; box-shadow: 0 1px 2px rgba(40,25,10,.22); }
.nsrc-fi::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: 5px; height: 9px; border-radius: 2px; background: var(--k, #9A918A); }
.k-pdf { --k: #E5604D; } .k-mov { --k: #6E9BF2; } .k-img { --k: #EE8A74; } .k-zip { --k: #A88457; } .k-doc { --k: #8C78F5; }
.k-xls { --k: #3E9B6A; } .k-key { --k: #E3A23A; } .k-txt { --k: #9A918A; } .k-dat { --k: #4A4541; }

/* swap motion: out quickly, rows in with a short stagger */
.nsrc-files > * { transition: opacity .17s var(--ease-out, ease-out), transform .2s var(--ease-out, ease-out); }
.nsrc-files.out > * { opacity: 0; transform: translateY(-3px); }
.nsrc-files.in .nsrc-row { animation: nsrcIn .45s var(--ease-out, ease-out) both; animation-delay: calc(var(--k) * 70ms); }
.nsrc-files.in .nsrc-fhead { animation: nsrcIn .35s var(--ease-out, ease-out) both; }
@keyframes nsrcIn { from { opacity: 0; transform: translateY(6px); } }

/* narrow: sources become a scrolling row of chips above the files */
@container nsrc (max-width: 520px) {
  .nsrc-head { padding: 14px 14px 10px; }
  .nsrc-hint { display: none; }
  .nsrc-bar { margin: 0 14px 12px; }
  .nsrc-body { grid-template-columns: minmax(0, 1fr); }
  .nsrc-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; border-right: 0; border-bottom: 1px solid var(--nsrc-border); padding: 8px; }
  .nsrc-list::-webkit-scrollbar { display: none; }
  .nsrc-src { width: auto; flex: none; padding: 6px 10px 6px 6px; }
  .nsrc-src .nsrc-meta em { display: none; }
  .nsrc-mono { width: 26px; height: 26px; border-radius: 8px; font-size: 10.5px; }
  .nsrc-files { padding: 12px; min-height: 0; }
  .nsrc-row { padding: 9px 10px; gap: 10px; }
}
@container nsrc (max-width: 360px) { .nsrc-from { display: none; } }
@media (max-width: 640px) { nestly-sources { min-height: 442px; } }

.nsrc-static *, nestly-sources.nsrc-static .nsrc-files * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { nestly-sources * { animation: none !important; transition: none !important; } }
