:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --border: #e4dfd5;
  --text: #1a1814;
  --text-muted: #6b6862;
  --accent: #2d4a2b;
  --accent-soft: #e8efe5;
  --danger: #9b3434;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 8px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.10);
  --radius: 10px;
  --radius-sm: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1814;
    --surface: #2a2620;
    --surface-2: #35302a;
    --border: #4a4339;
    --text: #f7f4ec;
    --text-muted: #b0a89c;
    --accent: #a8d09b;
    --accent-soft: #3a4836;
    --danger: #e88c8c;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.4);
    --shadow-hover: 0 4px 8px rgba(0,0,0,0.4), 0 12px 32px rgba(0,0,0,0.5);
  }
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============= LOGIN ============= */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}

.login-logo {
  color: var(--accent);
  margin-bottom: 16px;
}

.login-card h1 {
  font-size: 22px;
  margin: 0 0 6px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.login-subtitle {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.login-form input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

.login-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}

.login-form button {
  margin-top: 8px;
  padding: 11px 16px;
  background: var(--accent);
  color: var(--surface);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.login-form button:hover { opacity: 0.92; }

.login-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
}

/* ============= TOPBAR ============= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: 15px;
  padding: 2px 4px;
  border-radius: 4px;
}
.brand:hover { background: var(--surface-2); text-decoration: none; }
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-text { white-space: nowrap; }
@media (max-width: 520px) { .brand-text { display: none; } }

/* Notice toast (krátké informace, kopírovatelný link, atd.) */
.notice-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  z-index: 100;
  max-width: 90vw;
  animation: notice-in 200ms ease-out;
}
.notice-toast.notice-leaving { animation: notice-out 180ms ease-in forwards; }
.notice-toast .notice-text { line-height: 1.4; }
.notice-toast .notice-link {
  font-family: ui-monospace, SFMono-Regular, Menospace, monospace;
  color: var(--accent);
  user-select: all;
}
.notice-toast button.notice-action {
  background: var(--accent);
  color: var(--surface);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.notice-toast button.notice-action:hover { opacity: 0.9; }
.notice-toast button.notice-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}
@keyframes notice-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes notice-out {
  from { opacity: 1; transform: translate(-50%, 0); }
  to   { opacity: 0; transform: translate(-50%, 10px); }
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.back-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.back-btn[hidden] { display: none; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  min-width: 0;
}

.breadcrumb a {
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 4px;
}

.breadcrumb a:hover {
  color: var(--text);
  text-decoration: none;
  background: var(--surface-2);
}

.breadcrumb a.current {
  color: var(--text);
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
}
.breadcrumb a.current:hover {
  background: var(--surface-2);
}

.breadcrumb-sep {
  color: var(--text-muted);
  opacity: 0.5;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-btn {
  background: none;
  border: 1px solid transparent;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.view-btn:hover { background: var(--surface-2); color: var(--text); }
.view-btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--border); }

.logout {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.logout:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

/* ============= CONTENT ============= */
.content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px;
}

.loading, .empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.65;
  margin: 0 0 14px;
}

.section + .section { margin-top: 32px; }

/* ============= GRID VIEW ============= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  text-decoration: none;
}

.card-media {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* PDF thumbnail = full první stránka (žádný crop), aby byl čitelný i typografický layout */
.card-media img.pdf-thumb {
  object-fit: contain;
  background: white;
  padding: 6px;
}

/* Zámek na zaheslované root složce — překrytí v levém horním rohu karty */
.lock-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.list-lock {
  opacity: 0.8;
  font-size: 13px;
}

.card-media .placeholder {
  color: var(--text-muted);
  opacity: 0.9;
}

.card-media .placeholder svg { width: 44px; height: 44px; }

.card.folder .card-media {
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-2));
}

.card.folder .card-media .placeholder { color: var(--accent); opacity: 1; }

.card-body {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.card-body-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.card-download-body {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card-download-body:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  text-decoration: none;
  color: var(--bg);
}

.card-info-body {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-family: serif;
  font-style: italic;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}
.card-info-body:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-muted);
}

