/* storage.bielik.online - layout on top of shadcn-html (tokens + component CSS from the CDN) */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  background: var(--background);
  color: var(--foreground);
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted-foreground); }
.spacer { flex: 1; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: color-mix(in oklab, var(--background) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; letter-spacing: -0.01em; margin-right: 0.25rem; }
.brand svg, .btn svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }

.layout {
  display: grid;
  grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  max-width: 90rem;
  margin: 0 auto;
  padding: 1rem;
}
.pane { min-width: 0; }
.locked { max-width: 28rem; margin: 4rem auto; text-align: center; }
.pane .card-content { display: flex; flex-direction: column; gap: 0.75rem; }

#tree-scroll { max-height: calc(100vh - 14rem); min-height: 8rem; overflow: auto; margin: 0 -0.25rem; padding: 0 0.25rem; }
.tree-branch-trigger, .tree-leaf { min-width: 0; }
.tree-branch-trigger svg:nth-child(2) { color: color-mix(in oklab, var(--primary) 70%, #2563eb); }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-meta { color: var(--muted-foreground); font-size: 0.75rem; white-space: nowrap; }
.tree-leaf .btn { margin-left: 0.25rem; }
.is-selected { background: var(--accent); font-weight: 500; }

.head-row { display: flex; flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.head-text { min-width: 0; flex: 1 1 16rem; }
.head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.head-actions .btn { gap: 0.375rem; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.125rem; font-weight: 600; }
.crumbs .sep { color: var(--muted-foreground); padding: 0 0.125rem; font-weight: 400; }
.crumbs .btn { font-weight: 600; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 1.75rem; }

.table-container { overflow-x: auto; }
.table .num { text-align: right; white-space: nowrap; }
.table .when { white-space: nowrap; }
.table .act { width: 1%; text-align: right; }
.table td.name { max-width: 0; width: 100%; }
.name-cell { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.name-cell svg { width: 1rem; height: 1rem; flex-shrink: 0; color: var(--muted-foreground); }
.name-inner { display: contents; }
.name-cell .label-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-cell button.link { all: unset; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.name-cell button.link:hover .label-text { text-decoration: underline; }
.name-cell button.link:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm); }

.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg, 0.75rem);
  padding: 1.25rem; text-align: center; color: var(--muted-foreground);
}
#list-pane.drag .dropzone { border-color: var(--ring); background: var(--accent); color: var(--foreground); }

.uploads { display: flex; flex-direction: column; gap: 0.5rem; }
.up { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.5rem 0.75rem; display: grid; gap: 0.375rem; }
.up-top { display: flex; align-items: center; gap: 0.5rem; justify-content: space-between; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.up-state { font-size: 0.8125rem; color: var(--muted-foreground); }
.up.err .up-state { color: var(--destructive); }

.field-error { color: var(--destructive); font-size: 0.8125rem; margin: 0.5rem 0 0; }
.dialog-body .input { margin-top: 0.375rem; width: 100%; }

.notes { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 50; max-width: min(24rem, calc(100vw - 2rem)); }
.note {
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: 0 8px 30px oklch(0 0 0 / 0.18);
  padding: 0.625rem 0.875rem; font-size: 0.875rem;
}
.note.err { border-color: var(--destructive); }

@media (max-width: 56rem) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0.75rem; }
  #tree-scroll { max-height: 40vh; }
  .table .when { display: none; }
}
