/* Seiten-Anordnung cloud: nur Layout, Komponenten kommen aus app.css. */

/* Speicheranzeige im Seitenkopf: ruhige duenne Leiste */
.cl-usage { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s2); font-size: var(--fs-sm); color: var(--text-2); white-space: nowrap; }
.cl-meter { flex: 0 1 180px; min-width: 64px; height: 4px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.cl-meter i { display: block; height: 100%; background: var(--accent-deep); border-radius: inherit; }

/* Brotkrumen */
.cl-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: calc(-1 * var(--s2)) 0 var(--s4); font-size: var(--fs-ui); }
.cl-crumb { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--s2); border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; max-width: 240px; }
.cl-crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-crumb .ic { font-size: 15px; vertical-align: 0; }
a.cl-crumb:hover { background: var(--surface-2); color: var(--ink); }
.cl-crumb.cur { color: var(--ink); font-weight: 600; }
.cl-sep { display: inline-flex; color: var(--text-3); font-size: 14px; }

/* Leiste: Suche waechst, Rest fest */
.cl-search { position: relative; display: block; flex: 1 1 200px; max-width: 360px; min-width: 0; }
.bar .cl-search { flex: 1 1 200px; }
.cl-search > .ic { position: absolute; left: 12px; top: 50%; margin-top: -8px; font-size: 16px; color: var(--text-3); pointer-events: none; }
.cl-search .input { padding-left: 38px; }
.cl-search .input::-webkit-search-cancel-button { cursor: pointer; }
.cl-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-2); font-size: var(--fs-xs); font-weight: 600; }
@media (min-width: 768px) and (max-width: 1023px) {
  .cl-bar-row [data-act=trash] span:not(.cl-count) { display: none; }
  .cl-bar-row .seg button span:not(.cnt) { display: none; }
}
@media (max-width: 767px) {
  .page-cloud .ph .acts { width: 100%; }
  .page-cloud .ph .acts .btn { flex: 1 1 0; }
  .cl-search, .bar .cl-search { flex: 1 1 100%; max-width: none; }
  .cl-bar-row .seg { flex: 1 1 auto; }
  .cl-bar-row .seg button { flex: 1; justify-content: center; }
}
.cl-note { margin-bottom: var(--s4); }
.cl-found { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); font-size: var(--fs-ui); color: var(--text-2); }
.cl-found .il { min-width: 0; }
.cl-found .il > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cl-msg:not(:empty) { margin-bottom: var(--s4); }

/* Liste */
.cl-list > li { min-height: 60px; }
.cl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-list .s { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.cl-where { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); min-width: 0; }
.cl-where .ic { font-size: 13px; vertical-align: 0; }
.cl-size { flex: none; width: 96px; text-align: right; color: var(--text-2); font-size: var(--fs-ui); }
.cl-date { flex: none; width: 92px; text-align: right; color: var(--text-3); font-size: var(--fs-ui); }
.cl-restore { flex: none; }
@media (min-width: 768px) { .cl-list .cl-sub { display: none; } .cl-list [data-trash] .cl-sub { display: inline; } }
@media (max-width: 767px) {
  .cl-size, .cl-date { display: none; }
  .cl-restore span { display: none; }
  .cl-restore { width: var(--ctl); padding: 0; }
}

/* Kacheln */
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: var(--s3); }
.cl-grid.cl-folders { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: var(--s3); }
@media (max-width: 420px) { .cl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cl-grid.cl-folders { grid-template-columns: minmax(0, 1fr); } }
.cl-tile { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; cursor: pointer; transition: border-color 150ms ease, transform 160ms var(--ease-out); }
.cl-tile:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .cl-tile:hover { border-color: var(--line-2); } }
.cl-thumb { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-3); font-size: 34px; overflow: hidden; }
.cl-tile.is-folder { flex-direction: row; align-items: center; gap: var(--s3); padding: var(--s3); grid-column: span 1; }
.cl-tile.is-folder .cl-thumb { aspect-ratio: auto; flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-deep); font-size: 20px; }
.cl-tile.is-folder .cl-tile-tx { padding: 0 32px 0 0; }
.cl-tile.is-folder .cl-tile-menu { top: 50%; bottom: auto; margin-top: -16px; }
.cl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cl-tile-tx { padding: var(--s2) var(--s3) var(--s3); min-width: 0; padding-right: 40px; }
.cl-tile-tx .cl-name { font-weight: 600; font-size: var(--fs-ui); line-height: 1.3; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cl-tile.is-folder .cl-tile-tx .cl-name { -webkit-line-clamp: 1; }
.cl-tile-tx .cl-sub { color: var(--text-3); font-size: var(--fs-sm); }
.cl-tile-menu { position: absolute; right: 4px; bottom: 6px; }

/* Uploads */
.cl-uploads { margin-bottom: var(--s4); }
.cl-up .main-col { display: flex; flex-direction: column; gap: 6px; }
.cl-up .s { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: 0; }
.cl-bar { height: 4px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.cl-bar i { display: block; width: 100%; height: 100%; background: var(--accent-deep); border-radius: inherit; transform-origin: left center; transition: transform 200ms var(--ease-out); }
.cl-up.done .cl-bar i { background: var(--ok); }
.cl-up-foot { display: flex; justify-content: flex-end; padding: var(--s2) var(--s3); border-top: 1px solid var(--line); }

/* Ablageflaeche unter der Liste und beim Ziehen ueber die Seite */
.cl-drop-foot { margin-top: var(--s4); }
.cl-drop-foot .drop { padding: var(--s3) var(--s4); }
.cl-drop-foot .drop .pv { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); font-size: 18px; }
.page-cloud.cl-dragging .drop { border-color: var(--accent-deep); background: var(--accent-soft); }

/* Vorschau */
.cl-preview { display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: var(--r-md); overflow: hidden; min-height: 200px; }
.cl-pv-img { display: block; max-width: 100%; max-height: 68vh; object-fit: contain; }
.cl-pv-frame { display: block; width: 100%; height: 68vh; border: 0; background: #fff; }
.cl-pv-meta { margin-top: var(--s3); }

/* Ordnerbaum beim Verschieben */
.cl-tree { display: flex; flex-direction: column; gap: 2px; max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s1); background: #fff; }
.cl-tree-i { display: flex; align-items: center; gap: var(--s2); min-height: var(--ctl); padding: 0 var(--s3) 0 calc(var(--s3) + var(--d, 0) * 18px); border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); font: 500 var(--fs-ui)/1.2 var(--sans); text-align: left; cursor: pointer; }
.cl-tree-i .ic { flex: none; font-size: 16px; color: var(--text-3); vertical-align: 0; }
.cl-tree-i span:not(.tag) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-tree-i:hover { background: var(--surface-2); }
.cl-tree-i.on { background: var(--accent-soft); font-weight: 600; }
.cl-tree-i.on .ic { color: var(--accent-deep); }