/* ============= INFO POPOVER ============= */
.info-popover {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 14px 16px;
  min-width: 240px;
  max-width: 340px;
  z-index: 200;
  font-size: 13px;
}

.info-popover-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-popover-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  padding: 3px 0;
}

.info-popover-row .label {
  color: var(--text-muted);
  font-size: 12px;
}

.info-popover-row .value {
  color: var(--text);
  font-size: 12px;
  word-break: break-word;
}

.info-popover-row .value.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.ext-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.55);
  color: white;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}


/* ============= LIST VIEW ============= */
.list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.list-row {
  display: grid;
  grid-template-columns: 36px 36px 1fr 100px 100px 140px 36px 40px;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.list-row:first-child { border-top: none; }
.list-row:hover { background: var(--surface-2); text-decoration: none; }

.list-row .icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.list-row.folder .icon { color: var(--accent); }

.list-row .icon img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
}

.list-row .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row .meta {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.list-header {
  display: grid;
  grid-template-columns: 36px 36px 1fr 100px 100px 140px 36px 40px;
  gap: 14px;
  padding: 8px 16px;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

/* ============= PREVIEW ============= */
.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.preview-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.preview-body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  max-height: calc(90vh - 60px);
}

.preview-body img, .preview-body video {
  max-width: 100%;
  max-height: calc(90vh - 60px);
  display: block;
}

.preview-meta {
  padding: 12px 72px 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.preview-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: rgba(0,0,0,0.4);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}

.preview-close:hover { background: rgba(0,0,0,0.7); }

.download-fab {
  position: absolute;
  bottom: 12px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.download-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  text-decoration: none;
  color: var(--bg);
}

/* ============= RESPONSIVE ============= */
/* ============= ACTION BUTTONS ============= */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.action-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.action-btn svg { flex-shrink: 0; }
.action-btn[title]:hover { color: var(--accent); }

/* ============= CARD ACTIONS ============= */
.card { position: relative; }

.card-menu {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.45);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 2;
}

.card:hover .card-menu { opacity: 1; }
.card-menu:hover { background: rgba(0,0,0,0.75); }

/* ============= CONTEXT MENU ============= */
.ctx-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  padding: 4px;
  min-width: 180px;
  z-index: 200;
}

.ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.ctx-menu-item:hover { background: var(--surface-2); }
.ctx-menu-item.danger { color: var(--danger); }
.ctx-menu-item.danger:hover { background: rgba(220,80,80,0.1); }

.ctx-menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }

/* ============= DROP OVERLAY ============= */
.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 74, 43, 0.85);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-message {
  text-align: center;
  color: white;
  border: 3px dashed rgba(255,255,255,0.5);
  border-radius: var(--radius);
  padding: 60px 80px;
}

.drop-message svg { margin-bottom: 16px; }
.drop-message p { font-size: 18px; margin: 0; }
.drop-message strong { color: var(--accent); background: white; padding: 2px 8px; border-radius: 4px; }

/* ============= UPLOAD TOAST ============= */
.upload-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 360px;
  max-width: calc(100vw - 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  z-index: 150;
  overflow: hidden;
}

.upload-toast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
}

.upload-toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.upload-list {
  max-height: 200px;
  overflow-y: auto;
}

