.imb-shell {
  position: fixed;
  inset: 18px;
  z-index: 2200;
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  color: #172033;
  background: rgba(248, 250, 252, .96);
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, .22);
  backdrop-filter: blur(18px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.imb-shell[hidden] {
  display: none;
}

.imb-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2199;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  color: #fff;
  background: #2563eb;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(37, 99, 235, .34);
  font-weight: 700;
  cursor: pointer;
}

.imb-topbar,
.imb-toolbar,
.imb-statusbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .28);
}

.imb-topbar {
  justify-content: space-between;
  background: #fff;
}

.imb-title {
  font-size: 16px;
  font-weight: 800;
}

.imb-path {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #64748b;
  font-size: 13px;
}

.imb-path button {
  color: #2563eb;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.imb-toolbar {
  flex-wrap: wrap;
  background: #f8fafc;
}

.imb-spacer {
  flex: 1;
}

.imb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  color: #172033;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.imb-btn:hover {
  border-color: #2563eb;
  color: #1d4ed8;
}

.imb-btn.primary {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.imb-btn.danger {
  color: #b91c1c;
}

.imb-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.imb-search {
  width: 230px;
  height: 34px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  outline: 0;
}

.imb-main {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
}

.imb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 16px;
}

.imb-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1.16;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .45);
  border-radius: 8px;
  cursor: default;
}

.imb-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
}

.imb-thumb {
  display: grid;
  place-items: center;
  height: calc(100% - 42px);
  background: #e2e8f0;
}

.imb-thumb img,
.imb-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.imb-folder {
  color: #f59e0b;
  font-size: 18px;
  font-weight: 800;
}

.imb-file {
  color: #64748b;
  font-size: 42px;
}

.imb-name {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 9px;
  border-top: 1px solid rgba(148, 163, 184, .26);
  font-size: 12px;
  font-weight: 700;
}

.imb-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imb-check {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.imb-statusbar {
  justify-content: space-between;
  min-height: 42px;
  background: #fff;
  color: #64748b;
  font-size: 13px;
}

.imb-menu {
  position: fixed;
  z-index: 2300;
  min-width: 178px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .45);
  border-radius: 8px;
  box-shadow: 0 16px 46px rgba(15, 23, 42, .2);
}

.imb-menu button {
  display: flex;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  color: #172033;
  text-align: left;
  cursor: pointer;
}

.imb-menu button:hover {
  background: #eff6ff;
}

.imb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .86);
}

.imb-lightbox[hidden],
.imb-menu[hidden] {
  display: none;
}

.imb-lightbox img {
  max-width: min(92vw, 1400px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, .35);
}

.imb-progress {
  height: 4px;
  background: #dbeafe;
}

.imb-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: #2563eb;
  transition: width .2s ease;
}

@media (max-width: 720px) {
  .imb-shell {
    inset: 0;
    border-radius: 0;
  }

  .imb-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
    padding: 10px;
  }

  .imb-search {
    width: 100%;
  }
}