.upload-item {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.upload-item:first-child { border-top: none; }

.upload-item-name {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.upload-item-name .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.upload-item-name .status { font-size: 11px; color: var(--text-muted); }
.upload-item-name .status.error { color: var(--danger); }
.upload-item-name .status.done { color: var(--accent); }

.upload-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.upload-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.15s ease;
}

/* ============= MODAL ============= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-hover);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modal-content h2,
.modal-content p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  color: var(--text-muted);
  border: none;
  width: 30px;
  height: 30px;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  border-radius: 50%;
}

.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-content h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
}

.modal-form { display: flex; flex-direction: column; gap: 12px; }

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.modal-form input[type=text], .modal-form input[type=password] {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.modal-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}

.modal-form .checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary, .btn-secondary {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}

.btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:hover { opacity: 0.92; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }

.btn-danger { background: var(--danger); color: white; }

.share-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.share-link-row input {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.share-list { margin-top: 4px; max-height: 300px; overflow-y: auto; }

.share-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.share-row:first-child { border-top: none; }

.share-row .info { min-width: 0; flex: 1; }
.share-row .path { font-weight: 600; font-size: 14px; }
.share-row .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.share-row .meta .pw-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
  margin-right: 6px;
}

.share-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

/* ============= BULK SELECTION ============= */
.list-row .checkbox-cell, .list-header .checkbox-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
  margin: 0;
}

.list-row.selected {
  background: var(--accent-soft);
}

.list-row.selected:hover {
  background: var(--accent-soft);
  filter: brightness(1.05);
}

/* ===== Bulk select (grid) + drag-drop přesun ===== */
.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}
.card.dragging,
.list-row.dragging {
  opacity: 0.4;
}
.card.drop-hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent);
  background: var(--accent-soft);
}
.list-row.drop-hover {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* ===== Folder picker (Přesunout do…) ===== */
.move-picker-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  margin-bottom: 10px;
}
.move-crumb-link {
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font: inherit;
}
.move-crumb-link:hover { background: var(--accent-soft); }
.move-crumb-sep { color: var(--muted, #999); }
.move-picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  background: var(--surface-2);
}
.move-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.move-picker-item:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.move-picker-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.move-picker-item svg { color: var(--accent); flex-shrink: 0; }
.move-picker-empty {
  padding: 16px 12px;
  text-align: center;
  color: var(--muted, #999);
  font-size: 13px;
}

.bulk-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 8px 8px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-hover);
  z-index: 140;
  animation: bulk-bar-in 0.2s ease;
}

@keyframes bulk-bar-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.bulk-bar-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.bulk-bar-actions {
  display: flex;
  gap: 4px;
}

.bulk-bar button {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.bulk-bar button:hover { background: var(--surface); border-color: var(--text-muted); }
.bulk-bar button.danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.bulk-bar button.danger:hover { filter: brightness(1.08); }
.bulk-bar button.ghost { border-color: transparent; background: transparent; }
.bulk-bar button.ghost:hover { background: var(--surface-2); }

/* ============= COVER CROP ============= */
.cover-modal { max-width: 560px; }

.cover-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px 16px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.cover-drop:hover, .cover-drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.cover-drop svg { display: block; margin: 0 auto 8px; opacity: 0.7; }
.cover-drop strong { color: var(--accent); }

.cover-crop {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: grab;
  user-select: none;
}
.cover-crop:active { cursor: grabbing; }
.cover-crop img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: 0 0;
  max-width: none;
  pointer-events: none;
}
.cover-crop-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15) inset;
}

.cover-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.cover-zoom input[type=range] {
  flex: 1;
  accent-color: var(--accent);
}

.cover-info {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.cover-gif-notice {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  text-align: center;
}

/* ============= READONLY (share view) ============= */
body.readonly #btn-upload,
body.readonly #btn-upload-folder,
body.readonly #btn-mkdir,
body.readonly #btn-shares,
body.readonly #logout-link,
body.readonly .card-menu { display: none !important; }

/* ============= RESPONSIVE ============= */
@media (max-width: 700px) {
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .topbar-right { gap: 6px; }
  .action-btn span { display: none; }
  .action-btn { padding: 7px; }
  .content { padding: 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .list-row, .list-header { grid-template-columns: 30px 28px 1fr 70px 32px 40px; }
  .list-row .col-modified, .list-header .col-modified,
  .list-row .col-items, .list-header .col-items { display: none; }
  .list-row > div:nth-child(3), .list-header > div:nth-child(3) { display: block; }
  .breadcrumb { font-size: 13px; }
  .upload-toast { left: 10px; right: 10px; bottom: 10px; width: auto; }
}
